Skip to content

Commit

Permalink
problem: broken test
Browse files Browse the repository at this point in the history
solution: replace goerli with sepolia in tests
  • Loading branch information
kanazirsky committed Jun 27, 2024
1 parent 35cc856 commit 67f2369
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions packages/node/src/__integration-tests__/blockchain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
Expand Down
32 changes: 16 additions & 16 deletions packages/node/src/__integration-tests__/token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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');
Expand Down
12 changes: 6 additions & 6 deletions packages/node/src/__integration-tests__/transaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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));

Expand Down

0 comments on commit 67f2369

Please sign in to comment.