Skip to content

Commit

Permalink
bdb fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Jan 2, 2025
1 parent 31a0552 commit 39c0021
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions test/functional/rpc_rawtransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ def raw_multisig_transaction_legacy_tests(self):

mSigObj = self.nodes[2].addmultisigaddress(2, [addr1Obj['pubkey'], addr2Obj['pubkey'], addr3Obj['pubkey']])['address']

txId = self.nodes[0].sendtoaddress(mSigObj, 2.2)
txId = self.nodes[0].sendtoaddress(mSigObj, Decimal("2.2"))
decTx = self.nodes[0].gettransaction(txId)
rawTx = self.nodes[0].decoderawtransaction(decTx['hex'])
self.sync_all()
Expand All @@ -551,7 +551,7 @@ def raw_multisig_transaction_legacy_tests(self):

bal = self.nodes[0].getbalance()
inputs = [{"txid": txId, "vout": vout['n'], "scriptPubKey": vout['scriptPubKey']['hex'], "amount": vout['value']}]
outputs = {self.nodes[0].getnewaddress(): 2.19}
outputs = {self.nodes[0].getnewaddress(): Decimal("2.19")}
rawTx = self.nodes[2].createrawtransaction(inputs, outputs)
rawTxPartialSigned = self.nodes[1].signrawtransactionwithwallet(rawTx, inputs)
assert_equal(rawTxPartialSigned['complete'], False) # node1 only has one key, can't comp. sign the tx
Expand All @@ -576,7 +576,7 @@ def raw_multisig_transaction_legacy_tests(self):
mSigObj = self.nodes[2].addmultisigaddress(2, [addr1Obj['pubkey'], addr2Obj['pubkey']])['address']
mSigObjValid = self.nodes[2].getaddressinfo(mSigObj)

txId = self.nodes[0].sendtoaddress(mSigObj, 2.2)
txId = self.nodes[0].sendtoaddress(mSigObj, Decimal("2.2"))
decTx = self.nodes[0].gettransaction(txId)
rawTx2 = self.nodes[0].decoderawtransaction(decTx['hex'])
self.sync_all()
Expand All @@ -590,7 +590,7 @@ def raw_multisig_transaction_legacy_tests(self):

bal = self.nodes[0].getbalance()
inputs = [{"txid": txId, "vout": vout['n'], "scriptPubKey": vout['scriptPubKey']['hex'], "redeemScript": mSigObjValid['hex'], "amount": vout['value']}]
outputs = {self.nodes[0].getnewaddress(): 2.19}
outputs = {self.nodes[0].getnewaddress(): Decimal("2.19")}
rawTx2 = self.nodes[2].createrawtransaction(inputs, outputs)
rawTxPartialSigned1 = self.nodes[1].signrawtransactionwithwallet(rawTx2, inputs)
self.log.debug(rawTxPartialSigned1)
Expand Down
4 changes: 2 additions & 2 deletions test/functional/wallet_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def test_balances(*, fee_node_1=0):
self.log.info('Check if mempool is taken into account after import*')
address = self.nodes[0].getnewaddress()
privkey = self.nodes[0].dumpprivkey(address)
self.nodes[0].sendtoaddress(address, 0.1)
self.nodes[0].sendtoaddress(address, Decimal("0.1"))
self.nodes[0].unloadwallet('')
# check importaddress on fresh wallet
self.nodes[0].createwallet('w1', False, True)
Expand Down Expand Up @@ -333,7 +333,7 @@ def test_balances(*, fee_node_1=0):
assert_equal(walletinfo['lastprocessedblock']['hash'], prev_hash)

self.log.info("Test gettransaction returns expected lastprocessedblock json object")
txid = self.nodes[1].sendtoaddress(self.nodes[1].getnewaddress(), 0.01)
txid = self.nodes[1].sendtoaddress(self.nodes[1].getnewaddress(), Decimal("0.01"))
tx_info = self.nodes[1].gettransaction(txid)
assert_equal(tx_info['lastprocessedblock']['height'], prev_height)
assert_equal(tx_info['lastprocessedblock']['hash'], prev_hash)
Expand Down
2 changes: 1 addition & 1 deletion test/functional/wallet_listtransactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def run_test(self):
pubkey = self.nodes[1].getaddressinfo(self.nodes[1].getnewaddress())['pubkey']
multisig = self.nodes[1].createmultisig(1, [pubkey])
self.nodes[0].importaddress(multisig["redeemScript"], "watchonly", False, True)
txid = self.nodes[1].sendtoaddress(multisig["address"], 0.1)
txid = self.nodes[1].sendtoaddress(multisig["address"], Decimal("0.1"))
self.generate(self.nodes[1], 1)
assert_equal(len(self.nodes[0].listtransactions(label="watchonly", include_watchonly=True)), 1)
assert_equal(len(self.nodes[0].listtransactions(dummy="watchonly", include_watchonly=True)), 1)
Expand Down
6 changes: 4 additions & 2 deletions test/functional/wallet_watchonly.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"""Test createwallet watchonly arguments.
"""

from decimal import Decimal

from test_framework.blocktools import COINBASE_MATURITY
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
Expand Down Expand Up @@ -55,8 +57,8 @@ def run_test(self):

self.log.info('Test sending from a watch-only wallet raises RPC error')
msg = "Error: Private keys are disabled for this wallet"
assert_raises_rpc_error(-4, msg, wo_wallet.sendtoaddress, a1, 0.1)
assert_raises_rpc_error(-4, msg, wo_wallet.sendmany, amounts={a1: 0.1})
assert_raises_rpc_error(-4, msg, wo_wallet.sendtoaddress, a1, Decimal("0.1"))
assert_raises_rpc_error(-4, msg, wo_wallet.sendmany, amounts={a1: Decimal("0.1")})

self.log.info('Testing listreceivedbyaddress watch-only defaults')
result = wo_wallet.listreceivedbyaddress()
Expand Down

0 comments on commit 39c0021

Please sign in to comment.