Skip to content
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

Merged
merged 5 commits into from
Sep 10, 2024

Conversation

jeremy-then
Copy link
Contributor

Increase locking cap to 21 million as part of the setup start

@jeremy-then jeremy-then self-assigned this Sep 9, 2024
@jeremy-then jeremy-then requested a review from a team as a code owner September 9, 2024 18:04
Base automatically changed from disable-whitelisting to rits-refactors-9-2024-integration September 9, 2024 19:26
Comment on lines 42 to 45
const increaseLockingCapCallResult = bridge.methods.increaseLockingCap(nextIncrement).send({ from: authAddress });
await wait(1000);
await rskUtils.mineAndSync(rskTxHelpers);
await increaseLockingCapCallResult;
Copy link
Collaborator

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?

Suggested change
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);

Copy link
Contributor Author

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.

Copy link
Contributor Author

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 });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check Sonar report here

Copy link
Contributor Author

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 }) => {
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Copy link

@marcos-iov marcos-iov merged commit ffb51c2 into rits-refactors-9-2024-integration Sep 10, 2024
3 checks passed
@marcos-iov marcos-iov deleted the increase-locking-cap branch September 10, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants