-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: waitForUserOperationTx parameters were incorrect #634
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,6 @@ export const waitForUserOperationTransaction: < | |
client: Client<TTransport, TChain, any>, | ||
args: WaitForUserOperationTxParameters | ||
) => Promise<Hex> = async (client, args) => { | ||
const { hash } = args; | ||
|
||
if (!isBaseSmartAccountClient(client)) { | ||
throw new IncompatibleClientError( | ||
"BaseSmartAccountClient", | ||
|
@@ -23,9 +21,18 @@ export const waitForUserOperationTransaction: < | |
); | ||
} | ||
|
||
for (let i = 0; i < client.txMaxRetries; i++) { | ||
const { | ||
hash, | ||
retries = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If these aren't provided is this going to use what the client passes in? I don't see that in the diff There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea that's what this line does, the destructue with the equals is setting the default value if it's not passed in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh neat okay |
||
maxRetries: client.txMaxRetries, | ||
intervalMs: client.txRetryIntervalMs, | ||
multiplier: client.txRetryMultiplier, | ||
}, | ||
} = args; | ||
|
||
for (let i = 0; i < retries.maxRetries; i++) { | ||
const txRetryIntervalWithJitterMs = | ||
client.txRetryIntervalMs * Math.pow(client.txRetryMultiplier, i) + | ||
retries.intervalMs * Math.pow(retries.multiplier, i) + | ||
Math.random() * 100; | ||
|
||
await new Promise((resolve) => | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to reuse these from the client opts schema?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did, but then didn't want to perpetuate zod cuz it's annoying in some places