From e2b7106f8c42b583c9c45b41eb103ea81180e15a Mon Sep 17 00:00:00 2001 From: Jake Urban <10968980+JakeUrban@users.noreply.github.com> Date: Wed, 13 Apr 2022 09:52:51 -0700 Subject: [PATCH] SEP-12: remove 'account' param from requests (#82) --- @stellar/anchor-tests/package.json | 2 +- .../anchor-tests/src/tests/sep12/getCustomer.ts | 14 +++++--------- .../anchor-tests/src/tests/sep12/putCustomer.ts | 3 --- CHANGELOG.md | 6 ++++++ 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/@stellar/anchor-tests/package.json b/@stellar/anchor-tests/package.json index ff9b583..d5f465b 100644 --- a/@stellar/anchor-tests/package.json +++ b/@stellar/anchor-tests/package.json @@ -1,6 +1,6 @@ { "name": "@stellar/anchor-tests", - "version": "0.3.0", + "version": "0.4.0", "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/sep12/getCustomer.ts b/@stellar/anchor-tests/src/tests/sep12/getCustomer.ts index becfbc1..a84c517 100644 --- a/@stellar/anchor-tests/src/tests/sep12/getCustomer.ts +++ b/@stellar/anchor-tests/src/tests/sep12/getCustomer.ts @@ -121,9 +121,7 @@ const newCustomerValidSchema: Test = { ); if (!token) return result; const customerType = getCreateCustomerType(config); - const requestParamsObj: Record = { - account: clientKeypair.publicKey(), - }; + const requestParamsObj: Record = {}; if (customerType) requestParamsObj["type"] = customerType; const searchParams = new URLSearchParams(requestParamsObj); const getCustomerCall: NetworkCall = { @@ -261,8 +259,8 @@ export const canFetchExistingCustomerById: Test = { }; tests.push(canFetchExistingCustomerById); -const canFetchExistingCustomerByAccount: Test = { - assertion: "can retrieve customer using 'account'", +const canFetchExistingCustomerBySep10Token: Test = { + assertion: "can retrieve customer using SEP-10 token", sep: 12, group: getCustomerGroup, dependencies: [canCreateCustomer], @@ -315,9 +313,7 @@ const canFetchExistingCustomerByAccount: Test = { } const result: Result = { networkCalls: [] }; const customerType = getCreateCustomerType(config); - const requestParamsObj: Record = { - account: this.context.expects.clientKeypair.publicKey(), - }; + const requestParamsObj: Record = {}; if (customerType) requestParamsObj["type"] = customerType; const searchParams = new URLSearchParams(requestParamsObj); const getCustomerCall: NetworkCall = { @@ -353,6 +349,6 @@ const canFetchExistingCustomerByAccount: Test = { return result; }, }; -tests.push(canFetchExistingCustomerByAccount); +tests.push(canFetchExistingCustomerBySep10Token); export default tests; diff --git a/@stellar/anchor-tests/src/tests/sep12/putCustomer.ts b/@stellar/anchor-tests/src/tests/sep12/putCustomer.ts index 4fb97d9..05fd251 100644 --- a/@stellar/anchor-tests/src/tests/sep12/putCustomer.ts +++ b/@stellar/anchor-tests/src/tests/sep12/putCustomer.ts @@ -117,7 +117,6 @@ export const canCreateCustomer: Test = { const putCustomerRequest = makeSep12Request({ url: this.context.expects.kycServerUrl + "/customer", data: { - account: this.context.expects.clientKeypair.publicKey(), ...customerValues, }, headers: { @@ -295,7 +294,6 @@ export const differentMemosSameAccount: Test = { const sep12Request = makeSep12Request({ url: this.context.expects.kycServerUrl + "/customer", data: { - account: this.context.provides.sendingAnchorClientKeypair.publicKey(), memo: this.context.provides.sendingCustomerMemo.value.toString( "base64", ), @@ -327,7 +325,6 @@ export const differentMemosSameAccount: Test = { const receivingCustomerRequest = makeSep12Request({ url: this.context.expects.kycServerUrl + "/customer", data: { - account: this.context.provides.sendingAnchorClientKeypair.publicKey(), memo: this.context.provides.receivingCustomerMemo.value.toString( "base64", ), diff --git a/CHANGELOG.md b/CHANGELOG.md index a087128..69140fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ This changelog documents all releases and included changes to the @stellar/ancho A breaking change will get clearly marked in this log. +## [v0.4.0](https://github.com/stellar/stellar-anchor-tests/compare/v0.3.0...v0.4.0) + +### Update + +- SEP-12 tests no longer include the `account` request parameter since it has been deprecated. ([#82](https://github.com/stellar/stellar-anchor-tests/pull/82)) + ## [v0.3.0](https://github.com/stellar/stellar-anchor-tests/compare/v0.2.0...v0.3.0) ### Update