Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed Jan 8, 2025
1 parent f6602ce commit c778090
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions libs/remix-simulator/test/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('blocks', () => {
})
await provider.init()
web3.setProvider(provider as any)
})
})

describe('eth_getBlockByNumber', () => {
it('should get block given its number', async () => {
Expand Down Expand Up @@ -40,7 +40,7 @@ describe('blocks', () => {

assert.deepEqual(block, expectedBlock)
})
})
})

describe('eth_getGasPrice', () => {
it('should get gas price', async () => {
Expand All @@ -63,6 +63,17 @@ describe('blocks', () => {
})
})

describe('evm_mine', () => {
it('should mine empty block using evm_mine', async function () {
await web3.provider.request({
method: 'evm_mine',
params: [{ blocks: 3 }],
})
const number = await web3.eth.getBlockNumber()
assert.equal(number, 3)
})
})

describe('eth_getBlockByHash', () => {
it('should get block given its hash', async () => {
const correctBlock = await web3.eth.getBlock(0)
Expand Down

0 comments on commit c778090

Please sign in to comment.