Skip to content

Commit f41611e

Browse files
committed
fix: timestamp type
1 parent 5535951 commit f41611e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/dev/createAnvilClient.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ type AnvilRPCSchema = [
4848
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
4949
export type AnvilActions = {
5050
isAnvil: () => Promise<boolean>;
51-
evmMineDetailed: (timestamp: bigint) => Promise<Block<Hex> | undefined>;
51+
evmMineDetailed: (
52+
/**
53+
* Block timestamp in seconds
54+
*/
55+
timestamp: bigint | number,
56+
) => Promise<Block<Hex> | undefined>;
5257
};
5358

5459
export type AnvilClient = Prettify<
@@ -87,7 +92,7 @@ export function createAnvilClient({
8792
.extend(walletActions)
8893
.extend(client => ({
8994
isAnvil: () => isAnvil(client),
90-
evmMineDetailed: (timestamp: bigint) =>
95+
evmMineDetailed: (timestamp: bigint | number) =>
9196
evmMineDetailed(client, timestamp),
9297
})) as any;
9398
}
@@ -119,7 +124,7 @@ export async function isAnvil(
119124
*/
120125
export async function evmMineDetailed(
121126
client: Client<any, any, any, AnvilRPCSchema, any>,
122-
timestamp: bigint,
127+
timestamp: bigint | number,
123128
): Promise<Block<Hex> | undefined> {
124129
try {
125130
const [block] = await client.request({

0 commit comments

Comments
 (0)