Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests.

Also remove DEFAULT_FEE_ZATS in RPC tests which was unused.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Emma Hopwood 2023-04-25 23:40:43 +01:00
parent ff121bc8a7
commit d438b79184
30 changed files with 136 additions and 137 deletions

View File

@ -21,7 +21,7 @@ from test_framework.util import (
HEARTWOOD_BRANCH_ID,
CANOPY_BRANCH_ID,
NU5_BRANCH_ID,
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
assert_equal,
assert_false,
assert_true,
@ -201,7 +201,7 @@ class Zip239Test(BitcoinTestFramework):
opid = self.nodes[0].z_sendmany(sproutzaddr, [{
'address': node1_taddr,
'amount': 1,
}], 1, DEFAULT_FEE, 'AllowRevealedRecipients')
}], 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
v4_txid = uint256_from_str(hex_str_to_bytes(
wait_and_assert_operationid_status(self.nodes[0], opid)
)[::-1])

View File

@ -9,7 +9,7 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
CANOPY_BRANCH_ID,
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
NU5_BRANCH_ID,
get_coinbase_address,
hex_str_to_bytes,
@ -52,13 +52,13 @@ class GetBlockTemplateTest(BitcoinTestFramework):
node = self.node
# sprout to transparent (v4)
recipients = [{"address": self.transparent_addr, "amount": Decimal('0.1')}]
myopid = node.z_sendmany(self.sprout_addr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients')
myopid = node.z_sendmany(self.sprout_addr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(node, myopid)
def add_nu5_v5_tx_to_mempool(self):
node = self.node
recipients = [{"address": self.unified_addr, "amount": Decimal('9.99999')}]
myopid = node.z_sendmany(get_coinbase_address(node), recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
myopid = node.z_sendmany(get_coinbase_address(node), recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(node, myopid)
def add_transparent_tx_to_mempool(self):

View File

@ -10,7 +10,7 @@
#
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, start_node, DEFAULT_FEE
from test_framework.util import assert_equal, start_node, LEGACY_DEFAULT_FEE
from decimal import Decimal
@ -62,7 +62,7 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
blocks = []
blocks.extend(self.nodes[0].generate(1))
spends2_raw = [ self.create_tx(txid, node0_address, Decimal('10.0') - DEFAULT_FEE) for txid in spends1_id ]
spends2_raw = [ self.create_tx(txid, node0_address, Decimal('10.0') - LEGACY_DEFAULT_FEE) for txid in spends1_id ]
spends2_id = [ self.nodes[0].sendrawtransaction(tx) for tx in spends2_raw ]
blocks.extend(self.nodes[0].generate(1))

View File

@ -11,7 +11,7 @@ from test_framework.authproxy import JSONRPCException
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, \
connect_nodes_bi, sync_blocks, start_nodes, \
wait_and_assert_operationid_status, DEFAULT_FEE
wait_and_assert_operationid_status, LEGACY_DEFAULT_FEE
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -79,7 +79,7 @@ class MempoolTxExpiryTest(BitcoinTestFramework):
assert_equal(set(self.nodes[2].getrawmempool()), set())
## Shield one of Alice's coinbase funds to her zaddr
res = self.nodes[0].z_shieldcoinbase("*", z_alice, DEFAULT_FEE, 1)
res = self.nodes[0].z_shieldcoinbase("*", z_alice, LEGACY_DEFAULT_FEE, 1)
wait_and_assert_operationid_status(self.nodes[0], res['opid'])
self.nodes[0].generate(1)
self.sync_all()
@ -87,7 +87,7 @@ class MempoolTxExpiryTest(BitcoinTestFramework):
# Get balance on node 0
bal = self.nodes[0].z_gettotalbalance()
print("Balance before zsend, after shielding 10: ", bal)
assert_equal(Decimal(bal["private"]), Decimal('10.0') - DEFAULT_FEE)
assert_equal(Decimal(bal["private"]), Decimal('10.0') - LEGACY_DEFAULT_FEE)
print("Splitting network...")
self.split_network()
@ -220,7 +220,7 @@ class MempoolTxExpiryTest(BitcoinTestFramework):
print("Ensure balance of node 0 is correct")
bal = self.nodes[0].z_gettotalbalance()
print("Balance after expire_shielded has expired: ", bal)
assert_equal(Decimal(bal["private"]), Decimal('8.0') - DEFAULT_FEE)
assert_equal(Decimal(bal["private"]), Decimal('8.0') - LEGACY_DEFAULT_FEE)
print("Splitting network...")
self.split_network()

View File

@ -10,7 +10,7 @@
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, connect_nodes_bi, fail, \
initialize_chain_clean, start_node, \
wait_and_assert_operationid_status, DEFAULT_FEE
wait_and_assert_operationid_status, LEGACY_DEFAULT_FEE
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -251,7 +251,7 @@ class MergeToAddressHelper:
test.sync_all()
# This z_mergetoaddress and the one below result in two notes in myzaddr.
result = test.nodes[0].z_mergetoaddress([mytaddr], myzaddr, DEFAULT_FEE, None, None, None, 'AllowRevealedSenders')
result = test.nodes[0].z_mergetoaddress([mytaddr], myzaddr, LEGACY_DEFAULT_FEE, None, None, None, 'AllowRevealedSenders')
assert_equal(result["mergingUTXOs"], 5)
assert_equal(result["remainingUTXOs"], 0)
assert_equal(result["mergingNotes"], 0)
@ -259,7 +259,7 @@ class MergeToAddressHelper:
wait_and_assert_operationid_status(test.nodes[0], result['opid'])
# Verify maximum number of UTXOs is not limited when the limit parameter is set to 0.
result = test.nodes[2].z_mergetoaddress([n2taddr], myzaddr, DEFAULT_FEE, 0, None, None, 'AllowRevealedSenders')
result = test.nodes[2].z_mergetoaddress([n2taddr], myzaddr, LEGACY_DEFAULT_FEE, 0, None, None, 'AllowRevealedSenders')
assert_equal(result["mergingUTXOs"], 20)
assert_equal(result["remainingUTXOs"], 0)
assert_equal(result["mergingNotes"], 0)
@ -303,7 +303,7 @@ class MergeToAddressHelper:
# NB: We cant yet merge from UAs, so ensure were not before running these cases
if (myzaddr[0] != 'u'):
# Also check that we can set off a second merge before the first one is complete
result1 = test.nodes[0].z_mergetoaddress([myzaddr], myzaddr, DEFAULT_FEE, 50, 2)
result1 = test.nodes[0].z_mergetoaddress([myzaddr], myzaddr, LEGACY_DEFAULT_FEE, 50, 2)
# First merge should select from all notes
assert_equal(result1["mergingUTXOs"], 0)
@ -313,7 +313,7 @@ class MergeToAddressHelper:
assert_equal(result1["remainingNotes"], 2)
# Second merge should ignore locked notes
result2 = test.nodes[0].z_mergetoaddress([myzaddr], myzaddr, DEFAULT_FEE, 50, 2)
result2 = test.nodes[0].z_mergetoaddress([myzaddr], myzaddr, LEGACY_DEFAULT_FEE, 50, 2)
assert_equal(result2["mergingUTXOs"], 0)
assert_equal(result2["remainingUTXOs"], 0)
assert_equal(result2["mergingNotes"], 2)
@ -326,7 +326,7 @@ class MergeToAddressHelper:
test.sync_all()
# Shield both UTXOs and notes to a z-addr
result = test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, DEFAULT_FEE, 10, 2, None, 'AllowRevealedSenders')
result = test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, LEGACY_DEFAULT_FEE, 10, 2, None, 'AllowRevealedSenders')
assert_equal(result["mergingUTXOs"], 10)
assert_equal(result["remainingUTXOs"], 7)
assert_equal(result["mergingNotes"], 2)
@ -334,7 +334,7 @@ class MergeToAddressHelper:
wait_and_assert_operationid_status(test.nodes[0], result['opid'])
else:
# Shield both UTXOs and notes to a z-addr
result = test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, DEFAULT_FEE, 10, 2, None, 'AllowRevealedSenders')
result = test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, LEGACY_DEFAULT_FEE, 10, 2, None, 'AllowRevealedSenders')
assert_equal(result["mergingUTXOs"], 10)
assert_equal(result["remainingUTXOs"], 7)
assert_equal(result["mergingNotes"], 2)

