-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat(walletManager): add shouldRecordUsage option and tests #88
Conversation
} | ||
} | ||
} | ||
let selectedWallet = this.findAssignedWallet(ovalInstance); |
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.
Small refactoring to simplify getSharedWallet by pulling out this logic.
36b98db
to
877b870
Compare
Signed-off-by: Pablo Maldonado <[email protected]>
877b870
to
75e2276
Compare
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.
LGTM!
@@ -99,7 +101,7 @@ export const getUnlockBundlesFromOvalAddresses = async ( | |||
targetBlock, | |||
ovalAddress, | |||
req, | |||
false, | |||
false, // Do not simulate |
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.
What does this comment mean? If we're not simulating, wouldn't this be true...?
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.
Simulate has a default value of true, but here we are not simulating. I added the comment because now we have a second optional boolean argument, shouldRecordWalletUsage
, so it’s easier to read.
) => { | ||
const unlocks = await Promise.all( | ||
getOvalAddresses().map(async (ovalAddress) => | ||
prepareUnlockTransaction(flashbotsBundleProvider, backrunTxs, targetBlock, ovalAddress, req), | ||
// Do not record wallet usage here as we will record it in the loop below once we find a valid unlock. |
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.
+1
Changes proposed in this PR:
shouldRecordUsage
optional boolean argument togetWallet
andgetSharedWallet
methods.shouldRecordUsage
option.