mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-02 19:52:01 +02:00
test: Use int.to_bytes over struct packing
This is done in prepration for the scripted diff, which can not deal with those lines.
This commit is contained in:
@ -4,7 +4,6 @@
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test the wallet balance RPC methods."""
|
||||
from decimal import Decimal
|
||||
import struct
|
||||
|
||||
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE as ADDRESS_WATCHONLY
|
||||
from test_framework.blocktools import COINBASE_MATURITY
|
||||
@ -266,8 +265,8 @@ class WalletTest(BitcoinTestFramework):
|
||||
tx_orig = self.nodes[0].gettransaction(txid)['hex']
|
||||
# Increase fee by 1 coin
|
||||
tx_replace = tx_orig.replace(
|
||||
struct.pack("<q", 99 * 10**8).hex(),
|
||||
struct.pack("<q", 98 * 10**8).hex(),
|
||||
(99 * 10**8).to_bytes(8, "little", signed=True).hex(),
|
||||
(98 * 10**8).to_bytes(8, "little", signed=True).hex(),
|
||||
)
|
||||
tx_replace = self.nodes[0].signrawtransactionwithwallet(tx_replace)['hex']
|
||||
# Total balance is given by the sum of outputs of the tx
|
||||
|
Reference in New Issue
Block a user