From 2215158c1423cf518e32df857023fd1801090638 Mon Sep 17 00:00:00 2001 From: Philip Liu <12836897+philipliu@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:26:04 -0400 Subject: [PATCH] SEP-6: Support async deposit info (#132) --- @stellar/anchor-tests/package.json | 2 +- @stellar/anchor-tests/src/schemas/sep6.ts | 7 +------ @stellar/anchor-tests/src/tests/sep6/withdraw.ts | 4 +++- server/package.json | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/@stellar/anchor-tests/package.json b/@stellar/anchor-tests/package.json index c6c8b27..d6e2f97 100644 --- a/@stellar/anchor-tests/package.json +++ b/@stellar/anchor-tests/package.json @@ -1,6 +1,6 @@ { "name": "@stellar/anchor-tests", - "version": "0.6.7", + "version": "0.6.8", "description": "stellar-anchor-tests is a library and command line interface for testing Stellar anchors.", "main": "./lib/index.js", "types": "./lib/index.d.ts", diff --git a/@stellar/anchor-tests/src/schemas/sep6.ts b/@stellar/anchor-tests/src/schemas/sep6.ts index 440cb58..1a8aa35 100644 --- a/@stellar/anchor-tests/src/schemas/sep6.ts +++ b/@stellar/anchor-tests/src/schemas/sep6.ts @@ -261,12 +261,7 @@ export const transactionsSchema = { export function getTransactionSchema(isDeposit: boolean) { const schema = JSON.parse(JSON.stringify(transactionSchema)); const requiredDepositParams = ["to"]; - const requiredWithdrawParams = [ - "from", - "withdraw_memo", - "withdraw_memo_type", - "withdraw_anchor_account", - ]; + const requiredWithdrawParams = ["from"]; const depositProperties = { deposit_memo: { diff --git a/@stellar/anchor-tests/src/tests/sep6/withdraw.ts b/@stellar/anchor-tests/src/tests/sep6/withdraw.ts index 9e94993..39cf619 100644 --- a/@stellar/anchor-tests/src/tests/sep6/withdraw.ts +++ b/@stellar/anchor-tests/src/tests/sep6/withdraw.ts @@ -446,7 +446,9 @@ export const returnsProperSchemaForKnownAccounts: Test = { memoValue = Buffer.from(responseBody.memo, "base64"); } try { - new Memo(responseBody.memo_type, memoValue); + if (memoValue) { + new Memo(responseBody.memo_type, memoValue); + } } catch { result.failure = makeFailure(this.failureModes.INVALID_SCHEMA, { errors: "invalid 'memo' for 'memo_type'", diff --git a/server/package.json b/server/package.json index 44b0e23..f272346 100644 --- a/server/package.json +++ b/server/package.json @@ -30,6 +30,6 @@ "winston": "^3.3.3" }, "peerDependencies": { - "@stellar/anchor-tests": "0.6.7" + "@stellar/anchor-tests": "0.6.8" } }