diff --git a/test/functional/README.md b/test/functional/README.md index 8fdc3cbd1b..cf424d0043 100644 --- a/test/functional/README.md +++ b/test/functional/README.md @@ -68,7 +68,7 @@ don't have test cases for. load a premined blockchain from cache with the default value of `False`. The cached data directories contain a 200-block pre-mined blockchain with the spendable mining rewards being split between four nodes. Each node has 25 - mature block subsidies (25x50=1250 BTC) in its wallet. Using them is much more + mature block subsidies (25x50=1250 DGB) in its wallet. Using them is much more efficient than mining blocks in your test. - When calling RPCs with lots of arguments, consider using named keyword arguments instead of positional arguments to make the intent of the call diff --git a/test/functional/feature_bip68_sequence.py b/test/functional/feature_bip68_sequence.py index 3fa9072800..1358099c76 100755 --- a/test/functional/feature_bip68_sequence.py +++ b/test/functional/feature_bip68_sequence.py @@ -87,7 +87,7 @@ def run_test(self): def test_disable_flag(self): # Create some unconfirmed inputs new_addr = self.nodes[0].getnewaddress() - self.nodes[0].sendtoaddress(new_addr, 2) # send 2 BTC + self.nodes[0].sendtoaddress(new_addr, 2) # send 2 DGB utxos = self.nodes[0].listunspent(0, 0) assert len(utxos) > 0 diff --git a/test/functional/feature_block.py b/test/functional/feature_block.py index d5ecf5a2b6..3a54fdb94e 100755 --- a/test/functional/feature_block.py +++ b/test/functional/feature_block.py @@ -495,7 +495,7 @@ def run_test(self): redeem_script = CScript([self.coinbase_pubkey] + [OP_2DUP, OP_CHECKSIGVERIFY] * 5 + [OP_CHECKSIG]) p2sh_script = script_to_p2sh_script(redeem_script) - # Create a transaction that spends one satoshi to the p2sh_script, the rest to OP_TRUE + # Create a transaction that spends one digibit to the p2sh_script, the rest to OP_TRUE # This must be signed because it is spending a coinbase spend = out[11] tx = self.create_tx(spend, 0, 1, p2sh_script) @@ -505,7 +505,7 @@ def run_test(self): b39 = self.update_block(39, [tx]) b39_outputs += 1 - # Until block is full, add tx's with 1 satoshi to p2sh_script, the rest to OP_TRUE + # Until block is full, add tx's with 1 digibit to p2sh_script, the rest to OP_TRUE tx_new = None tx_last = tx total_weight = b39.get_weight() @@ -1010,11 +1010,11 @@ def run_test(self): # -> b64 (18) -> b65 (19) -> b69 (20) # \-> b68 (20) # - # b68 - coinbase with an extra 10 satoshis, - # creates a tx that has 9 satoshis from out[20] go to fees - # this fails because the coinbase is trying to claim 1 satoshi too much in fees + # b68 - coinbase with an extra 10 digibits, + # creates a tx that has 9 digibits from out[20] go to fees + # this fails because the coinbase is trying to claim 1 digibit too much in fees # - # b69 - coinbase with extra 10 satoshis, and a tx that gives a 10 satoshi fee + # b69 - coinbase with extra 10 digibits, and a tx that gives a 10 digibit fee # this succeeds # self.log.info("Reject a block trying to claim too much subsidy in the coinbase transaction") @@ -1381,9 +1381,9 @@ def next_block(self, number, spend=None, additional_coinbase_value=0, script=CSc if spend is None: block = create_block(base_block_hash, coinbase, block_time, version=version) else: - coinbase.vout[0].nValue += spend.vout[0].nValue - 1 # all but one satoshi to fees + coinbase.vout[0].nValue += spend.vout[0].nValue - 1 # all but one digibit to fees coinbase.rehash() - tx = self.create_tx(spend, 0, 1, script) # spend 1 satoshi + tx = self.create_tx(spend, 0, 1, script) # spend 1 digibit self.sign_tx(tx, spend) tx.rehash() block = create_block(base_block_hash, coinbase, block_time, version=version, txlist=[tx]) diff --git a/test/functional/feature_coinstatsindex.py b/test/functional/feature_coinstatsindex.py index 926a4e3da2..5ab2d316a2 100755 --- a/test/functional/feature_coinstatsindex.py +++ b/test/functional/feature_coinstatsindex.py @@ -160,7 +160,7 @@ def _test_coin_stats_index(self): signed_tx1 = self.nodes[0].signrawtransactionwithwallet(funded_tx1['hex']) tx1_txid = self.nodes[0].sendrawtransaction(signed_tx1['hex']) - # Find the right position of the 21 BTC output + # Find the right position of the 21 DGB output tx1_final = self.nodes[0].gettransaction(tx1_txid) for output in tx1_final['details']: if output['amount'] == Decimal('21.00000000') and output['category'] == 'receive': diff --git a/test/functional/feature_fee_estimation.py b/test/functional/feature_fee_estimation.py index 1153994fb9..d51c1a0b87 100755 --- a/test/functional/feature_fee_estimation.py +++ b/test/functional/feature_fee_estimation.py @@ -30,7 +30,7 @@ assert_greater_than, assert_greater_than_or_equal, assert_raises_rpc_error, - satoshi_round, + digibit_round, ) # Construct 2 trivial P2SH's and the ScriptSigs that spend them @@ -60,7 +60,7 @@ def small_txpuzzle_randfee(from_node, conflist, unconflist, amount, min_fee, fee # Exponentially distributed from 1-128 * fee_increment rand_fee = float(fee_increment) * (1.1892 ** random.randint(0, 28)) # Total fee ranges from min_fee to min_fee + 127*fee_increment - fee = min_fee - fee_increment + satoshi_round(rand_fee) + fee = min_fee - fee_increment + digibit_round(rand_fee) tx = CTransaction() total_in = Decimal("0.00000000") while total_in <= (amount + fee) and len(conflist) > 0: @@ -99,7 +99,7 @@ def split_inputs(from_node, txins, txouts, initial_split=False): tx = CTransaction() tx.vin.append(CTxIn(COutPoint(int(prevtxout["txid"], 16), prevtxout["vout"]), b"")) - half_change = satoshi_round(prevtxout["amount"] / 2) + half_change = digibit_round(prevtxout["amount"] / 2) rem_change = prevtxout["amount"] - half_change - Decimal("0.00100000") tx.vout.append(CTxOut(int(half_change * COIN), P2SH_1)) tx.vout.append(CTxOut(int(rem_change * COIN), P2SH_2)) diff --git a/test/functional/feature_rbf.py b/test/functional/feature_rbf.py index d01413d20c..9c3ee6d280 100755 --- a/test/functional/feature_rbf.py +++ b/test/functional/feature_rbf.py @@ -18,7 +18,7 @@ ) from test_framework.script import CScript, OP_DROP from test_framework.test_framework import DigiByteTestFramework -from test_framework.util import assert_equal, assert_raises_rpc_error, satoshi_round +from test_framework.util import assert_equal, assert_raises_rpc_error, digibit_round from test_framework.script_util import DUMMY_P2WPKH_SCRIPT, DUMMY_2_P2WPKH_SCRIPT from test_framework.wallet import MiniWallet @@ -52,11 +52,11 @@ def make_utxo(self, node, amount, confirmed=True, scriptPubKey=DUMMY_P2WPKH_SCRI unconfirmed otherwise. """ fee = 1 * COIN - while node.getbalance() < satoshi_round((amount + fee) / COIN): + while node.getbalance() < digibit_round((amount + fee) / COIN): self.generate(node, COINBASE_MATURITY) new_addr = node.getnewaddress() - txid = node.sendtoaddress(new_addr, satoshi_round((amount + fee) / COIN)) + txid = node.sendtoaddress(new_addr, digibit_round((amount + fee) / COIN)) tx1 = node.getrawtransaction(txid, 1) txid = int(txid, 16) i, _ = next(filter(lambda vout: new_addr == vout[1]['scriptPubKey']['address'], enumerate(tx1['vout']))) @@ -154,7 +154,7 @@ def test_simple_doublespend(self): # This will raise an exception due to insufficient fee assert_raises_rpc_error(-26, "insufficient fee", self.nodes[0].sendrawtransaction, tx1b_hex, 0) - # Extra 0.1 BTC fee + # Extra 0.1 DGB fee tx1b = CTransaction() tx1b.vin = [CTxIn(tx0_outpoint, nSequence=0)] tx1b.vout = [CTxOut(int(0.9 * COIN), DUMMY_P2WPKH_SCRIPT)] @@ -189,7 +189,7 @@ def test_doublespend_chain(self): prevout = COutPoint(int(txid, 16), 0) # Whether the double-spend is allowed is evaluated by including all - # child fees - 40 BTC - so this attempt is rejected. + # child fees - 40 DGB - so this attempt is rejected. dbl_tx = CTransaction() dbl_tx.vin = [CTxIn(tx0_outpoint, nSequence=0)] dbl_tx.vout = [CTxOut(initial_nValue - 30 * COIN, DUMMY_P2WPKH_SCRIPT)] @@ -259,7 +259,7 @@ def branch(prevout, initial_value, max_txs, tree_width=5, fee=0.001 * COIN, _tot # This will raise an exception due to insufficient fee assert_raises_rpc_error(-26, "insufficient fee", self.nodes[0].sendrawtransaction, dbl_tx_hex, 0) - # 1 BTC fee is enough + # 1 DGB fee is enough dbl_tx = CTransaction() dbl_tx.vin = [CTxIn(tx0_outpoint, nSequence=0)] dbl_tx.vout = [CTxOut(initial_nValue - fee * n - 1 * COIN, DUMMY_P2WPKH_SCRIPT)] @@ -638,7 +638,7 @@ def test_replacement_relay_fee(self): tx = wallet.send_self_transfer(from_node=self.nodes[0])['tx'] # Higher fee, higher feerate, different txid, but the replacement does not provide a relay - # fee conforming to node's `incrementalrelayfee` policy of 1000 sat per KB. + # fee conforming to node's `incrementalrelayfee` policy of 1000 dbit per KB. tx.vout[0].nValue -= 1 assert_raises_rpc_error(-26, "insufficient fee", self.nodes[0].sendrawtransaction, tx.serialize().hex()) diff --git a/test/functional/mempool_limit.py b/test/functional/mempool_limit.py index 2a3f9d8584..8f93e865b7 100755 --- a/test/functional/mempool_limit.py +++ b/test/functional/mempool_limit.py @@ -64,7 +64,7 @@ def run_test(self): tx_to_be_evicted_id = miniwallet.send_self_transfer(from_node=node, fee_rate=relayfee)["txid"] # Increase the tx fee rate to give the subsequent transactions a higher priority in the mempool - # The tx has an approx. vsize of 65k, i.e. multiplying the previous fee rate (in sats/kvB) + # The tx has an approx. vsize of 65k, i.e. multiplying the previous fee rate (in dbit/kvB) # by 130 should result in a fee that corresponds to 2x of that fee rate base_fee = relayfee * 130 diff --git a/test/functional/mempool_packages.py b/test/functional/mempool_packages.py index 041bac65bd..1653947069 100755 --- a/test/functional/mempool_packages.py +++ b/test/functional/mempool_packages.py @@ -15,7 +15,7 @@ assert_equal, assert_raises_rpc_error, chain_transaction, - satoshi_round, + digibit_round, ) # default limits @@ -197,10 +197,10 @@ def run_test(self): for x in reversed(chain): descendant_fees += mempool[x]['fee'] if (x == chain[-1]): - assert_equal(mempool[x]['modifiedfee'], mempool[x]['fee']+satoshi_round(0.00002)) - assert_equal(mempool[x]['fees']['modified'], mempool[x]['fee']+satoshi_round(0.00002)) + assert_equal(mempool[x]['modifiedfee'], mempool[x]['fee']+digibit_round(0.00002)) + assert_equal(mempool[x]['fees']['modified'], mempool[x]['fee']+digibit_round(0.00002)) assert_equal(mempool[x]['descendantfees'], descendant_fees * COIN + 2000) - assert_equal(mempool[x]['fees']['descendant'], descendant_fees+satoshi_round(0.00002)) + assert_equal(mempool[x]['fees']['descendant'], descendant_fees+digibit_round(0.00002)) # Check that node1's mempool is as expected (-> custom ancestor limit) mempool0 = self.nodes[0].getrawmempool(False) @@ -296,7 +296,7 @@ def run_test(self): value = utxo[0]['amount'] vout = utxo[0]['vout'] - send_value = satoshi_round((value - fee)/2) + send_value = digibit_round((value - fee)/2) inputs = [ {'txid' : txid, 'vout' : vout} ] outputs = {} for _ in range(2): diff --git a/test/functional/p2p_dandelion.py b/test/functional/p2p_dandelion.py index a5a2b86700..5cf4d10e69 100755 --- a/test/functional/p2p_dandelion.py +++ b/test/functional/p2p_dandelion.py @@ -9,7 +9,7 @@ 1. Resistance to active probing: Stem: 0 --> 1 --> 2 --> 0 where each node has argument "-dandelion=1" Probe: TestNode --> 0 - Node 0 generates a Dandelion transaction "tx": 1.0 BTC from Node 0 to Node 2 + Node 0 generates a Dandelion transaction "tx": 1.0 DGB from Node 0 to Node 2 TestNode immediately sends getdata for tx to Node 0 Assert that Node 0 does not reply with tx diff --git a/test/functional/p2p_feefilter.py b/test/functional/p2p_feefilter.py index bc79a63098..ec029673fa 100755 --- a/test/functional/p2p_feefilter.py +++ b/test/functional/p2p_feefilter.py @@ -86,21 +86,21 @@ def test_feefilter(self): conn = self.nodes[0].add_p2p_connection(TestP2PConn()) - self.log.info("Test txs paying 20 sat/byte are received by test connection") + self.log.info("Test txs paying 20 dbit/byte are received by test connection") TX_KEY = 'wtxid' if P2P_VERSION >= WTXID_RELAY_VERSION else 'txid' txids = [miniwallet.send_self_transfer(fee_rate=Decimal('0.000200'), from_node=node1)[TX_KEY] for _ in range(3)] conn.wait_for_invs_to_match(txids) conn.clear_invs() - # Set a fee filter of 0.15 sat/byte on test connection + # Set a fee filter of 0.15 dbit/byte on test connection conn.send_and_ping(msg_feefilter(150)) - self.log.info("Test txs paying 0.15 sat/byte are received by test connection") + self.log.info("Test txs paying 0.15 dbit/byte are received by test connection") txids = [miniwallet.send_self_transfer(fee_rate=Decimal('0.00000150'), from_node=node1)[TX_KEY] for _ in range(3)] conn.wait_for_invs_to_match(txids) conn.clear_invs() - self.log.info("Test txs paying 0.1 sat/byte are no longer received by test connection") + self.log.info("Test txs paying 0.1 dbit/byte are no longer received by test connection") txids = [miniwallet.send_self_transfer(fee_rate=Decimal('0.00000100'), from_node=node1)[TX_KEY] for _ in range(3)] self.sync_mempools() # must be sure node 0 has received all txs diff --git a/test/functional/rpc_fundrawtransaction.py b/test/functional/rpc_fundrawtransaction.py index 1002154746..3e783cdaee 100755 --- a/test/functional/rpc_fundrawtransaction.py +++ b/test/functional/rpc_fundrawtransaction.py @@ -717,7 +717,7 @@ def test_all_watched_funds(self): wwatch.unloadwallet() def test_option_feerate(self): - self.log.info("Test fundrawtxn with explicit fee rates (fee_rate sat/vB and feeRate DGB/kvB)") + self.log.info("Test fundrawtxn with explicit fee rates (fee_rate dbit/vB and feeRate DGB/kvB)") node = self.nodes[3] # Make sure there is exactly one input so coin selection can't skew the result. assert_equal(len(self.nodes[3].listunspent(1)), 1) @@ -726,10 +726,10 @@ def test_option_feerate(self): rawtx = node.createrawtransaction(inputs, outputs) result = node.fundrawtransaction(rawtx) # uses self.min_relay_tx_fee (set by settxfee) - btc_kvb_to_sat_vb = 100000 # (1e5) - result1 = node.fundrawtransaction(rawtx, {"fee_rate": str(2 * btc_kvb_to_sat_vb * self.min_relay_tx_fee)}) + dgb_kvb_to_dbit_vb = 100000 # (1e5) + result1 = node.fundrawtransaction(rawtx, {"fee_rate": str(2 * dgb_kvb_to_dbit_vb * self.min_relay_tx_fee)}) result2 = node.fundrawtransaction(rawtx, {"feeRate": 2 * self.min_relay_tx_fee}) - result3 = node.fundrawtransaction(rawtx, {"fee_rate": 10 * btc_kvb_to_sat_vb * self.min_relay_tx_fee}) + result3 = node.fundrawtransaction(rawtx, {"fee_rate": 10 * dgb_kvb_to_dbit_vb * self.min_relay_tx_fee}) result4 = node.fundrawtransaction(rawtx, {"feeRate": str(10 * self.min_relay_tx_fee)}) result_fee_rate = result['fee'] * 10 / count_bytes(result['hex']) @@ -742,7 +742,7 @@ def test_option_feerate(self): for param, zero_value in product(["fee_rate", "feeRate"], [0, 0.000, 0.00000000, "0", "0.000", "0.00000000"]): assert_equal(self.nodes[3].fundrawtransaction(rawtx, {param: zero_value})["fee"], 0) - # With no arguments passed, expect fee of 14100 satoshis. + # With no arguments passed, expect fee of 14100 digibits. # Expect fee to be 100x higher when an explicit fee rate 100x greater is specified. result = node.fundrawtransaction(rawtx, {"fee_rate": 10000}) assert_approx(result["fee"], vexp=0.0141, vspan=0.0001) @@ -780,17 +780,17 @@ def test_option_feerate(self): # Test fee rate values that don't pass fixed-point parsing checks. for invalid_value in ["", 0.000000001, 1e-09, 1.111111111, 1111111111111111, "31.999999999999999999999"]: assert_raises_rpc_error(-3, "Invalid amount", node.fundrawtransaction, rawtx, {param: invalid_value, "add_inputs": True}) - # Test fee_rate values that cannot be represented in sat/vB. + # Test fee_rate values that cannot be represented in dbit/vB. for invalid_value in [0.0001, 0.00000001, 0.00099999, 31.99999999, "0.0001", "0.00000001", "0.00099999", "31.99999999"]: assert_raises_rpc_error(-3, "Invalid amount", node.fundrawtransaction, rawtx, {"fee_rate": invalid_value, "add_inputs": True}) - self.log.info("Test min fee rate checks are bypassed with fundrawtxn, e.g. a fee_rate under 1 sat/vB is allowed") + self.log.info("Test min fee rate checks are bypassed with fundrawtxn, e.g. a fee_rate under 1 dbit/vB is allowed") node.fundrawtransaction(rawtx, {"fee_rate": 0.999, "add_inputs": True}) node.fundrawtransaction(rawtx, {"feeRate": 0.00000999, "add_inputs": True}) self.log.info("- raises RPC error if both feeRate and fee_rate are passed") - assert_raises_rpc_error(-8, "Cannot specify both fee_rate (sat/vB) and feeRate (DGB/kvB)", + assert_raises_rpc_error(-8, "Cannot specify both fee_rate (dbit/vB) and feeRate (DGB/kvB)", node.fundrawtransaction, rawtx, {"fee_rate": 0.1, "feeRate": 0.1, "add_inputs": True}) self.log.info("- raises RPC error if both feeRate and estimate_mode passed") @@ -852,13 +852,13 @@ def test_option_subtract_fee_from_outputs(self): assert_equal(output[3], output[4] + result[4]['fee']) assert_equal(change[3] + result[3]['fee'], change[4]) - # Test subtract fee from outputs with fee_rate (sat/vB) - btc_kvb_to_sat_vb = 100000 # (1e5) + # Test subtract fee from outputs with fee_rate (dbit/vB) + dgb_kvb_to_dbit_vb = 100000 # (1e5) result = [self.nodes[3].fundrawtransaction(rawtx), # uses self.min_relay_tx_fee (set by settxfee) self.nodes[3].fundrawtransaction(rawtx, {"subtractFeeFromOutputs": []}), # empty subtraction list self.nodes[3].fundrawtransaction(rawtx, {"subtractFeeFromOutputs": [0]}), # uses self.min_relay_tx_fee (set by settxfee) - self.nodes[3].fundrawtransaction(rawtx, {"fee_rate": 2 * btc_kvb_to_sat_vb * self.min_relay_tx_fee}), - self.nodes[3].fundrawtransaction(rawtx, {"fee_rate": 2 * btc_kvb_to_sat_vb * self.min_relay_tx_fee, "subtractFeeFromOutputs": [0]}),] + self.nodes[3].fundrawtransaction(rawtx, {"fee_rate": 2 * dgb_kvb_to_dbit_vb * self.min_relay_tx_fee}), + self.nodes[3].fundrawtransaction(rawtx, {"fee_rate": 2 * dgb_kvb_to_dbit_vb * self.min_relay_tx_fee, "subtractFeeFromOutputs": [0]}),] dec_tx = [self.nodes[3].decoderawtransaction(tx_['hex']) for tx_ in result] output = [d['vout'][1 - r['changepos']]['value'] for d, r in zip(dec_tx, result)] change = [d['vout'][r['changepos']]['value'] for d, r in zip(dec_tx, result)] @@ -902,7 +902,7 @@ def test_option_subtract_fee_from_outputs(self): assert_equal(share[2], share[3]) # Output 0 takes at least as much share of the fee, and no more than 2 - # satoshis more, than outputs 2 and 3. + # digibits more, than outputs 2 and 3. assert_greater_than_or_equal(share[0], share[2]) assert_greater_than_or_equal(share[2] + Decimal(2e-8), share[0]) @@ -1049,13 +1049,13 @@ def test_feerate_rounding(self): self.sync_all() # A P2WPKH input costs 68 vbytes; With a single P2WPKH output, the rest of the tx is 42 vbytes for a total of 110 vbytes. - # At a feerate of 1.85 sat/vb, the input will need a fee of 125.8 sats and the rest 77.7 sats - # The entire tx fee should be 203.5 sats. + # At a feerate of 1.85 dbit/vb, the input will need a fee of 125.8 dbits and the rest 77.7 dbits + # The entire tx fee should be 203.5 dbits. # Coin selection rounds the fee individually instead of at the end (due to how CFeeRate::GetFee works). # If rounding down (which is the incorrect behavior), then the calculated fee will be 125 + 77 = 202. # If rounding up, then the calculated fee will be 126 + 78 = 204. # In the former case, the calculated needed fee is higher than the actual fee being paid, so an assertion is reached - # To test this does not happen, we subtract 202 sats from the input value. If working correctly, this should + # To test this does not happen, we subtract 202 dbits from the input value. If working correctly, this should # fail with insufficient funds rather than digibyted asserting. rawtx = w.createrawtransaction(inputs=[], outputs=[{self.nodes[0].getnewaddress(address_type="bech32"): 1 - 0.00000202}]) assert_raises_rpc_error(-4, "Insufficient funds", w.fundrawtransaction, rawtx, {"fee_rate": 1.85}) diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py index 5f6c4d7f60..d20d91e828 100755 --- a/test/functional/rpc_psbt.py +++ b/test/functional/rpc_psbt.py @@ -189,13 +189,13 @@ def run_test(self): assert_equal(walletprocesspsbt_out['complete'], True) self.nodes[1].sendrawtransaction(self.nodes[1].finalizepsbt(walletprocesspsbt_out['psbt'])['hex']) - self.log.info("Test walletcreatefundedpsbt fee rate of 10000 sat/vB and 0.1 DGB/kvB produces a total fee at or slightly below -maxtxfee (~0.05290000)") + self.log.info("Test walletcreatefundedpsbt fee rate of 10000 dbit/vB and 0.1 DGB/kvB produces a total fee at or slightly below -maxtxfee (~0.05290000)") res1 = self.nodes[1].walletcreatefundedpsbt(inputs, outputs, 0, {"fee_rate": 100000, "add_inputs": True}) assert_approx(res1["fee"], 0.0055, 0.5) res2 = self.nodes[1].walletcreatefundedpsbt(inputs, outputs, 0, {"feeRate": "0.1", "add_inputs": True}) assert_approx(res2["fee"], 0.0055, 0.5) - self.log.info("Test min fee rate checks with walletcreatefundedpsbt are bypassed, e.g. a fee_rate under 1 sat/vB is allowed") + self.log.info("Test min fee rate checks with walletcreatefundedpsbt are bypassed, e.g. a fee_rate under 1 dbit/vB is allowed") res3 = self.nodes[1].walletcreatefundedpsbt(inputs, outputs, 0, {"fee_rate": "0.999", "add_inputs": True}) assert_approx(res3["fee"], 0.00000381, 0.0000001) res4 = self.nodes[1].walletcreatefundedpsbt(inputs, outputs, 0, {"feeRate": 0.00000999, "add_inputs": True}) @@ -217,13 +217,13 @@ def run_test(self): for invalid_value in ["", 0.000000001, 1e-09, 1.111111111, 1111111111111111, "31.999999999999999999999"]: assert_raises_rpc_error(-3, "Invalid amount", self.nodes[1].walletcreatefundedpsbt, inputs, outputs, 0, {param: invalid_value, "add_inputs": True}) - # Test fee_rate values that cannot be represented in sat/vB. + # Test fee_rate values that cannot be represented in dbit/vB. for invalid_value in [0.0001, 0.00000001, 0.00099999, 31.99999999, "0.0001", "0.00000001", "0.00099999", "31.99999999"]: assert_raises_rpc_error(-3, "Invalid amount", self.nodes[1].walletcreatefundedpsbt, inputs, outputs, 0, {"fee_rate": invalid_value, "add_inputs": True}) self.log.info("- raises RPC error if both feeRate and fee_rate are passed") - assert_raises_rpc_error(-8, "Cannot specify both fee_rate (sat/vB) and feeRate (DGB/kvB)", + assert_raises_rpc_error(-8, "Cannot specify both fee_rate (dbit/vB) and feeRate (DGB/kvB)", self.nodes[1].walletcreatefundedpsbt, inputs, outputs, 0, {"fee_rate": 0.1, "feeRate": 0.1, "add_inputs": True}) self.log.info("- raises RPC error if both feeRate and estimate_mode passed") diff --git a/test/functional/rpc_rawtransaction.py b/test/functional/rpc_rawtransaction.py index 22a3346775..72b3c43ba3 100755 --- a/test/functional/rpc_rawtransaction.py +++ b/test/functional/rpc_rawtransaction.py @@ -320,12 +320,12 @@ def sendrawtransaction_testmempoolaccept_tests(self): self.sync_all() inputs = [{"txid": txId, "vout": vout['n']}] - # Fee 100,000 satoshis, (1 - (100000 sat * 0.00000001 BTC/sat)) = 0.999 + # Fee 100,000 digibits, (1 - (100000 dbit * 0.00000001 DGB/dbit)) = 0.999 outputs = {self.nodes[0].getnewaddress(): Decimal("0.9990000")} rawTx = self.nodes[2].createrawtransaction(inputs, outputs) rawTxSigned = self.nodes[2].signrawtransactionwithwallet(rawTx) assert_equal(rawTxSigned['complete'], True) - # Fee 10,000 satoshis, ~100 b transaction, fee rate should land around 100 sat/byte = 0.00100000 BTC/kB + # Fee 10,000 digibits, ~100 b transaction, fee rate should land around 100 dbit/byte = 0.00100000 DGB/kB # Thus, testmempoolaccept should reject testres = self.nodes[2].testmempoolaccept([rawTxSigned['hex']], 0.0010000)[0] self.log.info(f"testmempoolaccept result: {testres}") @@ -346,12 +346,12 @@ def sendrawtransaction_testmempoolaccept_tests(self): self.sync_all() inputs = [{"txid": txId, "vout": vout['n']}] - # Fee 2,000,000 satoshis, (1 - (2000000 sat * 0.00000001 BTC/sat)) = 0.98 + # Fee 2,000,000 digibits, (1 - (2000000 digibit * 0.00000001 DGB/dbit)) = 0.98 outputs = {self.nodes[0].getnewaddress() : Decimal("0.98000000")} rawTx = self.nodes[2].createrawtransaction(inputs, outputs) rawTxSigned = self.nodes[2].signrawtransactionwithwallet(rawTx) assert_equal(rawTxSigned['complete'], True) - # Fee 2,000,000 satoshis, ~100 b transaction, fee rate should land around 20,000 sat/byte = 0.20000000 BTC/kB + # Fee 2,000,000 digibits, ~100 b transaction, fee rate should land around 20,000 dbit/byte = 0.20000000 DGB/kB # Thus, testmempoolaccept should reject testres = self.nodes[2].testmempoolaccept([rawTxSigned['hex']])[0] self.log.info(f"testmempoolaccept result (high fee): {testres}") @@ -436,7 +436,7 @@ def raw_multisig_transaction_legacy_tests(self): # use balance deltas instead of absolute values bal = self.nodes[2].getbalance() - # send 1.2 BTC to msig adr + # send 1.2 DGB to msig adr txId = self.nodes[0].sendtoaddress(mSigObj, 1.2) self.sync_all() self.generate(self.nodes[0], 1) diff --git a/test/functional/rpc_scantxoutset.py b/test/functional/rpc_scantxoutset.py index a13f99114b..f924aecd53 100755 --- a/test/functional/rpc_scantxoutset.py +++ b/test/functional/rpc_scantxoutset.py @@ -85,7 +85,7 @@ def run_test(self): self.log.info("Test extended key derivation.") # Run various scans, and verify that the sum of the amounts of the matches corresponds to the expected subset. - # Note that all amounts in the UTXO set are powers of 2 multiplied by 0.001 BTC, so each amounts uniquely identifies a subset. + # Note that all amounts in the UTXO set are powers of 2 multiplied by 0.001 DGB, so each amounts uniquely identifies a subset. assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0h/0h)"])['total_amount'], Decimal("0.008")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/1h)"])['total_amount'], Decimal("0.016")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0h/0'/1500')"])['total_amount'], Decimal("0.032")) diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py index 019660f51f..049d8d82ce 100755 --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -51,7 +51,7 @@ MAX_BLOOM_FILTER_SIZE = 36000 MAX_BLOOM_HASH_FUNCS = 50 -COIN = 100000000 # 1 btc in satoshis +COIN = 100000000 # 1 dgb in digibits MAX_MONEY = 21000000000 * COIN BIP125_SEQUENCE_NUMBER = 0xfffffffd # Sequence number that is rbf-opt-in (BIP 125) and csv-opt-out (BIP 68) diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 7b311fb7e5..2946d135b5 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -35,15 +35,15 @@ def assert_approx(v, vexp, vspan=0.001): raise AssertionError("%s > [%s..%s]" % (str(v), str(vexp - vspan), str(vexp + vspan))) -def assert_fee_amount(fee, tx_size, feerate_BTC_kvB): +def assert_fee_amount(fee, tx_size, feerate_DGB_kvB): """Assert the fee is in range.""" - target_fee = get_fee(tx_size, feerate_BTC_kvB) + target_fee = get_fee(tx_size, feerate_DGB_kvB) if fee < target_fee: - raise AssertionError("Fee of %s BTC too low! (Should be %s BTC)" % (str(fee), str(target_fee))) + raise AssertionError("Fee of %s DGB too low! (Should be %s DGB)" % (str(fee), str(target_fee))) # allow the wallet's estimation to be at most 2 bytes off - high_fee = get_fee(tx_size + 2, feerate_BTC_kvB) + high_fee = get_fee(tx_size + 2, feerate_DGB_kvB) if fee > high_fee: - raise AssertionError("Fee of %s BTC too high! (Should be %s BTC)" % (str(fee), str(target_fee))) + raise AssertionError("Fee of %s DGB too high! (Should be %s DGB)" % (str(fee), str(target_fee))) def assert_equal(thing1, thing2, *args): @@ -198,10 +198,10 @@ def assert_array_result(object_array, to_match, expected, should_not_find=False) def check_json_precision(): - """Make sure json library being used does not lose precision converting BTC values""" + """Make sure json library being used does not lose precision converting DGB values""" n = Decimal("20000000.00000003") - satoshis = int(json.loads(json.dumps(float(n))) * 1.0e8) - if satoshis != 2000000000000003: + digibits = int(json.loads(json.dumps(float(n))) * 1.0e8) + if digibits != 2000000000000003: raise RuntimeError("JSON encode/decode loses precision") @@ -224,14 +224,14 @@ def ceildiv(a, b): return -(-a // b) -def get_fee(tx_size, feerate_btc_kvb): - """Calculate the fee in BTC given a feerate is BTC/kvB. Reflects CFeeRate::GetFee""" - feerate_sat_kvb = int(feerate_btc_kvb * Decimal(1e8)) # Fee in sat/kvb as an int to avoid float precision errors - target_fee_sat = ceildiv(feerate_sat_kvb * tx_size, 1000) # Round calculated fee up to nearest sat - return satoshi_round(target_fee_sat / Decimal(1e8)) # Truncate BTC result to nearest sat +def get_fee(tx_size, feerate_dgb_kvb): + """Calculate the fee in DGB given a feerate is DGB/kvB. Reflects CFeeRate::GetFee""" + feerate_dbit_kvb = int(feerate_dgb_kvb * Decimal(1e8)) # Fee in dbit/kvb as an int to avoid float precision errors + target_fee_dbit = ceildiv(feerate_dbit_kvb * tx_size, 1000) # Round calculated fee up to nearest digibit + return digibit_round(target_fee_dbit / Decimal(1e8)) # Truncate DGB result to nearest digibit -def satoshi_round(amount): +def digibit_round(amount): return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN) @@ -489,8 +489,8 @@ def create_confirmed_utxos(test_framework, fee, node, count, **kwargs): inputs.append({"txid": t["txid"], "vout": t["vout"]}) outputs = {} send_value = t['amount'] - fee - outputs[addr1] = satoshi_round(send_value / 2) - outputs[addr2] = satoshi_round(send_value / 2) + outputs[addr1] = digibit_round(send_value / 2) + outputs[addr2] = digibit_round(send_value / 2) raw_tx = node.createrawtransaction(inputs, outputs) signed_tx = node.signrawtransactionwithwallet(raw_tx)["hex"] node.sendrawtransaction(signed_tx) @@ -510,7 +510,7 @@ def chain_transaction(node, parent_txids, vouts, value, fee, num_outputs, max_fe Returns a tuple with the txid and the amount sent per output. """ - send_value = satoshi_round((value - fee)/num_outputs) + send_value = digibit_round((value - fee)/num_outputs) inputs = [] for (txid, vout) in zip(parent_txids, vouts): inputs.append({'txid' : txid, 'vout' : vout}) @@ -556,7 +556,7 @@ def create_lots_of_big_transactions(node, txouts, utxos, num, fee): inputs = [{"txid": t["txid"], "vout": t["vout"]}] outputs = {} change = t['amount'] - fee - outputs[addr] = satoshi_round(change) + outputs[addr] = digibit_round(change) rawtx = node.createrawtransaction(inputs, outputs) tx = tx_from_hex(rawtx) for txout in txouts: diff --git a/test/functional/test_framework/wallet.py b/test/functional/test_framework/wallet.py index 57de0b0367..00945e1327 100644 --- a/test/functional/test_framework/wallet.py +++ b/test/functional/test_framework/wallet.py @@ -28,7 +28,7 @@ from test_framework.util import ( assert_equal, hex_str_to_bytes, - satoshi_round, + digibit_round, ) class MiniWalletMode(Enum): @@ -145,7 +145,7 @@ def create_self_transfer(self, *, fee_rate=Decimal("0.003"), from_node, utxo_to_ vsize = Decimal(96) # anyone-can-spend else: vsize = Decimal(168) # P2PK (73 bytes scriptSig + 35 bytes scriptPubKey + 60 bytes other) - send_value = satoshi_round(utxo_to_spend['value'] - fee_rate * (vsize / 1000)) + send_value = digibit_round(utxo_to_spend['value'] - fee_rate * (vsize / 1000)) fee = utxo_to_spend['value'] - send_value assert send_value > 0 diff --git a/test/functional/wallet_abandonconflict.py b/test/functional/wallet_abandonconflict.py index bfe2916836..a1f0d13b59 100755 --- a/test/functional/wallet_abandonconflict.py +++ b/test/functional/wallet_abandonconflict.py @@ -49,13 +49,13 @@ def run_test(self): # Disconnect nodes so node0's transactions don't get into node1's mempool self.disconnect_nodes(0, 1) - # Identify the 10btc outputs + # Identify the 10dgb outputs nA = next(tx_out["vout"] for tx_out in self.nodes[0].gettransaction(txA)["details"] if tx_out["amount"] == Decimal("10")) nB = next(tx_out["vout"] for tx_out in self.nodes[0].gettransaction(txB)["details"] if tx_out["amount"] == Decimal("10")) nC = next(tx_out["vout"] for tx_out in self.nodes[0].gettransaction(txC)["details"] if tx_out["amount"] == Decimal("10")) inputs = [] - # spend 10btc outputs from txA and txB + # spend 10dgb outputs from txA and txB inputs.append({"txid": txA, "vout": nA}) inputs.append({"txid": txB, "vout": nB}) outputs = {} @@ -65,7 +65,7 @@ def run_test(self): signed = self.nodes[0].signrawtransactionwithwallet(self.nodes[0].createrawtransaction(inputs, outputs)) txAB1 = self.nodes[0].sendrawtransaction(signed["hex"]) - # Identify the 14.99998btc output + # Identify the 14.99998dgb output nAB = next(tx_out["vout"] for tx_out in self.nodes[0].gettransaction(txAB1)["details"] if tx_out["amount"] == Decimal("14.998")) #Create a child tx spending AB1 and C @@ -200,13 +200,13 @@ def run_test(self): assert_equal(double_spend["walletconflicts"], [tx["txid"]]) assert_equal(tx["walletconflicts"], [double_spend["txid"]]) - # Verify that B and C's 10 BTC outputs are available for spending again because AB1 is now conflicted + # Verify that B and C's 10 DGB outputs are available for spending again because AB1 is now conflicted newbalance = self.nodes[0].getbalance() assert_equal(newbalance, balance + Decimal("20")) balance = newbalance # There is currently a minor bug around this and so this test doesn't work. See Issue #7315 - # Invalidate the block with the double spend and B's 10 BTC output should no longer be available + # Invalidate the block with the double spend and B's 10 DGB output should no longer be available # Don't think C's should either self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash()) newbalance = self.nodes[0].getbalance() diff --git a/test/functional/wallet_avoidreuse.py b/test/functional/wallet_avoidreuse.py index 72e7de67b2..09fd252828 100755 --- a/test/functional/wallet_avoidreuse.py +++ b/test/functional/wallet_avoidreuse.py @@ -163,8 +163,8 @@ def test_change_remains_change(self, node): def test_sending_from_reused_address_without_avoid_reuse(self): ''' - Test the same as test_sending_from_reused_address_fails, except send the 10 BTC with - the avoid_reuse flag set to false. This means the 10 BTC send should succeed, + Test the same as test_sending_from_reused_address_fails, except send the 10 DGB with + the avoid_reuse flag set to false. This means the 10 DGB send should succeed, where it fails in test_sending_from_reused_address_fails. ''' self.log.info("Test sending from reused address with avoid_reuse=false") @@ -175,9 +175,9 @@ def test_sending_from_reused_address_without_avoid_reuse(self): self.nodes[0].sendtoaddress(fundaddr, 10) self.generate(self.nodes[0], 1) - # listunspent should show 1 single, unused 10 btc output + # listunspent should show 1 single, unused 10 dgb output assert_unspent(self.nodes[1], total_count=1, total_sum=10, reused_supported=True, reused_count=0) - # getbalances should show no used, 10 btc trusted + # getbalances should show no used, 10 dgb trusted assert_balances(self.nodes[1], mine={"used": 0, "trusted": 10}) # node 0 should not show a used entry, as it does not enable avoid_reuse assert("used" not in self.nodes[0].getbalances()["mine"]) @@ -185,38 +185,38 @@ def test_sending_from_reused_address_without_avoid_reuse(self): self.nodes[1].sendtoaddress(retaddr, 5) self.generate(self.nodes[0], 1) - # listunspent should show 1 single, unused ~4.9 btc output + # listunspent should show 1 single, unused ~4.9 dgb output assert_unspent(self.nodes[1], total_count=1, total_sum=4.9, reused_supported=True, reused_count=0, margin=0.1) - # getbalances should show no used, ~4.9 btc trusted + # getbalances should show no used, ~4.9 dgb trusted assert_balances(self.nodes[1], mine={"used": 0, "trusted": 4.9}, margin=0.1) self.nodes[0].sendtoaddress(fundaddr, 10) self.generate(self.nodes[0], 1) - # listunspent should show 2 total outputs (~4.9, 10 btc), one unused (~4.9), one reused (10) + # listunspent should show 2 total outputs (~4.9, 10 dgb), one unused (~4.9), one reused (10) assert_unspent(self.nodes[1], total_count=2, total_sum=14.9, reused_count=1, reused_sum=10, margin=0.1) - # getbalances should show 10 used, ~4.9 btc trusted + # getbalances should show 10 used, ~4.9 dgb trusted assert_balances(self.nodes[1], mine={"used": 10, "trusted": 4.9}, margin=0.1) self.nodes[1].sendtoaddress(address=retaddr, amount=10, avoid_reuse=False) - # listunspent should show 1 total outputs (~4.9 btc), unused + # listunspent should show 1 total outputs (~4.9 dgb), unused assert_unspent(self.nodes[1], total_count=1, total_sum=4.9, reused_count=0, margin=0.1) - # getbalances should show no used, ~4.9 btc trusted + # getbalances should show no used, ~4.9 dgb trusted assert_balances(self.nodes[1], mine={"used": 0, "trusted": 4.9}, margin=0.1) - # node 1 should now have about 4.9 btc left (for both cases) + # node 1 should now have about 4.9 dgb left (for both cases) assert_approx(self.nodes[1].getbalance(), 4.9, 0.1) assert_approx(self.nodes[1].getbalance(avoid_reuse=False), 4.9, 0.1) def test_sending_from_reused_address_fails(self, second_addr_type): ''' Test the simple case where [1] generates a new address A, then - [0] sends 10 BTC to A. - [1] spends 5 BTC from A. (leaving roughly 5 BTC useable) - [0] sends 10 BTC to A again. - [1] tries to spend 10 BTC (fails; dirty). - [1] tries to spend 4 BTC (succeeds; change address sufficient) + [0] sends 10 DGB to A. + [1] spends 5 DGB from A. (leaving roughly 5 DGB useable) + [0] sends 10 DGB to A again. + [1] tries to spend 10 DGB (fails; dirty). + [1] tries to spend 4 DGB (succeeds; change address sufficient) ''' self.log.info("Test sending from reused {} address fails".format(second_addr_type)) @@ -226,17 +226,17 @@ def test_sending_from_reused_address_fails(self, second_addr_type): self.nodes[0].sendtoaddress(fundaddr, 10) self.generate(self.nodes[0], 1) - # listunspent should show 1 single, unused 10 btc output + # listunspent should show 1 single, unused 10 dgb output assert_unspent(self.nodes[1], total_count=1, total_sum=10, reused_supported=True, reused_count=0) - # getbalances should show no used, 10 btc trusted + # getbalances should show no used, 10 dgb trusted assert_balances(self.nodes[1], mine={"used": 0, "trusted": 10}) self.nodes[1].sendtoaddress(retaddr, 5) self.generate(self.nodes[0], 1) - # listunspent should show 1 single, unused ~4.9 btc output + # listunspent should show 1 single, unused ~4.9 dgb output assert_unspent(self.nodes[1], total_count=1, total_sum=4.9, reused_supported=True, reused_count=0, margin=0.1) - # getbalances should show no used, ~4.9 btc trusted + # getbalances should show no used, ~4.9 dgb trusted assert_balances(self.nodes[1], mine={"used": 0, "trusted": 4.9}, margin=0.1) if not self.options.descriptors: @@ -255,9 +255,9 @@ def test_sending_from_reused_address_fails(self, second_addr_type): self.nodes[0].sendtoaddress(new_fundaddr, 10) self.generate(self.nodes[0], 1) - # listunspent should show 2 total outputs (~4.9, 10 btc), one unused (~4.9), one reused (10) + # listunspent should show 2 total outputs (~4.9, 10 dgb), one unused (~4.9), one reused (10) assert_unspent(self.nodes[1], total_count=2, total_sum=14.9, reused_count=1, reused_sum=10, margin=0.1) - # getbalances should show 10 used, ~4.9 btc trusted + # getbalances should show 10 used, ~4.9 dgb trusted assert_balances(self.nodes[1], mine={"used": 10, "trusted": 4.9}, margin=0.1) # node 1 should now have a balance of ~4.9 (no dirty) or ~14.9 (including dirty) @@ -268,12 +268,12 @@ def test_sending_from_reused_address_fails(self, second_addr_type): self.nodes[1].sendtoaddress(retaddr, 4) - # listunspent should show 2 total outputs (~0.9, 10 btc), one unused (~0.9), one reused (10) + # listunspent should show 2 total outputs (~0.9, 10 dgb), one unused (~0.9), one reused (10) assert_unspent(self.nodes[1], total_count=2, total_sum=10.9, reused_count=1, reused_sum=10, margin=0.1) - # getbalances should show 10 used, ~0.9 btc trusted + # getbalances should show 10 used, ~0.9 dgb trusted assert_balances(self.nodes[1], mine={"used": 10, "trusted": 0.9}, margin=0.1) - # node 1 should now have about 0.9 btc left (no dirty) and 10.9 (including dirty) + # node 1 should now have about 0.9 dgb left (no dirty) and 10.9 (including dirty) assert_approx(self.nodes[1].getbalance(), 0.9, 0.1) assert_approx(self.nodes[1].getbalance(avoid_reuse=False), 10.9, 0.1) @@ -308,10 +308,10 @@ def test_getbalances_used(self): def test_full_destination_group_is_preferred(self): ''' - Test the case where [1] only has 101 outputs of 1 BTC in the same reused - address and tries to send a small payment of 0.5 BTC. The wallet + Test the case where [1] only has 101 outputs of 1 DGB in the same reused + address and tries to send a small payment of 0.5 DGB. The wallet should use 100 outputs from the reused address as inputs and not a - single 1 BTC input, in order to join several outputs from the reused + single 1 DGB input, in order to join several outputs from the reused address. ''' self.log.info("Test that full destination groups are preferred in coin selection") @@ -322,7 +322,7 @@ def test_full_destination_group_is_preferred(self): new_addr = self.nodes[1].getnewaddress() ret_addr = self.nodes[0].getnewaddress() - # Send 101 outputs of 1 BTC to the same, reused address in the wallet + # Send 101 outputs of 1 DGB to the same, reused address in the wallet for _ in range(101): self.nodes[0].sendtoaddress(new_addr, 1) @@ -338,8 +338,8 @@ def test_full_destination_group_is_preferred(self): def test_all_destination_groups_are_used(self): ''' - Test the case where [1] only has 202 outputs of 1 BTC in the same reused - address and tries to send a payment of 200.5 BTC. The wallet + Test the case where [1] only has 202 outputs of 1 DGB in the same reused + address and tries to send a payment of 200.5 DGB. The wallet should use all 202 outputs from the reused address as inputs. ''' self.log.info("Test that all destination groups are used") @@ -350,7 +350,7 @@ def test_all_destination_groups_are_used(self): new_addr = self.nodes[1].getnewaddress() ret_addr = self.nodes[0].getnewaddress() - # Send 202 outputs of 1 BTC to the same, reused address in the wallet + # Send 202 outputs of 1 DGB to the same, reused address in the wallet for _ in range(202): self.nodes[0].sendtoaddress(new_addr, 1) diff --git a/test/functional/wallet_balance.py b/test/functional/wallet_balance.py index 566d730ce2..156dcc0055 100755 --- a/test/functional/wallet_balance.py +++ b/test/functional/wallet_balance.py @@ -99,7 +99,7 @@ def run_test(self): assert_equal(self.nodes[0].getbalance("*", 1, True), 72000) assert_equal(self.nodes[1].getbalance(minconf=0, include_watchonly=True), 72000) - # Send 40 BTC from 0 to 1 and 60 BTC from 1 to 0. + # Send 40 DGB from 0 to 1 and 60 DGB from 1 to 0. txs = create_transactions(self.nodes[0], self.nodes[1].getnewaddress(), 40, [Decimal('0.01')]) self.nodes[0].sendrawtransaction(txs[0]['hex']) self.nodes[1].sendrawtransaction(txs[0]['hex']) # sending on both nodes is faster than waiting for propagation @@ -149,7 +149,7 @@ def run_test(self): # 2) Sent 10 from node B to node A with fee 0.01 # # Then our node would report a confirmed balance of 40 + 50 - 10 = 80 - # BTC, which is more than would be available if transaction 1 were + # DGB, which is more than would be available if transaction 1 were # replaced. def test_balances(*, fee_node_1=0): diff --git a/test/functional/wallet_basic.py b/test/functional/wallet_basic.py index 44caf46c0f..168cb908bf 100755 --- a/test/functional/wallet_basic.py +++ b/test/functional/wallet_basic.py @@ -55,7 +55,7 @@ def get_vsize(self, txn): # Get newly matured utxo with min_amount - # DigiByte specific: COINBASE_MATURITY is set to 8 instead of 100 (in BTC). + # DigiByte specific: COINBASE_MATURITY is set to 8 instead of 100 (in DGB). # During this test suite, more and more coinbase utxos are maturing. # This helper function collects them. def get_matured_utxos(self, node_index, utxo_seen_map = None, allow_none_coinbase = False, min_amount = Decimal('72000')): @@ -188,7 +188,7 @@ def run_test(self): # Have node1 generate 101 blocks (so node0 can recover the fee) self.generate(self.nodes[1], COINBASE_MATURITY_2 + 1, sync_fun=lambda: self.sync_all(self.nodes[0:3])) - # node0 should end up with 100 btc in block rewards plus fees, but + # node0 should end up with 100 dgb in block rewards plus fees, but # minus the 21 plus fees sent to node2 assert_equal(self.nodes[0].getbalance(), 2 * 72000 - 21) assert_equal(self.nodes[2].getbalance(), 21) @@ -261,28 +261,28 @@ def run_test(self): assert_equal(self.nodes[2].getbalance(), node_2_bal) node_0_bal = self.check_fee_amount(self.nodes[0].getbalance(), node_0_bal + Decimal('10'), fee_per_byte, self.get_vsize(self.nodes[2].gettransaction(txid)['hex'])) - self.log.info("Test sendmany with fee_rate param (explicit fee rate in sat/vB)") - fee_rate_sat_vb = 10000 - fee_rate_btc_kvb = fee_rate_sat_vb * 1e3 / 1e8 - explicit_fee_rate_btc_kvb = Decimal(fee_rate_btc_kvb) / 1000 + self.log.info("Test sendmany with fee_rate param (explicit fee rate in dbit/vB)") + fee_rate_dbit_vb = 10000 + fee_rate_dgb_kvb = fee_rate_dbit_vb * 1e3 / 1e8 + explicit_fee_rate_dgb_kvb = Decimal(fee_rate_dgb_kvb) / 1000 # Test passing fee_rate as a string - txid = self.nodes[2].sendmany(amounts={address: 10}, fee_rate=str(fee_rate_sat_vb)) + txid = self.nodes[2].sendmany(amounts={address: 10}, fee_rate=str(fee_rate_dbit_vb)) self.generate(self.nodes[2], 1, sync_fun=lambda: self.sync_all(self.nodes[0:3])) balance = self.nodes[2].getbalance() - node_2_bal = self.check_fee_amount(balance, node_2_bal - Decimal('10'), explicit_fee_rate_btc_kvb, self.get_vsize(self.nodes[2].gettransaction(txid)['hex'])) + node_2_bal = self.check_fee_amount(balance, node_2_bal - Decimal('10'), explicit_fee_rate_dgb_kvb, self.get_vsize(self.nodes[2].gettransaction(txid)['hex'])) assert_equal(balance, node_2_bal) node_0_bal += Decimal('10') assert_equal(self.nodes[0].getbalance(), node_0_bal) # Test passing fee_rate as an integer amount = Decimal("0.1") - txid = self.nodes[2].sendmany(amounts={address: amount}, fee_rate=fee_rate_sat_vb) + txid = self.nodes[2].sendmany(amounts={address: amount}, fee_rate=fee_rate_dbit_vb) self.generate(self.nodes[2], 1, sync_fun=lambda: self.sync_all(self.nodes[0:3])) balance = self.nodes[2].getbalance() - node_2_bal = self.check_fee_amount(balance, node_2_bal - amount, explicit_fee_rate_btc_kvb, self.get_vsize(self.nodes[2].gettransaction(txid)['hex'])) + node_2_bal = self.check_fee_amount(balance, node_2_bal - amount, explicit_fee_rate_dgb_kvb, self.get_vsize(self.nodes[2].gettransaction(txid)['hex'])) assert_equal(balance, node_2_bal) node_0_bal += amount assert_equal(self.nodes[0].getbalance(), node_0_bal) @@ -291,12 +291,12 @@ def run_test(self): assert_raises_rpc_error(-8, "Unknown named parameter key", self.nodes[2].sendtoaddress, address=address, amount=1, fee_rate=1, key=1) # Test setting explicit fee rate just below the minimum. - self.log.info("Test sendmany raises 'fee rate too low' if fee_rate of 100 sat/vB is passed") - assert_raises_rpc_error(-6, "Fee rate (100.000 sat/vB) is lower than the minimum fee rate setting (10000.000 sat/vB)", + self.log.info("Test sendmany raises 'fee rate too low' if fee_rate of 100 dbit/vB is passed") + assert_raises_rpc_error(-6, "Fee rate (100.000 dbit/vB) is lower than the minimum fee rate setting (10000.000 dbit/vB)", self.nodes[2].sendmany, amounts={address: 10}, fee_rate=100) self.log.info("Test sendmany raises if fee_rate of 0 or -1 is passed") - assert_raises_rpc_error(-6, "Fee rate (0.000 sat/vB) is lower than the minimum fee rate setting (10000.000 sat/vB)", + assert_raises_rpc_error(-6, "Fee rate (0.000 dbit/vB) is lower than the minimum fee rate setting (10000.000 dbit/vB)", self.nodes[2].sendmany, amounts={address: 10}, fee_rate=0) assert_raises_rpc_error(-3, OUT_OF_RANGE, self.nodes[2].sendmany, amounts={address: 10}, fee_rate=-1) @@ -305,7 +305,7 @@ def run_test(self): for target, mode in product([-1, 0, 1009], ["economical", "conservative"]): assert_raises_rpc_error(-8, "Invalid conf_target, must be between 1 and 1008", # max value of 1008 per src/policy/fees.h self.nodes[2].sendmany, amounts={address: 1}, conf_target=target, estimate_mode=mode) - for target, mode in product([-1, 0], ["btc/kb", "sat/b"]): + for target, mode in product([-1, 0], ["dgb/kb", "dbit/b"]): assert_raises_rpc_error(-8, 'Invalid estimate_mode parameter, must be one of: "unset", "economical", "conservative"', self.nodes[2].sendmany, amounts={address: 1}, conf_target=target, estimate_mode=mode) @@ -454,16 +454,16 @@ def run_test(self): self.generate(self.nodes[0], 1, sync_fun=lambda: self.sync_all(self.nodes[0:3])) - self.log.info("Test sendtoaddress with fee_rate param (explicit fee rate in sat/vB)") + self.log.info("Test sendtoaddress with fee_rate param (explicit fee rate in dbit/vB)") self.get_matured_utxos(2, utxo_seen[2]) # clear prebalance = self.nodes[2].getbalance() assert prebalance > 2 address = self.nodes[1].getnewaddress() amount = 3 - fee_rate_sat_vb = 10000 - fee_rate_btc_kvb = fee_rate_sat_vb * 1e3 / 1e8 + fee_rate_dbit_vb = 10000 + fee_rate_dgb_kvb = fee_rate_dbit_vb * 1e3 / 1e8 # Test passing fee_rate as an integer - txid = self.nodes[2].sendtoaddress(address=address, amount=amount, fee_rate=fee_rate_sat_vb) + txid = self.nodes[2].sendtoaddress(address=address, amount=amount, fee_rate=fee_rate_dbit_vb) tx_size = self.get_vsize(self.nodes[2].gettransaction(txid)['hex']) self.generate(self.nodes[0], 1, sync_fun=lambda: self.sync_all(self.nodes[0:3])) @@ -474,15 +474,15 @@ def run_test(self): postbalance -= sum(utxo['amount'] for utxo in maturedUtxos) fee = prebalance - postbalance - Decimal(amount) - assert_fee_amount(fee, tx_size, Decimal(fee_rate_btc_kvb)) + assert_fee_amount(fee, tx_size, Decimal(fee_rate_dgb_kvb)) prebalance = self.nodes[2].getbalance() amount = Decimal("0.1") - fee_rate_sat_vb = 10000 - fee_rate_btc_kvb = fee_rate_sat_vb * 1e3 / 1e8 + fee_rate_dbit_vb = 10000 + fee_rate_dgb_kvb = fee_rate_dbit_vb * 1e3 / 1e8 # Test passing fee_rate as a string - txid = self.nodes[2].sendtoaddress(address=address, amount=amount, fee_rate=str(fee_rate_sat_vb)) + txid = self.nodes[2].sendtoaddress(address=address, amount=amount, fee_rate=str(fee_rate_dbit_vb)) tx_size = self.get_vsize(self.nodes[2].gettransaction(txid)['hex']) self.generate(self.nodes[0], 1, sync_fun=lambda: self.sync_all(self.nodes[0:3])) @@ -495,17 +495,17 @@ def run_test(self): fee = prebalance - postbalance - amount + maturedValue tx_obj = self.nodes[2].gettransaction(txid) - assert_fee_amount(fee, tx_size, Decimal(fee_rate_btc_kvb)) + assert_fee_amount(fee, tx_size, Decimal(fee_rate_dgb_kvb)) for key in ["totalFee", "feeRate"]: assert_raises_rpc_error(-8, "Unknown named parameter key", self.nodes[2].sendtoaddress, address=address, amount=1, fee_rate=1, key=1) # Test setting explicit fee rate just below the minimum. self.log.info("Test sendtoaddress raises 'fee rate too low' if fee_rate of 99.999 is passed") - assert_raises_rpc_error(-6, "Fee rate (99.999 sat/vB) is lower than the minimum fee rate setting (10000.000 sat/vB)", + assert_raises_rpc_error(-6, "Fee rate (99.999 dbit/vB) is lower than the minimum fee rate setting (10000.000 dbit/vB)", self.nodes[2].sendtoaddress, address=address, amount=1, fee_rate=99.999) self.log.info("Test sendtoaddress raises if fee_rate of 0 or -1 is passed") - assert_raises_rpc_error(-6, "Fee rate (0.000 sat/vB) is lower than the minimum fee rate setting (10000.000 sat/vB)", + assert_raises_rpc_error(-6, "Fee rate (0.000 dbit/vB) is lower than the minimum fee rate setting (10000.000 dbit/vB)", self.nodes[2].sendtoaddress, address=address, amount=10, fee_rate=0) assert_raises_rpc_error(-3, OUT_OF_RANGE, self.nodes[2].sendtoaddress, address=address, amount=1.0, fee_rate=-1) @@ -513,7 +513,7 @@ def run_test(self): for target, mode in product([-1, 0, 1009], ["economical", "conservative"]): assert_raises_rpc_error(-8, "Invalid conf_target, must be between 1 and 1008", # max value of 1008 per src/policy/fees.h self.nodes[2].sendtoaddress, address=address, amount=1, conf_target=target, estimate_mode=mode) - for target, mode in product([-1, 0], ["btc/kb", "sat/b"]): + for target, mode in product([-1, 0], ["dgb/kb", "dbit/b"]): assert_raises_rpc_error(-8, 'Invalid estimate_mode parameter, must be one of: "unset", "economical", "conservative"', self.nodes[2].sendtoaddress, address=address, amount=1, conf_target=target, estimate_mode=mode) diff --git a/test/functional/wallet_bumpfee.py b/test/functional/wallet_bumpfee.py index dd17692398..fa0dd1a4a5 100755 --- a/test/functional/wallet_bumpfee.py +++ b/test/functional/wallet_bumpfee.py @@ -37,7 +37,7 @@ WALLET_PASSPHRASE = "test" WALLET_PASSPHRASE_TIMEOUT = 3600 -# Fee rates (sat/vB) +# Fee rates (dbit/vB) INSUFFICIENT = 1 ECONOMICAL = 1500000 NORMAL = 6500000 @@ -73,7 +73,7 @@ def run_test(self): peer_node, rbf_node = self.nodes rbf_node_address = rbf_node.getnewaddress() - # fund rbf node with 10 coins of 0.001 btc (100,000 satoshis) + # fund rbf node with 10 coins of 0.001 dgb (100,000 digibits) self.log.info("Mining blocks...") self.generate(peer_node, COINBASE_MATURITY_2 + 10) self.sync_all() @@ -130,7 +130,7 @@ def test_invalid_parameters(self, rbf_node, peer_node, dest_address): # Test fee_rate values that don't pass fixed-point parsing checks. for invalid_value in ["", 0.000000001, 1e-09, 1.111111111, 1111111111111111, "31.999999999999999999999"]: assert_raises_rpc_error(-3, msg, rbf_node.bumpfee, rbfid, {"fee_rate": invalid_value}) - # Test fee_rate values that cannot be represented in sat/vB. + # Test fee_rate values that cannot be represented in dbit/vB. for invalid_value in [0.0001, 0.00000001, 0.00099999, 31.99999999, "0.0001", "0.00000001", "0.00099999", "31.99999999"]: assert_raises_rpc_error(-3, msg, rbf_node.bumpfee, rbfid, {"fee_rate": invalid_value}) # Test fee_rate out of range (negative number). @@ -156,7 +156,7 @@ def test_invalid_parameters(self, rbf_node, peer_node, dest_address): for k, v in {"number": 42, "object": {"foo": "bar"}}.items(): assert_raises_rpc_error(-3, "Expected type string for estimate_mode, got {}".format(k), rbf_node.bumpfee, rbfid, {"estimate_mode": v}) - for mode in ["foo", Decimal("3.1415"), "sat/B", "BTC/kB"]: + for mode in ["foo", Decimal("3.1415"), "dbit/B", "DGB/kB"]: assert_raises_rpc_error(-8, 'Invalid estimate_mode parameter, must be one of: "unset", "economical", "conservative"', rbf_node.bumpfee, rbfid, {"estimate_mode": mode}) @@ -323,10 +323,10 @@ def test_dust_to_fee(self, rbf_node, dest_address): # boundary. Thus expected transaction size (p2wpkh, 1 input, 2 outputs) is 140-141 vbytes, usually 141. if not 140 <= fulltx["vsize"] <= 141: raise AssertionError("Invalid tx vsize of {} (140-141 expected), full tx: {}".format(fulltx["vsize"], fulltx)) - # Bump with fee_rate of 350.25 sat/vB vbytes to create dust. - # Expected fee is 141 vbytes * fee_rate 0.00350250 BTC / 1000 vbytes = 0.00049385 BTC. - # or occasionally 140 vbytes * fee_rate 0.00350250 BTC / 1000 vbytes = 0.00049035 BTC. - # Dust should be dropped to the fee, so actual bump fee is 0.00050000 BTC. + # Bump with fee_rate of 350.25 dbit/vB vbytes to create dust. + # Expected fee is 141 vbytes * fee_rate 0.00350250 DGB / 1000 vbytes = 0.00049385 DGB. + # or occasionally 140 vbytes * fee_rate 0.00350250 DGB / 1000 vbytes = 0.00049035 DGB. + # Dust should be dropped to the fee, so actual bump fee is 0.00050000 DGB. bumped_tx = rbf_node.bumpfee(rbfid, {"fee_rate": 8546090}) #0,03546 0,03571428571 full_bumped_tx = rbf_node.getrawtransaction(bumped_tx["txid"], 1) assert_equal(bumped_tx["fee"], Decimal("17.99550000")) @@ -363,7 +363,7 @@ def test_settxfee(self, rbf_node, dest_address): def test_maxtxfee_fails(self, rbf_node, dest_address): self.log.info('Test that bumpfee fails when it hits -maxtxfee') # size of bumped transaction (p2wpkh, 1 input, 2 outputs): 141 vbytes - # expected bump fee of 141 vbytes * 0.00200000 BTC / 1000 vbytes = 0.00002820 BTC + # expected bump fee of 141 vbytes * 0.00200000 DGB / 1000 vbytes = 0.00002820 DGB # which exceeds maxtxfee and is expected to raise self.restart_node(1, ['-maxtxfee=0.000025'] + self.extra_args[1]) rbf_node.walletpassphrase(WALLET_PASSPHRASE, WALLET_PASSPHRASE_TIMEOUT) diff --git a/test/functional/wallet_groups.py b/test/functional/wallet_groups.py index 315dfe1a94..e1275cf712 100755 --- a/test/functional/wallet_groups.py +++ b/test/functional/wallet_groups.py @@ -87,7 +87,7 @@ def run_test(self): # - D ~0.3 assert_approx(self.nodes[1].getbalance(), vexp=4.3, vspan=0.1) assert_approx(self.nodes[2].getbalance(), vexp=4.3, vspan=0.1) - # Sending 1.4 btc should pick one 1.0 + one more. For node #1, + # Sending 1.4 dgb should pick one 1.0 + one more. For node #1, # this could be (A / B0 / C0) + (B1 / C1 / D). We ensure that it is # B0 + B1 or C0 + C1, because this avoids partial spends while not being # detrimental to transaction cost @@ -144,7 +144,7 @@ def run_test(self): assert_equal(2, len(tx5["vout"])) # Test wallet option maxapsfee with node 4, which sets maxapsfee - # 1 sat higher, crossing the threshold from non-grouped to grouped. + # 1 dbit higher, crossing the threshold from non-grouped to grouped. self.log.info("Test wallet option maxapsfee threshold from non-grouped to grouped") addr_aps3 = self.nodes[4].getnewaddress() [self.nodes[0].sendtoaddress(addr_aps3, 1.0) for _ in range(5)] diff --git a/test/functional/wallet_listsinceblock.py b/test/functional/wallet_listsinceblock.py index e8be21c6e9..82f5d2daf8 100755 --- a/test/functional/wallet_listsinceblock.py +++ b/test/functional/wallet_listsinceblock.py @@ -174,8 +174,8 @@ def test_double_spend(self): Problematic case: - 1. User 1 receives BTC in tx1 from utxo1 in block aa1. - 2. User 2 receives BTC in tx2 from utxo1 (same) in block bb1 + 1. User 1 receives DGB in tx1 from utxo1 in block aa1. + 2. User 2 receives DGB in tx2 from utxo1 (same) in block bb1 3. User 1 sees 2 confirmations at block aa3. 4. Reorg into bb chain. 5. User 1 asks `listsinceblock aa3` and does not see that tx1 is now diff --git a/test/functional/wallet_send.py b/test/functional/wallet_send.py index aa8818dc15..5560de5493 100755 --- a/test/functional/wallet_send.py +++ b/test/functional/wallet_send.py @@ -27,7 +27,7 @@ def set_test_params(self): ["-whitelist=127.0.0.1","-walletrbf=1"], ["-whitelist=127.0.0.1","-walletrbf=1"], ] - getcontext().prec = 8 # Satoshi precision for Decimal + getcontext().prec = 8 # Digibit precision for Decimal def skip_test_if_missing_module(self): self.skip_if_no_wallet() @@ -339,7 +339,7 @@ def run_test(self): self.test_send(from_wallet=w0, to_wallet=w1, amount=1, arg_fee_rate=10000, fee_rate=10000, add_to_wallet=False, expect_error=(-8, "Pass the fee_rate either as an argument, or in the options object, but not both")) - assert_raises_rpc_error(-8, "Use fee_rate (sat/vB) instead of feeRate", w0.send, {w1.getnewaddress(): 1}, 6, "conservative", 1, {"feeRate": 1.00}) + assert_raises_rpc_error(-8, "Use fee_rate (dbit/vB) instead of feeRate", w0.send, {w1.getnewaddress(): 1}, 6, "conservative", 1, {"feeRate": 1.00}) assert_raises_rpc_error(-3, "Unexpected key totalFee", w0.send, {w1.getnewaddress(): 1}, 6, "conservative", 1, {"totalFee": 1.00}) @@ -347,7 +347,7 @@ def run_test(self): self.test_send(from_wallet=w0, to_wallet=w1, amount=1, conf_target=target, estimate_mode=mode, expect_error=(-8, "Invalid conf_target, must be between 1 and 1008")) # max value of 1008 per src/policy/fees.h msg = 'Invalid estimate_mode parameter, must be one of: "unset", "economical", "conservative"' - for target, mode in product([-1, 0], ["btc/kb", "sat/b"]): + for target, mode in product([-1, 0], ["dgb/kb", "dbit/b"]): self.test_send(from_wallet=w0, to_wallet=w1, amount=1, conf_target=target, estimate_mode=mode, expect_error=(-8, msg)) for mode in ["", "foo", Decimal("3.141592")]: self.test_send(from_wallet=w0, to_wallet=w1, amount=1, conf_target=0.1, estimate_mode=mode, expect_error=(-8, msg)) @@ -359,15 +359,15 @@ def run_test(self): self.test_send(from_wallet=w0, to_wallet=w1, amount=1, conf_target=v, estimate_mode=mode, expect_error=(-3, f"Expected type number for conf_target, got {k}")) - # Test setting explicit fee rate just below the minimum of 1 sat/vB. + # Test setting explicit fee rate just below the minimum of 1 dbit/vB. self.log.info("Explicit fee rate raises RPC error 'fee rate too low' if fee_rate of 99.999999 is passed") - msg = "Fee rate (9999.900 sat/vB) is lower than the minimum fee rate setting (10000.000 sat/vB)" + msg = "Fee rate (9999.900 dbit/vB) is lower than the minimum fee rate setting (10000.000 dbit/vB)" self.test_send(from_wallet=w0, to_wallet=w1, amount=1, fee_rate=9999.9, expect_error=(-4, msg)) self.test_send(from_wallet=w0, to_wallet=w1, amount=1, arg_fee_rate=9999.9, expect_error=(-4, msg)) self.log.info("Explicit fee rate raises if invalid fee_rate is passed") # Test fee_rate with zero values. - msg = "Fee rate (0.000 sat/vB) is lower than the minimum fee rate setting (10000.000 sat/vB)" + msg = "Fee rate (0.000 dbit/vB) is lower than the minimum fee rate setting (10000.000 dbit/vB)" for zero_value in [0, 0.000, 0.00000000, "0", "0.000", "0.00000000"]: self.test_send(from_wallet=w0, to_wallet=w1, amount=1, fee_rate=zero_value, expect_error=(-4, msg)) self.test_send(from_wallet=w0, to_wallet=w1, amount=1, arg_fee_rate=zero_value, expect_error=(-4, msg)) @@ -376,7 +376,7 @@ def run_test(self): for invalid_value in ["", 0.000000001, 1e-09, 1.111111111, 1111111111111111, "31.999999999999999999999"]: self.test_send(from_wallet=w0, to_wallet=w1, amount=1, fee_rate=invalid_value, expect_error=(-3, msg)) self.test_send(from_wallet=w0, to_wallet=w1, amount=1, arg_fee_rate=invalid_value, expect_error=(-3, msg)) - # Test fee_rate values that cannot be represented in sat/vB. + # Test fee_rate values that cannot be represented in dbit/vB. for invalid_value in [0.0001, 0.00000001, 0.00099999, 31.99999999, "0.0001", "0.00000001", "0.00099999", "31.99999999"]: self.test_send(from_wallet=w0, to_wallet=w1, amount=1, fee_rate=invalid_value, expect_error=(-3, msg)) self.test_send(from_wallet=w0, to_wallet=w1, amount=1, arg_fee_rate=invalid_value, expect_error=(-3, msg)) @@ -391,7 +391,7 @@ def run_test(self): self.test_send(from_wallet=w0, to_wallet=w1, amount=1, arg_fee_rate=invalid_value, expect_error=(-3, msg)) # TODO: Return hex if fee rate is below -maxmempool - # res = self.test_send(from_wallet=w0, to_wallet=w1, amount=1, conf_target=0.1, estimate_mode="sat/b", add_to_wallet=False) + # res = self.test_send(from_wallet=w0, to_wallet=w1, amount=1, conf_target=0.1, estimate_mode="dbit/b", add_to_wallet=False) # assert res["hex"] # hex = res["hex"] # res = self.nodes[0].testmempoolaccept([hex]) diff --git a/test/functional/wallet_txn_clone.py b/test/functional/wallet_txn_clone.py index e099d30cd7..0a888796ac 100755 --- a/test/functional/wallet_txn_clone.py +++ b/test/functional/wallet_txn_clone.py @@ -108,7 +108,7 @@ def run_test(self): tx1 = self.nodes[0].gettransaction(txid1) tx2 = self.nodes[0].gettransaction(txid2) - # Node0's balance should be starting balance, plus 50BTC for another + # Node0's balance should be starting balance, plus 50DGB for another # matured block, minus tx1 and tx2 amounts, and minus transaction fees: expected += tx1["amount"] + tx1["fee"] expected += tx2["amount"] + tx2["fee"] diff --git a/test/functional/wallet_txn_doublespend.py b/test/functional/wallet_txn_doublespend.py index dcc77847da..b87d6f2ba6 100755 --- a/test/functional/wallet_txn_doublespend.py +++ b/test/functional/wallet_txn_doublespend.py @@ -73,7 +73,7 @@ def run_test(self): # Coins are sent to node1_address node1_address = self.nodes[1].getnewaddress() - # First: use raw transaction API to send 1240 BTC to node1_address, + # First: use raw transaction API to send 1240 DGB to node1_address, # but don't broadcast: doublespend_fee = Decimal('-.2') rawtx_input_0 = {} @@ -102,7 +102,7 @@ def run_test(self): tx1 = self.nodes[0].gettransaction(txid1) tx2 = self.nodes[0].gettransaction(txid2) - # Node0's balance should be starting balance, plus 50BTC for another + # Node0's balance should be starting balance, plus 50DGB for another # matured block, minus 40, minus 20, and minus transaction fees: expected = starting_balance + fund_foo_tx["fee"] + fund_bar_tx["fee"] if self.options.mine_block: diff --git a/test/functional/wallet_watchonly.py b/test/functional/wallet_watchonly.py index a1bea0c4a0..f99c897fb2 100755 --- a/test/functional/wallet_watchonly.py +++ b/test/functional/wallet_watchonly.py @@ -36,10 +36,10 @@ def run_test(self): wo_wallet.importpubkey(pubkey=def_wallet.getaddressinfo(wo_addr)['pubkey']) wo_wallet.importpubkey(pubkey=def_wallet.getaddressinfo(wo_change)['pubkey']) - # generate some btc for testing + # generate some dgb for testing self.generatetoaddress(node, COINBASE_MATURITY_2 + 1, a1) - # send 1 btc to our watch-only address + # send 1 dgb to our watch-only address txid = def_wallet.sendtoaddress(wo_addr, 1) self.generate(self.nodes[0], 1)