Skip to content

Commit

Permalink
fix: return undefined from mine() instead of null to match inte…
Browse files Browse the repository at this point in the history
…rface
  • Loading branch information
fubhy committed Apr 26, 2023
1 parent 43867af commit eb32e6c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/lovely-steaks-hear.md
@@ -0,0 +1,5 @@
---
"viem": patch
---

Fixed `mine()` to resolve to `undefined` instead of `null`.
2 changes: 1 addition & 1 deletion src/actions/test/mine.ts
Expand Up @@ -37,7 +37,7 @@ export async function mine<TChain extends Chain | undefined>(
client: TestClient<TestClientMode, Transport, TChain>,
{ blocks, interval }: MineParameters,
) {
return await client.request({
await client.request({
method: `${client.mode}_mine`,
params: [numberToHex(blocks), numberToHex(interval || 0)],
})
Expand Down
2 changes: 1 addition & 1 deletion src/clients/decorators/test.test.ts
Expand Up @@ -87,7 +87,7 @@ describe('smoke test', () => {
})

test('mine', async () => {
expect(await testClient.mine({ blocks: 1 })).toBeDefined()
expect(await testClient.mine({ blocks: 1 })).toBeUndefined()
})

test('removeBlockTimestampInterval', async () => {
Expand Down

1 comment on commit eb32e6c

@vercel
Copy link

@vercel vercel bot commented on eb32e6c Apr 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.