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

Commit d6fd3b0

Browse files
committed
test with new keys
1 parent fece16e commit d6fd3b0

File tree

6 files changed

+38
-33
lines changed

6 files changed

+38
-33
lines changed

.github/workflows/e2e_network_tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ on:
77
- v4.*
88

99
# For test purpose only:
10-
# pull_request:
11-
# branches:
12-
# - '4.x'
13-
# types: [ opened, reopened, synchronize ]
10+
pull_request:
11+
branches:
12+
- '4.x'
13+
types: [ opened, reopened, synchronize ]
1414
jobs:
1515
build:
1616
name: Build Packages

packages/web3/test/e2e/get_block_transaction_count.test.ts

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,29 +77,35 @@ describe(`${getSystemTestBackend()} tests - getBlockTransactionCount`, () => {
7777
_blockData =
7878
block === 'blockHash' ? (latestBlock.hash as string) : Number(latestBlock.number);
7979
}
80+
8081
const result = await web3.eth.getBlockTransactionCount(_blockData, {
8182
number: format as FMT_NUMBER,
8283
bytes: FMT_BYTES.HEX,
8384
});
84-
switch (format) {
85-
case 'NUMBER_NUMBER':
86-
// eslint-disable-next-line jest/no-conditional-expect
87-
expect(isNumber(result)).toBeTruthy();
88-
break;
89-
case 'NUMBER_HEX':
90-
// eslint-disable-next-line jest/no-conditional-expect
91-
expect(isHexStrict(result)).toBeTruthy();
92-
break;
93-
case 'NUMBER_STR':
94-
// eslint-disable-next-line jest/no-conditional-expect
95-
expect(isString(result)).toBeTruthy();
96-
break;
97-
case 'NUMBER_BIGINT':
98-
// eslint-disable-next-line jest/no-conditional-expect
99-
expect(isBigInt(result)).toBeTruthy();
100-
break;
101-
default:
102-
throw new Error('Unhandled format');
85+
if (block === 'pending') {
86+
// eslint-disable-next-line jest/no-conditional-expect
87+
expect(result).toBeNull();
88+
} else {
89+
switch (format) {
90+
case 'NUMBER_NUMBER':
91+
// eslint-disable-next-line jest/no-conditional-expect
92+
expect(isNumber(result)).toBeTruthy();
93+
break;
94+
case 'NUMBER_HEX':
95+
// eslint-disable-next-line jest/no-conditional-expect
96+
expect(isHexStrict(result)).toBeTruthy();
97+
break;
98+
case 'NUMBER_STR':
99+
// eslint-disable-next-line jest/no-conditional-expect
100+
expect(isString(result)).toBeTruthy();
101+
break;
102+
case 'NUMBER_BIGINT':
103+
// eslint-disable-next-line jest/no-conditional-expect
104+
expect(isBigInt(result)).toBeTruthy();
105+
break;
106+
default:
107+
throw new Error('Unhandled format');
108+
}
103109
}
104110
});
105111
});

packages/web3/test/e2e/get_block_uncle_count.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GNU Lesser General Public License for more details.
1414
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
*/
17-
import Web3 from '../../src';
17+
import { Web3 } from '../../src';
1818
import { getSystemE2ETestProvider } from './e2e_utils';
1919
import {
2020
closeOpenConnection,
@@ -74,8 +74,8 @@ describeIf(getSystemTestBackend() !== 'hardhat')(
7474
: Number(latestBlock.number);
7575
}
7676
const result = await web3.eth.getBlockUncleCount(_blockData);
77-
78-
expect(result).toBe(BigInt(0));
77+
// eslint-disable-next-line no-null/no-null
78+
expect(result).toBe(block === 'pending' || block === 'earliest' ? null : BigInt(0));
7979
});
8080
},
8181
);

packages/web3/test/e2e/get_fee_history.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe(`${getSystemTestBackend()} tests - estimateGas`, () => {
6262
format: string;
6363
}>({
6464
blockCount: [1, '2', 3, BigInt(4)],
65-
newestBlock: ['earliest', 'latest', 'pending', 'safe', 'finalized', 'blockNumber'],
65+
newestBlock: ['earliest', 'latest', 'safe', 'finalized', 'blockNumber'],
6666
rewardPercentiles: [['0xa', '20', 30, BigInt(40)]],
6767
format: Object.values(FMT_NUMBER),
6868
}),

packages/web3/test/e2e/get_proof.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ describe(`${getSystemTestBackend()} tests - getProof`, () => {
5555
| 'blockNumber';
5656
}>({
5757
block: [
58-
'earliest',
58+
// 'earliest', // error "distance to target block exceeds maximum proof window"
5959
'latest',
60-
// 'pending',
60+
// 'pending', // error "unknown block number"
6161
'safe',
6262
'finalized',
63-
// 'blockHash',
64-
// 'blockNumber',
63+
// 'blockHash', // error "distance to target block exceeds maximum proof window"
64+
// 'blockNumber', // error "distance to target block exceeds maximum proof window"
6565
],
6666
}),
6767
)('getProof', async ({ block }) => {

packages/web3/test/e2e/get_protocol_version.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ describe(`${getSystemTestBackend()} tests - getProtocolVersion`, () => {
3333
await closeOpenConnection(web3);
3434
});
3535

36-
// doesn't exists with lodestar provider
37-
it.skip('should get the protocol version for the connected node', async () => {
36+
it('should get the protocol version for the connected node', async () => {
3837
const result = await web3.eth.getProtocolVersion();
3938
expect(isHexStrict(result)).toBeTruthy();
4039
});

0 commit comments

Comments
 (0)