View File

@ -5,7 +5,7 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
start_nodes,
wait_and_assert_operationid_status,
)
@ -33,7 +33,7 @@ class RegtestSignrawtransactionTest (BitcoinTestFramework):
opid = self.nodes[1].z_sendmany(
taddr,
[{'address': zaddr1, 'amount': 1}],
1, DEFAULT_FEE, 'AllowFullyTransparent')
1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
wait_and_assert_operationid_status(self.nodes[1], opid)
if __name__ == '__main__':

View File

@ -3,7 +3,7 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
BLOSSOM_BRANCH_ID,
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
assert_equal,
assert_true,
initialize_chain_clean,
@ -49,7 +49,7 @@ class SignOfflineTest (BitcoinTestFramework):
create_inputs = [{'txid': txid, 'vout': 0}]
sign_inputs = [{'txid': txid, 'vout': 0, 'scriptPubKey': scriptpubkey, 'amount': 10}]
create_hex = self.nodes[0].createrawtransaction(create_inputs, {taddr: Decimal('10.0') - DEFAULT_FEE})
create_hex = self.nodes[0].createrawtransaction(create_inputs, {taddr: Decimal('10.0') - LEGACY_DEFAULT_FEE})
# An offline regtest node does not rely on the approx release height of the software
# to determine the consensus rules to be used for signing.

View File

@ -7,7 +7,7 @@ from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_true, \
start_nodes, \
wait_and_assert_operationid_status_result, DEFAULT_FEE
wait_and_assert_operationid_status_result, LEGACY_DEFAULT_FEE
SAPLING_ADDR = 'zregtestsapling1ssqj3f3majnl270985gqcdqedd9t4nlttjqskccwevj2v20sc25deqspv3masufnwcdy67cydyy'
SAPLING_KEY = 'secret-extended-key-regtest1qv62zt2fqyqqpqrh2qzc08h7gncf4447jh9kvnnnhjg959fkwt7mhw9j8e9at7attx8z6u3953u86vcnsujdc2ckdlcmztjt44x3uxpah5mxtncxd0mqcnz9eq8rghh5m4j44ep5d9702sdvvwawqassulktfegrcp4twxgqdxx4eww3lau0mywuaeztpla2cmvagr5nj98elt45zh6fjznadl6wz52n2uyhdwcm2wlsu8fnxstrk6s4t55t8dy6jkgx5g0cwpchh5qffp8x5'
@ -127,7 +127,7 @@ class SproutSaplingMigration(BitcoinTestFramework):
# Check that unmigrated amount + unfinalized = starting balance - fee
status = node.z_getmigrationstatus()
print("status: {}".format(status))
assert_equal(sprout_initial_balance - DEFAULT_FEE, Decimal(status['unmigrated_amount']) + Decimal(status['unfinalized_migrated_amount']))
assert_equal(sprout_initial_balance - LEGACY_DEFAULT_FEE, Decimal(status['unmigrated_amount']) + Decimal(status['unfinalized_migrated_amount']))
# The transaction in the mempool should be the one listed in migration_txids,
# and it should expire at the next 450 % 500.
@ -146,7 +146,7 @@ class SproutSaplingMigration(BitcoinTestFramework):
print("sprout balance: {}, sapling balance: {}".format(sprout_balance, sapling_balance))
assert_true(sprout_balance < sprout_initial_balance, "Should have less Sprout funds")
assert_true(sapling_balance > Decimal('0'), "Should have more Sapling funds")
assert_true(sprout_balance + sapling_balance, sprout_initial_balance - DEFAULT_FEE)
assert_true(sprout_balance + sapling_balance, sprout_initial_balance - LEGACY_DEFAULT_FEE)
check_migration_status(node, saplingAddr, DURING_MIGRATION)
# At 10 % 500 the transactions will be considered 'finalized'

View File

@ -31,8 +31,7 @@ from .authproxy import AuthServiceProxy, JSONRPCException
ZCASHD_BINARY = os.path.join('src', 'zcashd')
DEFAULT_FEE = Decimal('0.00001')
DEFAULT_FEE_ZATS = 1000
LEGACY_DEFAULT_FEE = Decimal('0.00001')
COVERAGE_DIR = None
PRE_BLOSSOM_BLOCK_TARGET_SPACING = 150

View File

