Skip to content

Commit

Permalink
test with new keys
Browse files Browse the repository at this point in the history
  • Loading branch information
avkos committed Oct 2, 2024
1 parent fece16e commit d6fd3b0
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 33 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/e2e_network_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ on:
- v4.*

# For test purpose only:
# pull_request:
# branches:
# - '4.x'
# types: [ opened, reopened, synchronize ]
pull_request:
branches:
- '4.x'
types: [ opened, reopened, synchronize ]
jobs:
build:
name: Build Packages
Expand Down
44 changes: 25 additions & 19 deletions packages/web3/test/e2e/get_block_transaction_count.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,29 +77,35 @@ describe(`${getSystemTestBackend()} tests - getBlockTransactionCount`, () => {
_blockData =
block === 'blockHash' ? (latestBlock.hash as string) : Number(latestBlock.number);
}

const result = await web3.eth.getBlockTransactionCount(_blockData, {
number: format as FMT_NUMBER,
bytes: FMT_BYTES.HEX,
});
switch (format) {
case 'NUMBER_NUMBER':
// eslint-disable-next-line jest/no-conditional-expect
expect(isNumber(result)).toBeTruthy();
break;
case 'NUMBER_HEX':
// eslint-disable-next-line jest/no-conditional-expect
expect(isHexStrict(result)).toBeTruthy();
break;
case 'NUMBER_STR':
// eslint-disable-next-line jest/no-conditional-expect
expect(isString(result)).toBeTruthy();
break;
case 'NUMBER_BIGINT':
// eslint-disable-next-line jest/no-conditional-expect
expect(isBigInt(result)).toBeTruthy();
break;
default:
throw new Error('Unhandled format');
if (block === 'pending') {
// eslint-disable-next-line jest/no-conditional-expect
expect(result).toBeNull();
} else {
switch (format) {
case 'NUMBER_NUMBER':
// eslint-disable-next-line jest/no-conditional-expect
expect(isNumber(result)).toBeTruthy();
break;
case 'NUMBER_HEX':
// eslint-disable-next-line jest/no-conditional-expect
expect(isHexStrict(result)).toBeTruthy();
break;
case 'NUMBER_STR':
// eslint-disable-next-line jest/no-conditional-expect
expect(isString(result)).toBeTruthy();
break;
case 'NUMBER_BIGINT':
// eslint-disable-next-line jest/no-conditional-expect
expect(isBigInt(result)).toBeTruthy();
break;
default:
throw new Error('Unhandled format');
}
}
});
});
6 changes: 3 additions & 3 deletions packages/web3/test/e2e/get_block_uncle_count.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/
import Web3 from '../../src';
import { Web3 } from '../../src';
import { getSystemE2ETestProvider } from './e2e_utils';
import {
closeOpenConnection,
Expand Down Expand Up @@ -74,8 +74,8 @@ describeIf(getSystemTestBackend() !== 'hardhat')(
: Number(latestBlock.number);
}
const result = await web3.eth.getBlockUncleCount(_blockData);

expect(result).toBe(BigInt(0));
// eslint-disable-next-line no-null/no-null
expect(result).toBe(block === 'pending' || block === 'earliest' ? null : BigInt(0));
});
},
);
2 changes: 1 addition & 1 deletion packages/web3/test/e2e/get_fee_history.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe(`${getSystemTestBackend()} tests - estimateGas`, () => {
format: string;
}>({
blockCount: [1, '2', 3, BigInt(4)],
newestBlock: ['earliest', 'latest', 'pending', 'safe', 'finalized', 'blockNumber'],
newestBlock: ['earliest', 'latest', 'safe', 'finalized', 'blockNumber'],
rewardPercentiles: [['0xa', '20', 30, BigInt(40)]],
format: Object.values(FMT_NUMBER),
}),
Expand Down
8 changes: 4 additions & 4 deletions packages/web3/test/e2e/get_proof.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ describe(`${getSystemTestBackend()} tests - getProof`, () => {
| 'blockNumber';
}>({
block: [
'earliest',
// 'earliest', // error "distance to target block exceeds maximum proof window"
'latest',
// 'pending',
// 'pending', // error "unknown block number"
'safe',
'finalized',
// 'blockHash',
// 'blockNumber',
// 'blockHash', // error "distance to target block exceeds maximum proof window"
// 'blockNumber', // error "distance to target block exceeds maximum proof window"
],
}),
)('getProof', async ({ block }) => {
Expand Down
3 changes: 1 addition & 2 deletions packages/web3/test/e2e/get_protocol_version.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ describe(`${getSystemTestBackend()} tests - getProtocolVersion`, () => {
await closeOpenConnection(web3);
});

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

0 comments on commit d6fd3b0

Please sign in to comment.