Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 7f871ce

Browse files
author
luu-alex
committed
update addresses
1 parent 33e70f4 commit 7f871ce

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

.github/workflows/e2e_network_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
INFURA_SEPOLIA_HTTP: ${{ secrets.INFURA_SEPOLIA_HTTP }}
3131
INFURA_MAINNET_HTTP: ${{ secrets.INFURA_MAINNET_HTTP }}
3232
MODE: ${{ matrix.mode }}
33-
TEST_ACCOUNT_ADDRESS: ${{ fromJSON('{"sepolia":"0x0000000000000000000000000000000000000000","mainnet":"0x0000000000000000000000000000000000000000"}')[matrix.network] }}
33+
TEST_ACCOUNT_ADDRESS: ${{ fromJSON('{"sepolia":"0xa127C5E6a7E3600Ac34A9a9928E52521677e7211","mainnet":"0x98AF911164f9d4E0f5983ed114949c3Bfe3ADc9d"}')[matrix.network] }}
3434
ALLOWED_SEND_TRANSACTION: ${{ secrets.E2E_TESTS_ALLOWED_SEND_TRANSACTION }}
3535
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }}
3636
strategy:

packages/web3-eth-abi/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export const formatParam = (type: string, _param: unknown): unknown => {
166166
const param = typeof _param === 'object' && !Array.isArray(_param) ? { ..._param } : _param;
167167

168168
// Format BN to string
169-
if (param instanceof BigInt) {
169+
if (param instanceof BigInt || typeof param === 'bigint') {
170170
return param.toString(10);
171171
}
172172

packages/web3/test/e2e/get_balance.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { isBigInt, isHexStrict, isString } from 'web3-validator';
1818
import { toHex } from 'web3-utils';
1919

2020
import Web3, { FMT_BYTES, FMT_NUMBER } from '../../src';
21-
import { getSystemE2ETestProvider } from './e2e_utils';
21+
import { getSystemE2ETestProvider, getE2ETestAccountAddress } from './e2e_utils';
2222
import { closeOpenConnection, getSystemTestBackend } from '../shared_fixtures/system_tests_utils';
2323
import { toAllVariants } from '../shared_fixtures/utils';
2424
import { sepoliaBlockData } from './fixtures/sepolia';
@@ -64,8 +64,7 @@ describe(`${getSystemTestBackend()} tests - getBalance`, () => {
6464
format: [FMT_NUMBER.BIGINT, FMT_NUMBER.HEX, FMT_NUMBER.STR],
6565
}),
6666
)('getBalance', async ({ block, format }) => {
67-
const address = getSystemTestBackend() === 'sepolia' ? '0xa127C5E6a7E3600Ac34A9a9928E52521677e7211' : '0x98AF911164f9d4E0f5983ed114949c3Bfe3ADc9d'
68-
const result = await web3.eth.getBalance(address, blockData[block], {
67+
const result = await web3.eth.getBalance(getE2ETestAccountAddress(), blockData[block], {
6968
number: format as FMT_NUMBER,
7069
bytes: FMT_BYTES.HEX,
7170
});
@@ -86,7 +85,7 @@ describe(`${getSystemTestBackend()} tests - getBalance`, () => {
8685
expect(result).toBe(expectedBalance);
8786
break;
8887
case 'NUMBER_BIGINT':
89-
// eslint-disable-next-line jest/no-conditional-expect
88+
// eslint-dgit cisable-next-line jest/no-conditional-expect
9089
expect(result).toBe(BigInt(expectedBalance));
9190
break;
9291
default:

packages/web3/test/e2e/get_transaction_count.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License
1515
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717
import Web3 from '../../src';
18-
import { getSystemE2ETestProvider } from './e2e_utils';
18+
import { getSystemE2ETestProvider, getE2ETestAccountAddress } from './e2e_utils';
1919
import { closeOpenConnection, getSystemTestBackend } from '../shared_fixtures/system_tests_utils';
2020
import { toAllVariants } from '../shared_fixtures/utils';
2121
import { sepoliaBlockData } from './fixtures/sepolia';
@@ -57,9 +57,8 @@ describe(`${getSystemTestBackend()} tests - getTransactionCount`, () => {
5757
],
5858
}),
5959
)('getTransactionCount', async ({ block }) => {
60-
const address = getSystemTestBackend() === 'sepolia' ? '0xa127C5E6a7E3600Ac34A9a9928E52521677e7211' : '0x98AF911164f9d4E0f5983ed114949c3Bfe3ADc9d'
6160
const result = await web3.eth.getTransactionCount(
62-
address,
61+
getE2ETestAccountAddress(),
6362
blockData[block],
6463
);
6564

packages/web3/test/e2e/sepolia/get_storage_at.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
1717
import Web3, { Numbers } from '../../../src';
1818
import {
1919
getSystemE2ETestProvider,
20+
getE2ETestAccountAddress,
2021
getE2ETestContractAddress,
2122
} from '../e2e_utils';
2223
import {
@@ -78,7 +79,10 @@ describe(`${getSystemTestBackend()} tests - getStorageAt`, () => {
7879
).toBeTruthy();
7980
} else {
8081
// eslint-disable-next-line jest/no-conditional-expect
81-
expect(result).toBe("0x000000000000000000000000a127c5e6a7e3600ac34a9a9928e52521677e7211"
82+
expect(result).toBe(
83+
`0x000000000000000000000000${getE2ETestAccountAddress()
84+
.substring(2)
85+
.toLowerCase()}`,
8286
);
8387
}
8488
});

0 commit comments

Comments
 (0)