-
Notifications
You must be signed in to change notification settings - Fork 329
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
test(electrum): test for checking that fee calculation is correct #1685
base: master
Are you sure you want to change the base?
Conversation
Thank you for taking this on! It looks good to me so far. Edit: Also just a reminder to address the clippy warning. |
5ed5266
to
99888fa
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.
To ensure the CI tests pass, please rebase your PR and ensure the clippy warning has been fixed. Once that's done, everything should be good to go!
6b67cab
to
836b097
Compare
ACK 836b097 |
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 looks like another rebase is needed to ensure everything is up to date. Thank you for your continued efforts!
836b097
to
fb7ca7e
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.
ACK ecd3c3a
e6aae33
to
ecd3c3a
Compare
Sorry @LagginTimes I did not sign the commit 😞 |
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.
cACK ecd3c3a
let txid = env.send(&addr_to_track, SEND_AMOUNT)?; | ||
|
||
// Mine a block to confirm sent tx. | ||
let hash_block = env.mine_blocks(1, None)?.into_iter().next(); |
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: I would use block_hash
, and prev_block_hash
instead, but it's not a big deal. :)
.graph() | ||
.calculate_fee(&tx.tx) | ||
.expect("fee must exist"); | ||
|
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.
❓ You could probably assert the expected fee here too, to ensure it's the same 1650 as expected. WDYT?
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.
Also, maybe use it as constant like SEND_AMOUNT, e.g FEE_AMOUNT.
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.
good point @oleonardolima I am going to add the additional assert.
ecd3c3a
to
06e5248
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.
tACK 06e5248
Description
This PR adds a unit test for checking that the fee calculation of
bdk_electrum
is correct.Notes to the reviewers
fixes: #1444
Changelog notice
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committing