@ -9,7 +9,7 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, initialize_chain_clean, \
initialize_datadir, start_nodes, start_node, connect_nodes_bi, \
bitcoind_processes, wait_and_assert_operationid_status, \
get_coinbase_address, DEFAULT_FEE
get_coinbase_address, LEGACY_DEFAULT_FEE
from decimal import Decimal
@ -68,8 +68,8 @@ class Wallet1941RegressionTest (BitcoinTestFramework):
# Send 10 coins to our zaddr.
recipients = []
recipients.append({"address":myzaddr, "amount":Decimal('10.0') - DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
recipients.append({"address":myzaddr, "amount":Decimal('10.0') - LEGACY_DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.nodes[0].generate(1)
@ -82,7 +82,7 @@ class Wallet1941RegressionTest (BitcoinTestFramework):
# Confirm the balance on node 0.
resp = self.nodes[0].z_getbalance(myzaddr)
assert_equal(Decimal(resp), Decimal('10.0') - DEFAULT_FEE)
assert_equal(Decimal(resp), Decimal('10.0') - LEGACY_DEFAULT_FEE)
# Export the key for the zaddr from node 0.
key = self.nodes[0].z_exportkey(myzaddr)
@ -109,7 +109,7 @@ class Wallet1941RegressionTest (BitcoinTestFramework):
# Confirm that the balance on node 1 is valid now (node 1 must
# have rescanned)
resp = self.nodes[1].z_getbalance(myzaddr)
assert_equal(Decimal(resp), Decimal('10.0') - DEFAULT_FEE)
assert_equal(Decimal(resp), Decimal('10.0') - LEGACY_DEFAULT_FEE)
if __name__ == '__main__':

View File

@ -7,7 +7,7 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, initialize_chain_clean, \
start_nodes, stop_nodes, connect_nodes_bi, \
wait_and_assert_operationid_status, wait_bitcoinds, get_coinbase_address, \
sync_blocks, sync_mempools, DEFAULT_FEE
sync_blocks, sync_mempools, LEGACY_DEFAULT_FEE
from decimal import Decimal
class WalletAnchorForkTest (BitcoinTestFramework):
@ -52,8 +52,8 @@ class WalletAnchorForkTest (BitcoinTestFramework):
mytaddr0 = get_coinbase_address(self.nodes[0])
myzaddr0 = self.nodes[0].z_getnewaddress()
recipients = []
recipients.append({"address":myzaddr0, "amount": Decimal('10.0') - DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
recipients.append({"address":myzaddr0, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
# Sync up mempools and mine the transaction. All nodes have the same anchor.
@ -76,8 +76,8 @@ class WalletAnchorForkTest (BitcoinTestFramework):
# Partition A, node 0 creates a joinsplit transaction
recipients = []
recipients.append({"address":myzaddr0, "amount": Decimal('10.0') - DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
recipients.append({"address":myzaddr0, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
txid = wait_and_assert_operationid_status(self.nodes[0], myopid)
rawhex = self.nodes[0].getrawtransaction(txid)

View File

@ -12,7 +12,7 @@ from test_framework.util import (
nuparams,
start_nodes,
wait_and_assert_operationid_status,
DEFAULT_FEE
LEGACY_DEFAULT_FEE
)
from decimal import Decimal
@ -46,10 +46,10 @@ class WalletListNotes(BitcoinTestFramework):
# Send 1.0 minus default fee from sproutzaddr to a new Sapling zaddr
saplingzaddr = self.nodes[0].z_getnewaddress('sapling')
receive_amount_2 = Decimal('1.0')
change_amount_2 = receive_amount_1 - receive_amount_2 - DEFAULT_FEE
change_amount_2 = receive_amount_1 - receive_amount_2 - LEGACY_DEFAULT_FEE
assert_equal('sapling', self.nodes[0].z_validateaddress(saplingzaddr)['address_type'])
recipients = [{"address": saplingzaddr, "amount":receive_amount_2}]
myopid = self.nodes[0].z_sendmany(sproutzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedAmounts')
myopid = self.nodes[0].z_sendmany(sproutzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedAmounts')
txid_2 = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -86,9 +86,9 @@ class WalletListNotes(BitcoinTestFramework):
# Send 2.0 minus default fee to a new sapling zaddr
saplingzaddr2 = self.nodes[0].z_getnewaddress('sapling')
receive_amount_3 = Decimal('2.0')
change_amount_3 = change_amount_2 - receive_amount_3 - DEFAULT_FEE
change_amount_3 = change_amount_2 - receive_amount_3 - LEGACY_DEFAULT_FEE
recipients = [{"address": saplingzaddr2, "amount":receive_amount_3}]
myopid = self.nodes[0].z_sendmany(sproutzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedAmounts')
myopid = self.nodes[0].z_sendmany(sproutzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedAmounts')
txid_3 = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
unspent_tx = self.nodes[0].z_listunspent(0)

View File

@ -12,7 +12,7 @@ from test_framework.util import (
assert_raises_message,
connect_nodes_bi,
nuparams,
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
NU5_BRANCH_ID,
)
from test_framework.util import wait_and_assert_operationid_status, start_nodes
@ -66,7 +66,7 @@ class ListReceivedTest (BitcoinTestFramework):
opid = self.nodes[1].z_sendmany(taddr, [
{'address': zaddr1, 'amount': 1, 'memo': my_memo},
{'address': zaddrExt, 'amount': 2},
], 1, DEFAULT_FEE, 'AllowFullyTransparent')
], 1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
txid = wait_and_assert_operationid_status(self.nodes[1], opid)
self.sync_all()
@ -179,7 +179,7 @@ class ListReceivedTest (BitcoinTestFramework):
assert_equal(txid, r[0]['txid'])
assert_equal(Decimal('0.4')-conventional_fee(2), r[0]['amount'])
assert_equal(40000000-conventional_fee_zats(2), r[0]['amountZat'])
assert_equal(r[0]['change'], True, "Note valued at (0.4-"+str(DEFAULT_FEE)+") should be change")
assert_equal(r[0]['change'], True, "Note valued at (0.4-"+str(LEGACY_DEFAULT_FEE)+") should be change")
assert_equal(no_memo, r[0]['memo'])
# The old note still exists (it's immutable), even though it is spent

View File

@ -6,7 +6,7 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_true, bitcoind_processes, \
connect_nodes_bi, start_node, start_nodes, wait_and_assert_operationid_status, \
get_coinbase_address, DEFAULT_FEE
get_coinbase_address, LEGACY_DEFAULT_FEE
from test_framework.zip317 import conventional_fee
from decimal import Decimal
@ -32,11 +32,11 @@ class WalletNullifiersTest (BitcoinTestFramework):
# Tests using the default cached chain have one address per coinbase output
mytaddr = get_coinbase_address(self.nodes[0])
recipients = []
recipients.append({"address": myzaddr0, "amount": Decimal('10.0') - DEFAULT_FEE}) # utxo amount less fee
recipients.append({"address": myzaddr0, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE}) # utxo amount less fee
wait_and_assert_operationid_status(
self.nodes[0],
self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders'),
self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders'),
timeout=120)
self.sync_all()
@ -109,7 +109,7 @@ class WalletNullifiersTest (BitcoinTestFramework):
wait_and_assert_operationid_status(
self.nodes[1],
self.nodes[1].z_sendmany(myzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients'),
self.nodes[1].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients'),
timeout=120)
self.sync_all()
@ -118,7 +118,7 @@ class WalletNullifiersTest (BitcoinTestFramework):
# check zaddr balance
zsendmany3notevalue = Decimal('1.0')
zaddrremaining2 = zaddrremaining - zsendmany3notevalue - DEFAULT_FEE
zaddrremaining2 = zaddrremaining - zsendmany3notevalue - LEGACY_DEFAULT_FEE
assert_equal(self.nodes[1].z_getbalance(myzaddr), zaddrremaining2)
assert_equal(self.nodes[2].z_getbalance(myzaddr), zaddrremaining2)

View File

@ -11,7 +11,7 @@ from test_framework.util import (
get_coinbase_address,
start_nodes,
wait_and_assert_operationid_status,
DEFAULT_FEE
LEGACY_DEFAULT_FEE
)
from test_framework.authproxy import JSONRPCException
@ -70,12 +70,12 @@ class WalletOverwinterTxTest (BitcoinTestFramework):
# Node 2 sends the zero-confirmation transparent funds to Node 1 using z_sendmany
recipients = []
recipients.append({"address":taddr1, "amount": Decimal('0.5')})
myopid = self.nodes[2].z_sendmany(taddr2, recipients, 0, DEFAULT_FEE, 'AllowFullyTransparent')
myopid = self.nodes[2].z_sendmany(taddr2, recipients, 0, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
txid_zsendmany = wait_and_assert_operationid_status(self.nodes[2], myopid)
# Node 0 shields to Node 2, a coinbase utxo of value 10.0 less default fee
zsendamount = Decimal('10.0') - DEFAULT_FEE
result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr2, DEFAULT_FEE, 1)
zsendamount = Decimal('10.0') - LEGACY_DEFAULT_FEE
result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr2, LEGACY_DEFAULT_FEE, 1)
txid_shielded = wait_and_assert_operationid_status(self.nodes[0], result['opid'])
# Skip over the three blocks prior to activation; no transactions can be mined
@ -86,7 +86,7 @@ class WalletOverwinterTxTest (BitcoinTestFramework):
# Verify balance
assert_equal(self.nodes[1].z_getbalance(taddr1), Decimal('0.5'))
assert_equal(self.nodes[2].getbalance(), Decimal('0.5') - DEFAULT_FEE)
assert_equal(self.nodes[2].getbalance(), Decimal('0.5') - LEGACY_DEFAULT_FEE)
assert_equal(self.nodes[2].z_getbalance(zaddr2), zsendamount)
# Verify transaction version is 4 (intended for Sapling+)
@ -139,12 +139,12 @@ class WalletOverwinterTxTest (BitcoinTestFramework):
# Node 3 sends the zero-confirmation transparent funds to Node 1 using z_sendmany
recipients = []
recipients.append({"address":taddr1, "amount": Decimal('0.5')})
myopid = self.nodes[3].z_sendmany(taddr3, recipients, 0, DEFAULT_FEE, 'AllowFullyTransparent')
myopid = self.nodes[3].z_sendmany(taddr3, recipients, 0, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
txid_zsendmany = wait_and_assert_operationid_status(self.nodes[3], myopid)
# Node 0 shields to Node 3, a coinbase utxo of value 10.0 less default fee
zsendamount = Decimal('10.0') - DEFAULT_FEE
result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr3, DEFAULT_FEE, 1)
zsendamount = Decimal('10.0') - LEGACY_DEFAULT_FEE
result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr3, LEGACY_DEFAULT_FEE, 1)
txid_shielded = wait_and_assert_operationid_status(self.nodes[0], result['opid'])
# Mine the first Blossom block
@ -162,7 +162,7 @@ class WalletOverwinterTxTest (BitcoinTestFramework):
# Verify balance
assert_equal(self.nodes[1].z_getbalance(taddr1), Decimal('1.0'))
assert_equal(self.nodes[3].getbalance(), Decimal('0.5') - DEFAULT_FEE)
assert_equal(self.nodes[3].getbalance(), Decimal('0.5') - LEGACY_DEFAULT_FEE)
assert_equal(self.nodes[3].z_getbalance(zaddr3), zsendamount)
# Verify transaction version is 4 (intended for Sapling+)

View File

@ -9,7 +9,7 @@ from test_framework.util import (
get_coinbase_address,
start_nodes,
wait_and_assert_operationid_status,
DEFAULT_FEE
LEGACY_DEFAULT_FEE
)
from decimal import Decimal
@ -159,8 +159,8 @@ class WalletSaplingTest(BitcoinTestFramework):
myopid = self.nodes[1].z_sendmany(
taddr1,
[{'address': node4_sproutaddr, 'amount': Decimal('2.5')},
{'address': node4_saplingaddr, 'amount': Decimal('2.5') - DEFAULT_FEE}],
1, DEFAULT_FEE, 'AllowRevealedSenders'
{'address': node4_saplingaddr, 'amount': Decimal('2.5') - LEGACY_DEFAULT_FEE}],
1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders'
)
wait_and_assert_operationid_status(self.nodes[1], myopid, "failed", "Sending funds into the Sprout pool is no longer supported.")

View File

@ -5,7 +5,7 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
assert_equal,
connect_nodes_bi,
start_nodes,
@ -58,7 +58,7 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
{'address': node3taddr2, 'amount': 75},
],
1,
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
'AllowRevealedRecipients',
),
)
@ -77,7 +77,7 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
self.nodes[3].z_sendmany(
'ANY_TADDR',
[{'address': recipient, 'amount': 100}],
1, DEFAULT_FEE, 'AllowFullyTransparent'),
1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent'),
)
self.sync_all()
@ -97,7 +97,7 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
self.nodes[3].z_sendmany(
'ANY_TADDR',
[{'address': recipient, 'amount': 20}],
1, DEFAULT_FEE, 'AllowFullyTransparent'),
1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent'),
)
self.sync_all()
@ -111,7 +111,7 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
myopid = self.nodes[3].z_sendmany(
'ANY_TADDR',
[{'address': recipient, 'amount': 20}],
1, DEFAULT_FEE, 'AllowRevealedSenders')
1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[3], myopid, "failed", "Insufficient funds: have 14.99998, need 20.00001; note that coinbase outputs will not be selected if you specify ANY_TADDR, any transparent recipients are included, or if the `privacyPolicy` parameter is not set to `AllowRevealedSenders` or weaker.")
# Create an expired transaction on node 3.
@ -143,7 +143,7 @@ class WalletSendManyAnyTaddr(BitcoinTestFramework):
self.nodes[2].z_sendmany(
'ANY_TADDR',
[{'address': recipient, 'amount': 13}],
1, DEFAULT_FEE, 'AllowRevealedSenders'),
1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders'),
"failed", "Insufficient funds: have 0.00, need 13.00001; note that coinbase outputs will not be selected if you specify ANY_TADDR, any transparent recipients are included, or if the `privacyPolicy` parameter is not set to `AllowRevealedSenders` or weaker.")
if __name__ == '__main__':

View File

@ -7,7 +7,7 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, initialize_chain_clean, \
start_node, connect_nodes_bi, sync_blocks, sync_mempools, \
wait_and_assert_operationid_status, get_coinbase_address, DEFAULT_FEE, \
wait_and_assert_operationid_status, get_coinbase_address, LEGACY_DEFAULT_FEE, \
NU5_BRANCH_ID, nuparams
from test_framework.zip317 import conventional_fee
@ -170,13 +170,13 @@ class WalletShieldCoinbaseTest (BitcoinTestFramework):
self.nodes[0].generate(200)
self.sync_all()
mytaddr = get_coinbase_address(self.nodes[0], 100)
result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, DEFAULT_FEE, None, 'DEADBEEF')
result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, LEGACY_DEFAULT_FEE, None, 'DEADBEEF')
assert_equal(result["shieldingUTXOs"], Decimal('50'))
assert_equal(result["remainingUTXOs"], Decimal('50'))
wait_and_assert_operationid_status(self.nodes[0], result['opid'])
# Verify maximum number of utxos which node 0 can shield can be set by the limit parameter
result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, DEFAULT_FEE, 33, None)
result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, LEGACY_DEFAULT_FEE, 33, None)
assert_equal(result["shieldingUTXOs"], Decimal('33'))
assert_equal(result["remainingUTXOs"], Decimal('17'))
wait_and_assert_operationid_status(self.nodes[0], result['opid'])

View File

@ -9,7 +9,7 @@ from test_framework.mininode import COIN
from test_framework.util import assert_equal, initialize_chain_clean, \
start_nodes, connect_nodes_bi, wait_and_assert_operationid_status, \
wait_and_assert_operationid_status_result, get_coinbase_address, \
check_node_log, DEFAULT_FEE
check_node_log, LEGACY_DEFAULT_FEE
from test_framework.zip317 import conventional_fee, WEIGHT_RATIO_CAP, ZIP_317_FEE
import sys
@ -106,7 +106,7 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
recipients = []
recipients.append({"address":myzaddr, "amount":Decimal('1.23456789')})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, DEFAULT_FEE, 'AllowFullyTransparent')
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
error_result = wait_and_assert_operationid_status_result(
self.nodes[0],
myopid, "failed",
@ -116,7 +116,7 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
# Test that the returned status object contains a params field with the operation's input parameters
assert_equal(error_result["method"], "z_sendmany")
params = error_result["params"]
assert_equal(params["fee"], DEFAULT_FEE) # default
assert_equal(params["fee"], LEGACY_DEFAULT_FEE) # default
assert_equal(params["minconf"], Decimal('10')) # default
assert_equal(params["fromaddress"], mytaddr)
assert_equal(params["amounts"][0]["address"], myzaddr)
@ -128,10 +128,10 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
# This send will succeed. We send two coinbase utxos totalling 20.0 less a default fee, with no change.
# (This tx fits within the block unpaid action limit.)
shieldvalue = Decimal('20.0') - DEFAULT_FEE
shieldvalue = Decimal('20.0') - LEGACY_DEFAULT_FEE
recipients = []
recipients.append({"address":myzaddr, "amount": shieldvalue})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, DEFAULT_FEE, 'AllowRevealedSenders')
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
@ -210,7 +210,7 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
unshieldvalue = Decimal('10.0')
recipients = []
recipients.append({"address":mytaddr, "amount": unshieldvalue})
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients')
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
assert(mytxid is not None)
@ -219,7 +219,7 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
self.sync_all()
# check balances
saplingvalue -= unshieldvalue + DEFAULT_FEE
saplingvalue -= unshieldvalue + LEGACY_DEFAULT_FEE
resp = self.nodes[0].z_gettotalbalance()
assert_equal(Decimal(resp["transparent"]), Decimal('30.0'))
assert_equal(Decimal(resp["private"]), saplingvalue)
@ -248,7 +248,7 @@ class WalletShieldingCoinbaseTest (BitcoinTestFramework):
recipients.append({"address":self.nodes[1].getnewaddress(), "amount":Decimal('10000.0')})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1)
wait_and_assert_operationid_status(self.nodes[0], myopid, "failed", "Insufficient funds: have 10.00, need 10000.0001; note that coinbase outputs will not be selected if you specify ANY_TADDR, any transparent recipients are included, or if the `privacyPolicy` parameter is not set to `AllowRevealedSenders` or weaker.")
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients')
myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[0], myopid, "failed", "Insufficient funds: have 9.99998, need 10000.00001; note that coinbase outputs will not be selected if you specify ANY_TADDR, any transparent recipients are included, or if the `privacyPolicy` parameter is not set to `AllowRevealedSenders` or weaker.")
# Send will fail because of insufficient funds unless sender uses coinbase utxos

