-
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
Adds 'should create multiple pegouts with mixed values same and above… #163
base: rits-refactors-9-2024-integration
Are you sure you want to change the base?
Adds 'should create multiple pegouts with mixed values same and above… #163
Conversation
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, minor comments
const txPromise = rskTxHelper.sendTransaction({ | ||
from: rskFromAddress, | ||
to: BRIDGE_ADDRESS, | ||
value: amountInWeisBN, | ||
gasPrice: TO_BRIDGE_GAS_PRICE, | ||
}); | ||
|
||
if(!mine) { |
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.
nit:
if(!mine) { | |
if (!mine) { |
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 just noticed there is a mixed of if (
an if(
in the test. I always prefer if(
. But what should we always use? @nathanieliov , @marcos-iov , @julia-zack .
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.
|
||
await triggerRelease(rskTxHelpers, btcTxHelper, callbacks); | ||
|
||
// Checking all the pegout events are emitted and in order |
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.
It seems they all get mined in the same block. How are we verifying the order?
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.
They all get mined in the same block, otherwise, the test would fail.
Since they can get mined in different order, I'm forced to use pegoutsEvents.find
index of indices and getAddressUtxo
to find the corresponding utxos.
const txPromise = rskTxHelper.sendTransaction({ | ||
from: rskFromAddress, | ||
to: BRIDGE_ADDRESS, | ||
value: amountInWeisBN, | ||
gasPrice: TO_BRIDGE_GAS_PRICE, | ||
}); | ||
|
||
if(!mine) { |
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.
2ac0319
to
5c567a3
Compare
9c1d2e2
to
253411e
Compare
… minimum' test Rebase
5c567a3
to
bc9cb09
Compare
Quality Gate passedIssues Measures |
const pegoutCreatedCallback = async () => { | ||
bridgeStateAfterPegoutCreation = await getBridgeState(rskTxHelper.getClient()); | ||
}; |
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 might be missing something, what's the value of this callback? It will simply get the Bridge state and do nothing with it
const pegoutTransaction2 = await pegoutTransaction2Promise; | ||
const pegoutTransaction3 = await pegoutTransaction3Promise; | ||
|
||
// Assert |
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.
Should we check the Bridge state at this point? To assert there are 3 pegout requests created
Adds 'should create multiple pegouts with mixed values same and above minimum' test