Skip to content

Commit

Permalink
Added block option to lidoWithdrawStatus Hardhat task (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
naddison36 authored Dec 9, 2024
1 parent e92e65e commit 0148a94
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/js/tasks/lido.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ async function setZapper() {
await logTxDetails(tx, "setZap");
}

const lidoWithdrawStatus = async ({ id }) => {
const lidoWithdrawStatus = async ({ block, id }) => {
const blockTag = await getBlock(block);
const lidoWithdrawalQueueAddress = await parseAddress("LIDO_WITHDRAWAL");
const stEthWithdrawQueue = await hre.ethers.getContractAt(
"IStETHWithdrawal",
lidoWithdrawalQueueAddress
);

const status = await stEthWithdrawQueue.getWithdrawalStatus([id]);
const status = await stEthWithdrawQueue.getWithdrawalStatus([id], {
blockTag,
});

console.log(
`Withdrawal request ${id} for ${formatUnits(
Expand Down
6 changes: 6 additions & 0 deletions src/js/tasks/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,12 @@ task("claimLidoWithdraws").setAction(async (_, __, runSuper) => {

subtask("lidoWithdrawStatus", "Get the status of a Lido withdrawal request")
.addParam("id", "Request identifier", undefined, types.string)
.addOptionalParam(
"block",
"Block number. (default: latest)",
undefined,
types.int
)
.setAction(lidoWithdrawStatus);
task("lidoWithdrawStatus").setAction(async (_, __, runSuper) => {
return runSuper();
Expand Down

0 comments on commit 0148a94

Please sign in to comment.