View File

@ -6,7 +6,7 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, initialize_chain_clean, \
start_nodes, connect_nodes_bi, wait_and_assert_operationid_status, \
get_coinbase_address, DEFAULT_FEE
get_coinbase_address, LEGACY_DEFAULT_FEE
from test_framework.zip317 import conventional_fee
import time
@ -46,18 +46,18 @@ class WalletTreeStateTest (BitcoinTestFramework):
# Spend coinbase utxos to create three notes of 10 ZEC minus default fee each
recipients = []
recipients.append({"address": myzaddr, "amount": Decimal('10.0') - DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
recipients.append({"address": myzaddr, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[1].generate(1)
self.sync_all()
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[1].generate(1)
self.sync_all()
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[1].generate(1)
@ -65,7 +65,7 @@ class WalletTreeStateTest (BitcoinTestFramework):
# Check balance
resp = self.nodes[0].z_getbalance(myzaddr)
assert_equal(Decimal(resp), (Decimal('10.0') - DEFAULT_FEE) * 3)
assert_equal(Decimal(resp), (Decimal('10.0') - LEGACY_DEFAULT_FEE) * 3)
# We want to test a real-world situation where during the time spent creating a transaction
# with joinsplits, other transactions containing joinsplits have been mined into new blocks,
@ -73,8 +73,8 @@ class WalletTreeStateTest (BitcoinTestFramework):
# Tx 1 will change the treestate while Tx 2 containing chained joinsplits is still being generated
recipients = []
recipients.append({"address": self.nodes[2].z_getnewaddress(), "amount": Decimal('10.0') - DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
recipients.append({"address": self.nodes[2].z_getnewaddress(), "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE})
myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], myopid)
# Tx 2 will consume all three notes, which must take at least two joinsplits. This is regardless of

View File

@ -6,7 +6,7 @@
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
NU5_BRANCH_ID,
assert_equal,
get_coinbase_address,
@ -43,11 +43,11 @@ class WalletUnifiedChangeTest(BitcoinTestFramework):
# Fund both of ua0_sapling and ua0_orchard
recipients = [{'address': ua0_sapling, 'amount': Decimal('9.99999000')}]
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], opid)
recipients = [{'address': ua0_orchard, 'amount': Decimal('9.99999000')}]
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
wait_and_assert_operationid_status(self.nodes[0], opid)
self.sync_all()
@ -62,11 +62,11 @@ class WalletUnifiedChangeTest(BitcoinTestFramework):
# in account1 having both Sapling and Orchard balances.
recipients = [{'address': ua1_sapling, 'amount': 5}]
opid = self.nodes[0].z_sendmany(ua0_sapling, recipients, 1, DEFAULT_FEE)
opid = self.nodes[0].z_sendmany(ua0_sapling, recipients, 1, LEGACY_DEFAULT_FEE)
txid_sapling = wait_and_assert_operationid_status(self.nodes[0], opid)
recipients = [{'address': ua1, 'amount': 5}]
opid = self.nodes[0].z_sendmany(ua0_orchard, recipients, 1, DEFAULT_FEE)
opid = self.nodes[0].z_sendmany(ua0_orchard, recipients, 1, LEGACY_DEFAULT_FEE)
txid_orchard = wait_and_assert_operationid_status(self.nodes[0], opid)
assert_equal(set([txid_sapling, txid_orchard]), set(self.nodes[0].getrawmempool()))

View File

@ -5,7 +5,7 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
DEFAULT_FEE,
LEGACY_DEFAULT_FEE,
NU5_BRANCH_ID,
assert_equal,
assert_greater_than,
@ -107,14 +107,14 @@ class WalletZSendmanyTest(BitcoinTestFramework):
# send node 2 taddr to zaddr
recipients = []
recipients.append({"address":myzaddr, "amount":7})
opid = self.nodes[2].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowFullyTransparent')
opid = self.nodes[2].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
mytxid = wait_and_assert_operationid_status(self.nodes[2], opid)
self.sync_all()
# check balances
zsendmanynotevalue = Decimal('7.0')
zsendmanyfee = DEFAULT_FEE
zsendmanyfee = LEGACY_DEFAULT_FEE
node2sproutbalance = Decimal('50.00000000')
node2utxobalance = Decimal('210.00000000') - zsendmanynotevalue - zsendmanyfee
@ -160,14 +160,14 @@ class WalletZSendmanyTest(BitcoinTestFramework):
# try sending with a memo to a taddr, which should fail
recipients = [{"address":self.nodes[0].getnewaddress(), "amount":1, "memo":"DEADBEEF"}]
opid = self.nodes[2].z_sendmany(myzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients')
opid = self.nodes[2].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[2], opid, 'failed', 'Failed to build transaction: Memos cannot be sent to transparent addresses.')
recipients = []
recipients.append({"address":self.nodes[0].getnewaddress(), "amount":1})
recipients.append({"address":self.nodes[2].getnewaddress(), "amount":1.0})
opid = self.nodes[2].z_sendmany(myzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients')
opid = self.nodes[2].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[2], opid)
zbalance -= Decimal('2.0') + zsendmanyfee

View File

@ -7,14 +7,14 @@ from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_greater_than, start_nodes,\
initialize_chain_clean, connect_nodes_bi, wait_and_assert_operationid_status, \
DEFAULT_FEE
LEGACY_DEFAULT_FEE
from functools import reduce
import logging
import sys
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO, stream=sys.stdout)
fee = DEFAULT_FEE # constant (but can be changed within reason)
fee = LEGACY_DEFAULT_FEE # constant (but can be changed within reason)
class ZkeyImportExportTest (BitcoinTestFramework):

View File

@ -22,7 +22,7 @@ from decimal import Decimal
from slickrpc import Proxy
from slickrpc.exc import RpcException
DEFAULT_FEE = Decimal('0.00001')
LEGACY_DEFAULT_FEE = Decimal('0.00001')
URL_FAUCET_DONATION = 'https://faucet.testnet.z.cash/donations'
URL_FAUCET_TAP = 'https://faucet.testnet.z.cash/'
@ -382,13 +382,13 @@ def transaction_chain(zcash):
# taddr -> Sapling
# Send it all here because z_sendmany pick a new t-addr for change
sapling_balance = check_z_sendmany(
results, '4f', zcash, taddr_1, [(sapling_zaddr_1, taddr_balance - DEFAULT_FEE)])[0]
results, '4f', zcash, taddr_1, [(sapling_zaddr_1, taddr_balance - LEGACY_DEFAULT_FEE)])[0]
taddr_balance = Decimal('0')
# Sapling -> taddr
taddr_balance = check_z_sendmany(
results, '4i', zcash, sapling_zaddr_1, [(taddr_1, (starting_balance / Decimal('10')) * Decimal('3'))])[0]
sapling_balance -= taddr_balance + DEFAULT_FEE
sapling_balance -= taddr_balance + LEGACY_DEFAULT_FEE
#
# Intra-pool tests
@ -396,13 +396,13 @@ def transaction_chain(zcash):
# Sapling -> same Sapling
sapling_balance = check_z_sendmany(
results, '4g',zcash, sapling_zaddr_1, [(sapling_zaddr_1, sapling_balance - DEFAULT_FEE)])[0]
results, '4g',zcash, sapling_zaddr_1, [(sapling_zaddr_1, sapling_balance - LEGACY_DEFAULT_FEE)])[0]
# taddr -> different taddr
# Sapling -> different Sapling
(taddr_balance, sapling_balance) = check_z_sendmany_parallel(results, zcash, [
('4e', taddr_1, [(taddr_2, taddr_balance - DEFAULT_FEE)]),
('4h', sapling_zaddr_1, [(sapling_zaddr_2, sapling_balance - DEFAULT_FEE)]),
('4e', taddr_1, [(taddr_2, taddr_balance - LEGACY_DEFAULT_FEE)]),
('4h', sapling_zaddr_1, [(sapling_zaddr_2, sapling_balance - LEGACY_DEFAULT_FEE)]),
])
# taddr -> multiple taddr
@ -410,7 +410,7 @@ def transaction_chain(zcash):
check_z_sendmany_parallel(results, zcash, [
('4p', taddr_2, [
(taddr_1, starting_balance / Decimal('10')),
(taddr_3, taddr_balance - (starting_balance / Decimal('10')) - DEFAULT_FEE),
(taddr_3, taddr_balance - (starting_balance / Decimal('10')) - LEGACY_DEFAULT_FEE),
]),
('4t', sapling_zaddr_2, [
(sapling_zaddr_1, starting_balance / Decimal('10')),
@ -418,17 +418,17 @@ def transaction_chain(zcash):
]),
])
taddr_balance -= DEFAULT_FEE
sapling_balance -= DEFAULT_FEE
taddr_balance -= LEGACY_DEFAULT_FEE
sapling_balance -= LEGACY_DEFAULT_FEE
# multiple Sapling -> Sapling
# multiple taddr -> taddr
check_z_mergetoaddress_parallel(results, zcash, [
('4gg', [sapling_zaddr_1, sapling_zaddr_3], sapling_zaddr_2, sapling_balance - DEFAULT_FEE),
('', [taddr_1, taddr_3], taddr_2, taddr_balance - DEFAULT_FEE),
('4gg', [sapling_zaddr_1, sapling_zaddr_3], sapling_zaddr_2, sapling_balance - LEGACY_DEFAULT_FEE),
('', [taddr_1, taddr_3], taddr_2, taddr_balance - LEGACY_DEFAULT_FEE),
])
sapling_balance -= DEFAULT_FEE
taddr_balance -= DEFAULT_FEE
sapling_balance -= LEGACY_DEFAULT_FEE
taddr_balance -= LEGACY_DEFAULT_FEE
taddr_2_balance = taddr_balance
#
@ -441,13 +441,13 @@ def transaction_chain(zcash):
(taddr_3, starting_balance / Decimal('10')),
(sapling_zaddr_1, starting_balance / Decimal('10'))])[0]
sapling_balance -= (starting_balance / Decimal('10')) + DEFAULT_FEE
sapling_balance -= (starting_balance / Decimal('10')) + LEGACY_DEFAULT_FEE
taddr_balance += starting_balance / Decimal('10')
# taddr and Sapling -> Sapling
check_z_mergetoaddress(results, '4ee', zcash, [taddr_3, sapling_zaddr_1], sapling_zaddr_2, sapling_balance + (starting_balance / Decimal('10')) - DEFAULT_FEE)
check_z_mergetoaddress(results, '4ee', zcash, [taddr_3, sapling_zaddr_1], sapling_zaddr_2, sapling_balance + (starting_balance / Decimal('10')) - LEGACY_DEFAULT_FEE)
sapling_balance += (starting_balance / Decimal('10')) - DEFAULT_FEE
sapling_balance += (starting_balance / Decimal('10')) - LEGACY_DEFAULT_FEE
taddr_balance -= starting_balance / Decimal('10')
# Sapling -> multiple taddr
@ -455,37 +455,37 @@ def transaction_chain(zcash):
(taddr_4, (starting_balance / Decimal('10'))),
(taddr_5, (starting_balance / Decimal('10')))])[0]
sapling_balance -= ((starting_balance / Decimal('10')) * Decimal('2')) + DEFAULT_FEE
sapling_balance -= ((starting_balance / Decimal('10')) * Decimal('2')) + LEGACY_DEFAULT_FEE
taddr_balance += (starting_balance / Decimal('10')) * Decimal('2')
# multiple taddr -> Sapling
check_z_mergetoaddress(results, '4bb',zcash, [taddr_4, taddr_5], sapling_zaddr_2, sapling_balance + ((starting_balance / Decimal('10')) * Decimal('2')) - DEFAULT_FEE)
sapling_balance += ((starting_balance / Decimal('10')) * Decimal('2')) - DEFAULT_FEE
check_z_mergetoaddress(results, '4bb',zcash, [taddr_4, taddr_5], sapling_zaddr_2, sapling_balance + ((starting_balance / Decimal('10')) * Decimal('2')) - LEGACY_DEFAULT_FEE)
sapling_balance += ((starting_balance / Decimal('10')) * Decimal('2')) - LEGACY_DEFAULT_FEE
taddr_balance -= (starting_balance / Decimal('10')) * Decimal('2')
# multiple Sapling -> taddr
check_z_mergetoaddress(None, '', zcash, [sapling_zaddr_1, sapling_zaddr_2, sapling_zaddr_3], taddr_2, taddr_2_balance + sapling_balance - DEFAULT_FEE)
taddr_balance += sapling_balance - DEFAULT_FEE
check_z_mergetoaddress(None, '', zcash, [sapling_zaddr_1, sapling_zaddr_2, sapling_zaddr_3], taddr_2, taddr_2_balance + sapling_balance - LEGACY_DEFAULT_FEE)
taddr_balance += sapling_balance - LEGACY_DEFAULT_FEE
sapling_balance = Decimal('0')
# taddr -> multiple Sapling
taddr_2_balance = Decimal(zcash.z_getbalance(taddr_2)).quantize(Decimal('1.00000000'))
check_z_sendmany(results, '4r', zcash, taddr_2, [
(sapling_zaddr_1, (starting_balance / Decimal('10'))),
(sapling_zaddr_2, taddr_2_balance - (starting_balance / Decimal('10')) - DEFAULT_FEE)])[0]
(sapling_zaddr_2, taddr_2_balance - (starting_balance / Decimal('10')) - LEGACY_DEFAULT_FEE)])[0]
sapling_balance = taddr_2_balance - DEFAULT_FEE
sapling_balance = taddr_2_balance - LEGACY_DEFAULT_FEE
taddr_balance -= taddr_2_balance
# multiple Sapling -> taddr
check_z_mergetoaddress(None, '', zcash, [sapling_zaddr_1, sapling_zaddr_2], taddr_2, sapling_balance - DEFAULT_FEE)
taddr_balance += sapling_balance - DEFAULT_FEE
check_z_mergetoaddress(None, '', zcash, [sapling_zaddr_1, sapling_zaddr_2], taddr_2, sapling_balance - LEGACY_DEFAULT_FEE)
taddr_balance += sapling_balance - LEGACY_DEFAULT_FEE
sapling_balance = Decimal('0')
# z_mergetoaddress taddr -> Sapling
taddr_2_balance = Decimal(zcash.z_getbalance(taddr_2)).quantize(Decimal('1.00000000'))
check_z_mergetoaddress(results, '4cc', zcash, [taddr_2], sapling_zaddr_1, taddr_2_balance - DEFAULT_FEE)
sapling_balance = taddr_2_balance - DEFAULT_FEE
check_z_mergetoaddress(results, '4cc', zcash, [taddr_2], sapling_zaddr_1, taddr_2_balance - LEGACY_DEFAULT_FEE)
sapling_balance = taddr_2_balance - LEGACY_DEFAULT_FEE
taddr_balance -= taddr_2_balance
except Exception as e:
print('Error: %s' % e)
@ -515,7 +515,7 @@ def transaction_chain(zcash):
for addr in all_addrs:
balance = Decimal(zcash.z_getbalance(addr)).quantize(Decimal('1.00000000'))
if balance > 0:
z_sendmany(None, '', zcash, addr, [(chain_end, balance - DEFAULT_FEE)])
z_sendmany(None, '', zcash, addr, [(chain_end, balance - LEGACY_DEFAULT_FEE)])
return results

