-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fee and dust #215
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
Fee and dust #215
Conversation
test/network.js
Outdated
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 you use the transactions from fixtures/transaction.json instead? I'd prefer to remove mainnet_tx.json if we can.
Or better yet, make test fixtures just for network.
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.
Fixed in 5dcefc5. I removed its dependency on fixtures entirely and used stubs instead. After all, why should fee estimation care about how transaction is serialized? It assumes tx.toBuffer does its job correctly and produces the correct size.
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.
Agreed. I think the stubs are a solid approach in this case. Might be a good idea to eventually move the test cases themselves to a more data driven approach though, if possible.
src/networks.js
Outdated
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.
See #216. If that gets merged, please change dustsofthreshold to dustSoftThreshold
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.
Done with a rebase, which also cleaned up the commit history
This PR 1) fixes the constants used for Bitcoin transaction fees & dust and 2) adds fee estimation for dogecoin and litecoin as an example of how it can be done for alternative networks.