Skip to content

Commit

Permalink
Add RPC test and test framework constants for Sapling->Blossom activa…
Browse files Browse the repository at this point in the history
…tion.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
  • Loading branch information
daira committed Aug 16, 2019
1 parent cfdf040 commit f58bc7b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
19 changes: 15 additions & 4 deletions qa/rpc-tests/mempool_nu_activation.py
Expand Up @@ -6,9 +6,11 @@
import sys; assert sys.version_info < (3,), ur"This script does not run under Python 3. Please use Python 2.7.x."

from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, initialize_chain_clean, \
start_node, connect_nodes, wait_and_assert_operationid_status, \
from test_framework.util import (
assert_equal, assert_true, initialize_chain_clean,
start_node, connect_nodes, wait_and_assert_operationid_status,
get_coinbase_address
)
from test_framework.authproxy import JSONRPCException

from decimal import Decimal
Expand All @@ -22,6 +24,7 @@ def setup_network(self):
args = ["-checkmempool", "-debug=mempool", "-blockmaxsize=4000",
"-nuparams=5ba81b19:200", # Overwinter
"-nuparams=76b809bb:210", # Sapling
"-nuparams=2bb40e60:220", # Blossom
]
self.nodes = []
self.nodes.append(start_node(0, self.options.tmpdir, args))
Expand Down Expand Up @@ -72,10 +75,10 @@ def nu_activation_checks():
while self.nodes[1].getmempoolinfo()['bytes'] < 2 * 4000:
try:
x_txids.append(self.nodes[1].sendtoaddress(node0_taddr, Decimal('0.001')))
assert_equal(chaintip_branchid, "00000000")
except JSONRPCException:
# This fails due to expiring soon threshold, which applies from Overwinter onwards.
assert_equal(info["upgrades"][chaintip_branchid]["name"], "Overwinter")
upgrade_name = info["upgrades"][chaintip_branchid]["name"]
assert_true(upgrade_name in ("Overwinter", "Sapling"), upgrade_name)
break
self.sync_all()

Expand Down Expand Up @@ -156,5 +159,13 @@ def nu_activation_checks():
nu_activation_checks()
# Current height = 215

self.nodes[0].generate(2)
self.sync_all()

print('Testing Sapling -> Blossom activation boundary')
# Current height = 217
nu_activation_checks()
# Current height = 225

if __name__ == '__main__':
MempoolUpgradeActivationTest().main()
13 changes: 12 additions & 1 deletion qa/rpc-tests/test_framework/mininode.py
Expand Up @@ -39,13 +39,24 @@
zcash_person,
)

OVERWINTER_PROTO_VERSION = 170003
BIP0031_VERSION = 60000
SPROUT_PROTO_VERSION = 170002 # past bip-31 for ping/pong
OVERWINTER_PROTO_VERSION = 170003
SAPLING_PROTO_VERSION = 170006
BLOSSOM_TESTNET_PROTO_VERSION = 170007
BLOSSOM_PROTO_VERSION = 170008

MY_SUBVERSION = "/python-mininode-tester:0.0.1/"

SPROUT_VERSION_GROUP_ID = 0x00000000
OVERWINTER_VERSION_GROUP_ID = 0x03C48270
SAPLING_VERSION_GROUP_ID = 0x892F2085
# No transaction format change in Blossom.

SPROUT_BRANCH_ID = 0x00000000
OVERWINTER_BRANCH_ID = 0x5BA81B19
SAPLING_BRANCH_ID = 0x76B809BB
BLOSSOM_BRANCH_ID = 0x2BB40E60

MAX_INV_SZ = 50000

Expand Down

0 comments on commit f58bc7b

Please sign in to comment.