View File

@ -23,7 +23,7 @@ CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize)
CAmount CFeeRate::GetFeeForRelay(size_t nSize) const
{
return std::min(GetFee(nSize), DEFAULT_FEE);
return std::min(GetFee(nSize), LEGACY_DEFAULT_FEE);
}
CAmount CFeeRate::GetFee(size_t nSize) const

View File

@ -33,7 +33,7 @@ static const CAmount MAX_MONEY = 21000000 * COIN;
inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
/** The legacy default fee that was defined in ZIP 313. */
static const CAmount DEFAULT_FEE = 1000;
static const CAmount LEGACY_DEFAULT_FEE = 1000;
/** Type-safe wrapper class to for fee rates
* (how much to pay based on transaction size)

View File

@ -1937,7 +1937,7 @@ bool AcceptToMemoryPool(
// No transactions are allowed with modified fee below the minimum relay fee,
// except from disconnected blocks. The minimum relay fee will never be more
// than DEFAULT_FEE zatoshis.
// than LEGACY_DEFAULT_FEE zatoshis.
CAmount minRelayFee = ::minRelayTxFee.GetFeeForRelay(nSize);
if (fLimitFree && nModifiedFees < minRelayFee) {
LogPrint("mempool",

View File

@ -67,8 +67,8 @@ static const unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCRIPT_
* zcashd v1.0.7-1 (#2141). The relaying problem for shielded transactions (#1969)
* that prompted the latter change was fixed more thoroughly by the addition of
* `CFeeRate::GetFeeForRelay` in #4916, ensuring that a transaction paying
* `DEFAULT_FEE` can always be relayed. At the same time the default fee was set
* to 1000 zats, per ZIP 313.
* `LEGACY_DEFAULT_FEE` can always be relayed. At the same time the default fee was
* set to 1000 zats, per ZIP 313.
*
* #6542 changed relaying policy to be more strict about enforcing minRelayTxFee.
* It also allowed `-minrelaytxfee=0`, which we are using to avoid some test

View File

@ -261,7 +261,7 @@ private:
const CCoinsViewCache* coinsView;
CCriticalSection* cs_coinsView;
CMutableTransaction mtx;
CAmount fee = DEFAULT_FEE;
CAmount fee = LEGACY_DEFAULT_FEE;
std::optional<uint256> orchardAnchor;
std::optional<orchard::Builder> orchardBuilder;
CAmount valueBalanceOrchard = 0;

View File

@ -114,7 +114,7 @@ bool AsyncRPCOperation_saplingmigration::main_impl() {
CAmount amountToSend = chooseAmount(availableFunds);
auto builder = TransactionBuilder(consensusParams, targetHeight_, std::nullopt, pwalletMain, &coinsView, &cs_main);
builder.SetExpiryHeight(targetHeight_ + MIGRATION_EXPIRY_DELTA);
LogPrint("zrpcunsafe", "%s: Beginning creating transaction with Sapling output amount=%s\n", getId(), FormatMoney(amountToSend - DEFAULT_FEE));
LogPrint("zrpcunsafe", "%s: Beginning creating transaction with Sapling output amount=%s\n", getId(), FormatMoney(amountToSend - LEGACY_DEFAULT_FEE));
std::vector<SproutNoteEntry> fromNotes;
CAmount fromNoteAmount = 0;
while (fromNoteAmount < amountToSend) {
@ -155,8 +155,8 @@ bool AsyncRPCOperation_saplingmigration::main_impl() {
assert(changeAddr.has_value());
// The amount chosen *includes* the default fee for this transaction, i.e.
// the value of the Sapling output will be 0.00001 ZEC less.
builder.SetFee(DEFAULT_FEE);
builder.AddSaplingOutput(ovkForShieldingFromTaddr(seed), migrationDestAddress, amountToSend - DEFAULT_FEE);
builder.SetFee(LEGACY_DEFAULT_FEE);
builder.AddSaplingOutput(ovkForShieldingFromTaddr(seed), migrationDestAddress, amountToSend - LEGACY_DEFAULT_FEE);
builder.SendChangeToSprout(changeAddr.value());
CTransaction tx = builder.Build().GetTxOrThrow();
if (isCancelled()) {
@ -166,7 +166,7 @@ bool AsyncRPCOperation_saplingmigration::main_impl() {
pwalletMain->AddPendingSaplingMigrationTx(tx);
LogPrint("zrpcunsafe", "%s: Added pending migration transaction with txid=%s\n", getId(), tx.GetHash().ToString());
++numTxCreated;
amountMigrated += amountToSend - DEFAULT_FEE;
amountMigrated += amountToSend - LEGACY_DEFAULT_FEE;
migrationTxIds.push_back(tx.GetHash().ToString());
} while (numTxCreated < 5 && availableFunds > CENT);