-
Notifications
You must be signed in to change notification settings - Fork 2
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
Increase locking cap to 21 million as part of the setup start #77
Increase locking cap to 21 million as part of the setup start #77
Conversation
2f673cf
to
2e5b55a
Compare
b580681
to
d2bb417
Compare
2e5b55a
to
c2556a8
Compare
const increaseLockingCapCallResult = bridge.methods.increaseLockingCap(nextIncrement).send({ from: authAddress }); | ||
await wait(1000); | ||
await rskUtils.mineAndSync(rskTxHelpers); | ||
await increaseLockingCapCallResult; |
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.
Not sure I follow this here, why create the call, then wait, then mine and finally execute the call. Shouldn't this be enough?
const increaseLockingCapCallResult = bridge.methods.increaseLockingCap(nextIncrement).send({ from: authAddress }); | |
await wait(1000); | |
await rskUtils.mineAndSync(rskTxHelpers); | |
await increaseLockingCapCallResult; | |
await bridge.methods.increaseLockingCap(nextIncrement).send({ from: authAddress }); | |
await rskUtils.mineAndSync(rskTxHelpers); |
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.
The test nodes don't mine automatically. If I do the await bridge.methods.increaseLockingCap...
, it will get stuck for ever because it will try to get the transaction receipt but since it has not been mined, it will never return.
I will use the sendTxWithCheck
function instead.
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.
Updated.
lib/rsk-utils.js
Outdated
const txReceiptPromise = method.send({ from, value: 0, gasPrice: 0, gas: estimatedGas }); | ||
const { value, gasPrice, gas } = options; | ||
|
||
const estimatedGas = gas ? gas : await method.estimateGas({ from }); |
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.
Check Sonar report here
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.
Updated.
lib/rsk-utils.js
Outdated
const sendTxWithCheck = async (rskTxHelper, method, from, checkCallback) => { | ||
|
||
const callResult = await method.call({ from }); | ||
const sendTxWithCheck = async (rskTxHelper, method, from, checkCallback, options = { value: 0, gasPrice: 0, gas: 0 }) => { |
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.
Maybe receive options param first and checkCallback last? Mainly to avoid having to pass null
when calling from sendTransaction
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.
Updated.
Quality Gate passedIssues Measures |
ffb51c2
into
rits-refactors-9-2024-integration
Increase locking cap to 21 million as part of the setup start