blockchain training#87
Open
Jumongweb wants to merge 1 commit into
Open
Conversation
Contributor
|
Hey! Looks like CI is red across the board here — e2e tests, lint, typecheck, and unit tests all failing. Could you take a look and get the build green? Happy to help unblock if you want to pair on it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #70
Implemented the Soroban contract webhook flow end to end.
The new route is POST /stellar/contract/webhook in src/stellar/stellar.controller.ts (line 78), with raw-body HMAC verification enabled from bootstrap in src/main.ts (line 14). The webhook logic lives in src/stellar/stellar.service.ts (line 172): it verifies x-stellar-signature against STELLAR_WEBHOOK_SECRET, rejects events outside the 5-minute replay window, treats existing transaction hashes as idempotent 200 replays, persists TIP_EVENTs, fires creator notifications, and updates linked withdrawal state for WITHDRAWAL_EVENTs. I also documented the contract topics in src/stellar/contract/events.ts (line 1).
To support linked withdrawals and cleaner idempotency, I extended the tip model in src/entities/tip.entity.ts (line 17) with withdrawalStatus and withdrawalTransactionHash, and I tightened tip creation in src/tips/tips.service.ts (line 214) so pending tips store null instead of '' for transactionHash. I added coverage for valid signed events, invalid signatures, replayed events, stale events, and linked withdrawals in test/stellar-contract-webhook.e2e-spec.ts (line 30).
I wasn’t able to complete a real test run locally because this workspace didn’t have a usable dependency install, and npm ci failed with an npm CLI error (Exit handler never called!) while populating node_modules.