diff options
author | MarcoFalke <falke.marco@gmail.com> | 2022-02-07 17:08:21 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2022-02-07 17:08:26 +0100 |
commit | eca694a4e78d54ce4e29b388b3e81b06e55c2293 (patch) | |
tree | e3168d060a878ad0d13d2837d7ad14916004fbfb /depends | |
parent | 9392e1350cd8091677d728c72dd2ea842604227b (diff) | |
parent | d1fab9d5d27a2db2546db0f610e0f6929ec4864e (diff) | |
download | bitcoin-eca694a4e78d54ce4e29b388b3e81b06e55c2293.tar.xz |
Merge bitcoin/bitcoin#24239: test: fix ceildiv division by using integers
d1fab9d5d27a2db2546db0f610e0f6929ec4864e test: Call ceildiv helper with integer (Martin Zumsande)
Pull request description:
On master,
`assert_fee_amount(Decimal("0.00000993"), 217, Decimal("0.00004531"))` passes
`assert_fee_amount(Decimal("0.00000993"), Decimal("217"), Decimal("0.00004531"))` fails.
the reason is that the // operator in `ceildiv(a,b) = -(-a//b)` has a different behavior for Decimals, see [doc](https://docs.python.org/3/library/decimal.html#decimal-objects).
`wallet_send.py` calls this function with Decimals, and I think this is the reason for the failure reported in the OP of #24151 (`wallet_send.py --legacy-wallet` line 332, the numbers used in the example above are from there). However, the other failures reported there cannot be explained by this, so this is just a partial fix.
ACKs for top commit:
ryanofsky:
Code review ACK d1fab9d5d27a2db2546db0f610e0f6929ec4864e. Tracking down this problem was a good find, and code seems safer and easier to understand now
Tree-SHA512: 5bf0568cd1a0824f6b1a15a03580b6e9391b4f51112a97c1d00469d255bf6dda45c49a36fa567a5ba9b9973efe1d9cdd480db91965c9f4c2aa963629a8a32cba
Diffstat (limited to 'depends')
0 files changed, 0 insertions, 0 deletions