Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
guspiel committed Jan 5, 2025
1 parent 56627ce commit 08ff06e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 33 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/testnet-nightly-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,4 @@ jobs:
RELAYER_SIGNER_ADDRESSES: ${{ vars.CI_TESTNET_RELAYER_SIGNER_ADDRESSES }}
RELAYER_SIGNING_KEYS: ${{ secrets.CI_TESTNET_RELAYER_SIGNING_KEYS }}
run: |
NO_FORMATTING=true TESTNET=true ./tooling-e2e-tests/full_scenario.sh
NO_FORMATTING=true TESTNET=true ./tooling-e2e-tests/recovery_scenario.sh
NO_FORMATTING=true TESTNET=true ./tooling-e2e-tests/many_actors.sh
NO_FORMATTING=true TESTNET=true ./tooling-e2e-tests/ts_sdk_tests.sh
slack-notification:
name: Slack notification
runs-on: ubuntu-22.04
needs: [e2e-tests]
if: >
!cancelled() &&
github.event_name != 'workflow_dispatch'
steps:
- name: Send Slack message
uses: Cardinal-Cryptography/github-actions/slack-notification@v7
with:
notify-on: "failure"
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_ZKOS }}
2 changes: 1 addition & 1 deletion ts/shielder-sdk-tests/playwright.base.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default defineConfig({
],
reporter: process.env.CI ? "blob" : "list",
retries: process.env.CI ? 2 : 0,
testMatch: ["tests/**/*.test.ts"],
testMatch: ["tests/shielder/stateSync.test.ts", "tests/chain/relayer.test.ts"],
timeout: 240 * 1000, // 240 seconds
use: {
baseURL: url,
Expand Down
45 changes: 31 additions & 14 deletions ts/shielder-sdk/src/chain/relayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,42 @@ export class Relayer implements IRelayer {
): Promise<WithdrawResponse> => {
let response;
try {
let requestBodyTrimmed = JSON.stringify(
{
expected_contract_version: expectedContractVersion,
id_hiding: idHiding,
amount,
withdraw_address: withdrawAddress,
merkle_root: merkleRoot,
nullifier_hash: oldNullifierHash,
new_note: newNote,
proof: Array.from(proof.slice(0, 10))
},
(_, value: unknown) =>
typeof value === "bigint" ? value.toString() : value
);
let requestBody = JSON.stringify(
{
expected_contract_version: expectedContractVersion,
id_hiding: idHiding,
amount,
withdraw_address: withdrawAddress,
merkle_root: merkleRoot,
nullifier_hash: oldNullifierHash,
new_note: newNote,
proof: Array.from(proof)
},
(_, value: unknown) =>
typeof value === "bigint" ? value.toString() : value
);
console.log("Withdraw request body (proof trimmed): " + requestBodyTrimmed);

response = await fetch(`${this.url}${relayPath}`, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(
{
expected_contract_version: expectedContractVersion,
id_hiding: idHiding,
amount,
withdraw_address: withdrawAddress,
merkle_root: merkleRoot,
nullifier_hash: oldNullifierHash,
new_note: newNote,
proof: Array.from(proof)
},
(_, value: unknown) =>
typeof value === "bigint" ? value.toString() : value
)
body: requestBody
});
} catch (error) {
throw new GenericWithdrawError(`${(error as Error).message}`);
Expand Down

0 comments on commit 08ff06e

Please sign in to comment.