Add stake management function to ERC4337Utils (#5471)

This commit is contained in:
Hadrien Croubois
2025-01-31 16:35:57 +01:00
committed by GitHub
parent 840c974028
commit 828dbc357c
4 changed files with 106 additions and 5 deletions

View File

@ -7,8 +7,11 @@ const clock = {
timestamp: () => time.latest().then(ethers.toBigInt),
};
const clockFromReceipt = {
blocknumber: receipt => Promise.resolve(ethers.toBigInt(receipt.blockNumber)),
timestamp: receipt => ethers.provider.getBlock(receipt.blockNumber).then(block => ethers.toBigInt(block.timestamp)),
blocknumber: receipt => Promise.resolve(receipt).then(({ blockNumber }) => ethers.toBigInt(blockNumber)),
timestamp: receipt =>
Promise.resolve(receipt)
.then(({ blockNumber }) => ethers.provider.getBlock(blockNumber))
.then(({ timestamp }) => ethers.toBigInt(timestamp)),
};
const increaseBy = {
blockNumber: mine,