Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luu-alex committed Jul 29, 2024
1 parent 20f2171 commit 7f349fb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
9 changes: 7 additions & 2 deletions packages/web3/test/e2e/get_block.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,20 @@ import { format as formatter } from 'web3-utils';

import Web3, { FMT_BYTES, FMT_NUMBER } from '../../src';
import { getSystemE2ETestProvider } from './e2e_utils';
import { closeOpenConnection, getSystemTestBackend, BACKEND } from '../shared_fixtures/system_tests_utils';
import {
closeOpenConnection,
getSystemTestBackend,
BACKEND,
} from '../shared_fixtures/system_tests_utils';
import { toAllVariants } from '../shared_fixtures/utils';
import { sepoliaBlock, sepoliaBlockData, sepoliaBlockHydrated } from './fixtures/sepolia';
import { mainnetBlockHydrated } from './fixtures/mainnet_block_hydrated';
import { mainnetBlock, mainnetBlockData } from './fixtures/mainnet';

describe(`${getSystemTestBackend()} tests - getBlock`, () => {
const provider = getSystemE2ETestProvider();
const blockData = getSystemTestBackend() === BACKEND.SEPOLIA ? sepoliaBlockData : mainnetBlockData;
const blockData =
getSystemTestBackend() === BACKEND.SEPOLIA ? sepoliaBlockData : mainnetBlockData;

let web3: Web3;

Expand Down
19 changes: 17 additions & 2 deletions packages/web3/test/e2e/get_transaction_from_block.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,26 @@ describe(`${getSystemTestBackend()} tests - getTransactionFromBlock`, () => {

it.each(
toAllVariants<{
block: 'latest' | 'pending' | 'finalized' | 'safe' | 'blockHash' | 'blockNumber';
block:
| 'earliest'
| 'latest'
| 'pending'
| 'finalized'
| 'safe'
| 'blockHash'
| 'blockNumber';
transactionIndex: Numbers;
format: string;
}>({
block: ['latest', 'pending', 'safe', 'finalized', 'blockHash', 'blockNumber'],
block: [
'earliest',
'latest',
'pending',
'safe',
'finalized',
'blockHash',
'blockNumber',
],
transactionIndex: ['0x1', '1', 1, BigInt(1)],
}),
)('getTransactionFromBlock', async ({ block, transactionIndex }) => {
Expand Down

0 comments on commit 7f349fb

Please sign in to comment.