Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.

Commit 653f399

Browse files
authored
release-rewards: fix retry awaiting tx confirmation (#6)
1 parent e3e421a commit 653f399

File tree

3 files changed

+58
-6
lines changed

3 files changed

+58
-6
lines changed

commands/release-rewards.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { createContract } from '../index.js'
22
import { relative, join } from 'node:path'
33
import { fileURLToPath } from 'node:url'
4+
import pRetry from 'p-retry'
45

56
export const releaseRewards = async opts => {
67
const { contractWithSigner } = await createContract(opts)
78
console.error('Please sign on your ledger...')
89
const tx = await contractWithSigner.releaseRewards()
910
console.log(tx.hash)
1011
console.log('Awaiting confirmation...')
11-
await tx.wait()
12+
await pRetry(() => tx.wait())
1213
console.log('Rewards released')
1314

1415
const bin = relative(

package-lock.json

Lines changed: 55 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@ethers-ext/signer-ledger": "^6.0.0-beta.1",
1717
"@ledgerhq/hw-transport-node-hid": "^6.27.21",
1818
"ethers": "^6.8.1",
19+
"p-retry": "^6.2.1",
1920
"yargs": "^17.7.2"
2021
},
2122
"scripts": {

0 commit comments

Comments
 (0)