-
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
Add pegout with weis rounded down to satoshis test #158
Add pegout with weis rounded down to satoshis test #158
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
11c5790
to
913b560
Compare
b5984e2
to
4f507e4
Compare
lib/constants.js
Outdated
const FEE_PER_KB_CHANGE_PK = '6a4b49312b91e203ddfb9bc2d900ebbd46fbede46a7462e770bedcb11ad405e9'; | ||
const FEE_PER_KB_CHANGE_ADDR = '53f8f6dabd612b6137215ddd7758bb5cdd638922'; | ||
|
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.
Wasn't this previously added?
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/tests/2wp.js
Outdated
const senderRecipientInfo = await createSenderRecipientInfo(rskTxHelper, btcTxHelper); | ||
const peginValueInSatoshis = btcToSatoshis(0.5); | ||
const btcPeginTxHash = await sendPegin(rskTxHelper, btcTxHelper, senderRecipientInfo.btcSenderAddressInfo, satoshisToBtc(peginValueInSatoshis)); | ||
await ensurePeginIsRegistered(rskTxHelper, btcPeginTxHash); |
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.
Isn't there a new util function for this?
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/tests/2wp.js
Outdated
const pegoutValueInWeisBN = new BN('41234567891234560'); // 0.04123456789123456 in RBTC | ||
const expectedPegoutValueInSatoshis = 4123456; // 0.04123456 in BTC |
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.
Can't we use the unit converter library to somehow make this clearer?
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 turns out, we cant. The unit converter rounds differently than the Bridge. The unit converter would yield 4123457
, and the Bridge 4123456
. So, I had to hardcode it.
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 update the unit converter library then?
Quality Gate passedIssues Measures |
1308096
into
add-pegout-request-from-contract-test
Add pegout with weis rounded down to satoshis test