From 25312fb4eef3eb6e49c1da0d8877e061ad4c1632 Mon Sep 17 00:00:00 2001 From: lenkan Date: Thu, 16 Nov 2023 18:11:05 +0100 Subject: [PATCH 1/2] fix: remove name parameter from exchanges.get method --- src/keri/app/exchanging.ts | 17 +++++++---------- test/app/exchanging.test.ts | 15 +++++---------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/keri/app/exchanging.ts b/src/keri/app/exchanging.ts index 85ba3005..4ecde1f9 100644 --- a/src/keri/app/exchanging.ts +++ b/src/keri/app/exchanging.ts @@ -127,20 +127,17 @@ export class Exchanges { return await res.json(); } - /** - * Get exn messages + * Get exn message by said * @async - * @returns {Promise} A promise to the exn message - * @param name - * @param said + * @returns A promise to the exn message + * @param said The said of the exn message */ - async get(name:string, said:string) { - let path = `/identifiers/${name}/exchanges/${said}`; - let method = 'GET'; - let res = await this.client.fetch(path, method, null); + async get(said: string): Promise { + const path = `/exchanges/${said}`; + const method = 'GET'; + const res = await this.client.fetch(path, method, null); return await res.json(); - } } diff --git a/test/app/exchanging.test.ts b/test/app/exchanging.test.ts index e0da67fb..3d367c14 100644 --- a/test/app/exchanging.test.ts +++ b/test/app/exchanging.test.ts @@ -381,21 +381,16 @@ describe('exchange', () => { it('Get exchange', async () => { await libsodium.ready; const bran = '0123456789abcdefghijk'; - let client = new SignifyClient(url, bran, Tier.low, boot_url); + const client = new SignifyClient(url, bran, Tier.low, boot_url); await client.boot(); await client.connect(); - let exchanges = client.exchanges(); - await exchanges.get( - 'aid1', - 'EBfdlu8R27Fbx-ehrqwImnK-8Cm79sqbAQ4MmvEAYqao' - ); - let lastCall = fetchMock.mock.calls[fetchMock.mock.calls.length - 1]!; + const exchanges = client.exchanges(); + await exchanges.get('EBfdlu8R27Fbx-ehrqwImnK-8Cm79sqbAQ4MmvEAYqao'); + const lastCall = fetchMock.mock.calls[fetchMock.mock.calls.length - 1]!; assert.equal( lastCall[0]!, - url + - '/identifiers/aid1/exchanges/EBfdlu8R27Fbx-ehrqwImnK-8Cm79sqbAQ4MmvEAYqao' + url + '/exchanges/EBfdlu8R27Fbx-ehrqwImnK-8Cm79sqbAQ4MmvEAYqao' ); assert.equal(lastCall[1]!.method, 'GET'); - }); }); From 9725ede459b1a916b29c5633772d0eafd20de673 Mon Sep 17 00:00:00 2001 From: Kent Bull <65027257+kentbull@users.noreply.github.com> Date: Tue, 21 Nov 2023 05:13:09 -0700 Subject: [PATCH 2/2] fix multisig.ts usage - remove name param (#2) --- examples/integration-scripts/multisig.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/integration-scripts/multisig.ts b/examples/integration-scripts/multisig.ts index dc1f2887..d7c5c40a 100644 --- a/examples/integration-scripts/multisig.ts +++ b/examples/integration-scripts/multisig.ts @@ -1161,7 +1161,7 @@ async function run() { msgSaid = await waitForMessage(client4, '/exn/ipex/grant'); console.log('Holder received exchange message with the grant message'); - res = await client4.exchanges().get('holder',msgSaid); + res = await client4.exchanges().get(msgSaid); let [admit, asigs, aend] = await client4 .ipex()