From 9379fa77bacd09038a047a902b3462878edcd0c1 Mon Sep 17 00:00:00 2001 From: Jiahui Hu Date: Wed, 27 Nov 2024 16:04:30 -0500 Subject: [PATCH] [ANCHOR-809][SEP-6] Fix `/info` test logic (#177) * fix /info test logic * bump version --- @stellar/anchor-tests/package.json | 2 +- @stellar/anchor-tests/src/tests/sep6/info.ts | 10 ++++------ server/package.json | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/@stellar/anchor-tests/package.json b/@stellar/anchor-tests/package.json index ae37fb2..4a09bfd 100644 --- a/@stellar/anchor-tests/package.json +++ b/@stellar/anchor-tests/package.json @@ -1,6 +1,6 @@ { "name": "@stellar/anchor-tests", - "version": "0.6.19", + "version": "0.6.20", "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/tests/sep6/info.ts b/@stellar/anchor-tests/src/tests/sep6/info.ts index bcbace3..199b692 100644 --- a/@stellar/anchor-tests/src/tests/sep6/info.ts +++ b/@stellar/anchor-tests/src/tests/sep6/info.ts @@ -276,13 +276,11 @@ const requiredDepositFieldsMatchConfiguration: Test = { const depositFieldKeys = Object.keys( config.sepConfig["6"].deposit.transactionFields, ); - for (const configuredKey of depositFieldKeys) { - if ( - !this.context.expects.sep6DepositFieldsRequired.includes(configuredKey) - ) { + for (const requiredKey of this.context.expects.sep6DepositFieldsRequired) { + if (depositFieldKeys.includes(requiredKey)) { result.failure = makeFailure(this.failureModes.FIELD_NOT_FOUND); - result.expected = configuredKey; - result.actual = this.context.expects.sep6DepositFieldsRequired; + result.expected = requiredKey; + result.actual = depositFieldKeys; return result; } } diff --git a/server/package.json b/server/package.json index ab5cccc..f0090c9 100644 --- a/server/package.json +++ b/server/package.json @@ -30,6 +30,6 @@ "winston": "^3.3.3" }, "peerDependencies": { - "@stellar/anchor-tests": "0.6.19" + "@stellar/anchor-tests": "0.6.20" } }