From 67f236942d44a2c234dcf9cd0f5f3311e7e8cb62 Mon Sep 17 00:00:00 2001 From: kan Date: Thu, 27 Jun 2024 14:07:37 +0400 Subject: [PATCH] problem: broken test solution: replace goerli with sepolia in tests --- .../__integration-tests__/blockchain.test.ts | 4 +-- .../src/__integration-tests__/token.test.ts | 32 +++++++++---------- .../__integration-tests__/transaction.test.ts | 12 +++---- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/node/src/__integration-tests__/blockchain.test.ts b/packages/node/src/__integration-tests__/blockchain.test.ts index ba92a1b..0e0d20a 100644 --- a/packages/node/src/__integration-tests__/blockchain.test.ts +++ b/packages/node/src/__integration-tests__/blockchain.test.ts @@ -330,11 +330,11 @@ describe('BlockchainClient', () => { } }); - test('get ethereum goerli fees', async () => { + test('get ethereum sepolia fees', async () => { const client = api.blockchain(); const response = await client.estimateFees({ - blockchain: 10005, + blockchain: 10009, blocks: 10, mode: 'avgLast', }); diff --git a/packages/node/src/__integration-tests__/token.test.ts b/packages/node/src/__integration-tests__/token.test.ts index c772685..2ba151e 100644 --- a/packages/node/src/__integration-tests__/token.test.ts +++ b/packages/node/src/__integration-tests__/token.test.ts @@ -13,27 +13,27 @@ describe('TokenClient', () => { test('GetTokens', async () => { const client = api.token(); const value = await client.getTokens({ - blockchain: Blockchain.TESTNET_GOERLI, + blockchain: Blockchain.TESTNET_SEPOLIA, address: '0x7af963cf6d228e564e2a0aa0ddbf06210b38615d', contractAddresses: [], }); console.log('GetTokens', value); expect(value.address).toBe('0x7af963cf6d228e564e2a0aa0ddbf06210b38615d'); - expect(value.blockchain).toBe(Blockchain.TESTNET_GOERLI); + expect(value.blockchain).toBe(Blockchain.TESTNET_SEPOLIA); }); test('SubscribeTokens', (done) => { const client = api.token(); const call = client.subscribeTokens({ - blockchain: Blockchain.TESTNET_GOERLI, - address: '0x7af963cf6d228e564e2a0aa0ddbf06210b38615d', - contractAddresses: ['0x3f152b63ec5ca5831061b2dccfb29a874c317502'], + blockchain: Blockchain.TESTNET_SEPOLIA, + address: '0x9744c11004a16cfee68a45a69dde7913e098f4f5', + contractAddresses: ['0x089652957c24f0c904b390e4bb2b57121f591472'], }); call.onData((value) => { - expect(value.address).toBe('0x7af963cf6d228e564e2a0aa0ddbf06210b38615d'); - expect(value.blockchain).toBe(Blockchain.TESTNET_GOERLI); - expect(value.contractAddresses[0]).toBe('0x3f152b63ec5ca5831061b2dccfb29a874c317502'); + expect(value.address).toBe('0x9744c11004a16cfee68a45a69dde7913e098f4f5'); + expect(value.blockchain).toBe(Blockchain.TESTNET_SEPOLIA); + expect(value.contractAddresses[0]).toBe('0x089652957c24f0c904b390e4bb2b57121f591472'); console.log('SubscribeTokens', value); call.cancel(); done(); @@ -48,29 +48,29 @@ describe('TokenClient', () => { test('GetAllowanceTokens', async () => { const client = api.token(); const value = await client.getAllowanceTokens({ - blockchain: Blockchain.TESTNET_GOERLI, + blockchain: Blockchain.TESTNET_SEPOLIA, address: '0x0000000000000000000000000000000000000000', - contractAddresses: ['0x509ee0d083ddf8ac028f2a56731412edd63223b9'], + contractAddresses: ['0x2863192e43fd72f0405719041504e19fd6e70d24'], }); console.log('GetAllowanceTokens', value); - expect(value.blockchain).toBe(Blockchain.TESTNET_GOERLI); + expect(value.blockchain).toBe(Blockchain.TESTNET_SEPOLIA); expect(value.address).toBe('0x0000000000000000000000000000000000000000'); - expect(value.approvedForAddress[0]).toBe('0x509ee0d083ddf8ac028f2a56731412edd63223b9'); + expect(value.approvedForAddress[0]).toBe('0x2863192e43fd72f0405719041504e19fd6e70d24'); }); test('GetAllowanceAmounts', (done) => { const client = api.token(); const call = client.getAllowanceAmounts({ - blockchain: Blockchain.TESTNET_GOERLI, + blockchain: Blockchain.TESTNET_SEPOLIA, address: '0x0000000000000000000000000000000000000000', - contractAddresses: ['0x509ee0d083ddf8ac028f2a56731412edd63223b9'], + contractAddresses: ['0x2863192e43fd72f0405719041504e19fd6e70d24'], }); call.onData((value) => { console.log('GetAllowanceAmounts', value); - expect(value.blockchain).toBe(Blockchain.TESTNET_GOERLI); + expect(value.blockchain).toBe(Blockchain.TESTNET_SEPOLIA); expect(value.address).toBe('0x0000000000000000000000000000000000000000'); - expect(value.contractAddress).toBe('0x509ee0d083ddf8ac028f2a56731412edd63223b9'); + expect(value.contractAddress).toBe('0x2863192e43fd72f0405719041504e19fd6e70d24'); // spender address is not checked, as it could be changed in the future // expect(value.ownerAddress).toBe('0x23160eb5db66cf0f876df64751e02dbee16fb340'); expect(value.spenderAddress).toBe('0x0000000000000000000000000000000000000000'); diff --git a/packages/node/src/__integration-tests__/transaction.test.ts b/packages/node/src/__integration-tests__/transaction.test.ts index c92a860..3a95fe8 100644 --- a/packages/node/src/__integration-tests__/transaction.test.ts +++ b/packages/node/src/__integration-tests__/transaction.test.ts @@ -15,13 +15,13 @@ describe('TransactionClient', () => { client .getTransactions({ - address: '0x7af963cf6d228e564e2a0aa0ddbf06210b38615d', - blockchain: Blockchain.TESTNET_GOERLI, + address: '0x01066F7d28a2e86cAcd9f9579657077Efe8E371b', + blockchain: Blockchain.TESTNET_SEPOLIA, limit: 1, }) .onData(({ address, blockchain, failed }) => { - expect(address).toEqual('0x7af963cf6d228e564e2a0aa0ddbf06210b38615d'); - expect(blockchain).toEqual(Blockchain.TESTNET_GOERLI); + expect(address).toEqual('0x01066f7d28a2e86cacd9f9579657077efe8e371b'); + expect(blockchain).toEqual(Blockchain.TESTNET_SEPOLIA); expect(failed).toEqual(false); done(); @@ -34,8 +34,8 @@ describe('TransactionClient', () => { const call = client .subscribeTransactions({ - address: '0x7af963cf6d228e564e2a0aa0ddbf06210b38615d', - blockchain: Blockchain.TESTNET_GOERLI, + address: '0x01066F7d28a2e86cAcd9f9579657077Efe8E371b', + blockchain: Blockchain.TESTNET_SEPOLIA, }) .onError((error) => done(error));