@@ -18,6 +18,7 @@ class SimplicityActivationTest(BitcoinTestFramework):
18
18
def set_test_params (self ):
19
19
self .setup_clean_chain = True
20
20
self .num_nodes = 1
21
+ self .extra_args = [["-evbparams=dynafed:0:::" ]]
21
22
22
23
def skip_test_if_missing_module (self ):
23
24
self .skip_if_no_wallet ()
@@ -36,8 +37,8 @@ def test_activation(self, rpc, activation_height):
36
37
if n < 143 :
37
38
assert_equal (decode ["versionHex" ], "20000000" )
38
39
elif n < 431 :
39
- # TESTDUMMY deployment: 144 blocks active, 144 blocks locked in
40
- assert_equal (decode ["versionHex" ], "30000000 " )
40
+ # TESTDUMMY and DYNAFED deployment: 144 blocks active, 144 blocks locked in
41
+ assert_equal (decode ["versionHex" ], "32000000 " )
41
42
else :
42
43
assert_equal (decode ["versionHex" ], "20000000" )
43
44
@@ -52,38 +53,38 @@ def test_activation(self, rpc, activation_height):
52
53
blocks = self .generatetoaddress (rpc , 127 , rpc .getnewaddress ())
53
54
for n , block in enumerate (blocks ):
54
55
decode = rpc .getblockheader (block )
55
- assert_equal (decode ["versionHex" ], "21000000 " )
56
+ assert_equal (decode ["versionHex" ], "20200000 " )
56
57
assert_equal (rpc .getdeploymentinfo ()["deployments" ]["simplicity" ]["bip9" ]["status" ], "started" )
57
58
58
59
# Fail to signal on the 128th block. Since the threshold for Simplicity is
59
60
# 100% this will prevent activation. Note that our period is 128, not
60
61
# 144 (the default), as we have overridden the period for Simplicity. On
61
62
# the main Liquid chain it is overridden to be one week of signalling.
62
63
block = rpc .getnewblockhex ()
63
- block = block [:7 ] + "0" + block [8 :] # turn off Simplicity signal
64
+ block = block [:4 ] + "0" + block [5 :] # turn off Simplicity signal
64
65
rpc .submitblock (block )
65
66
assert_equal (rpc .getdeploymentinfo ()["deployments" ]["simplicity" ]["bip9" ]["status" ], "started" )
66
67
67
68
# Run through another 128 blocks, without failing to signal
68
69
blocks = self .generatetoaddress (rpc , 127 , rpc .getnewaddress ())
69
70
for n , block in enumerate (blocks ):
70
71
decode = rpc .getblockheader (block )
71
- assert_equal (decode ["versionHex" ], "21000000 " )
72
+ assert_equal (decode ["versionHex" ], "20200000 " )
72
73
assert_equal (rpc .getdeploymentinfo ()["deployments" ]["simplicity" ]["bip9" ]["status" ], "started" )
73
74
# The 128th block then switches from "started" to "locked_in"
74
75
blocks = self .generatetoaddress (rpc , 1 , rpc .getnewaddress ())
75
76
assert_equal (rpc .getdeploymentinfo ()["deployments" ]["simplicity" ]["bip9" ]["status" ], "started" )
76
77
assert_equal (rpc .getdeploymentinfo ()["deployments" ]["simplicity" ]["bip9" ]["status_next" ], "locked_in" )
77
- assert_equal (rpc .getblockheader (blocks [0 ])["versionHex" ], "21000000 " )
78
+ assert_equal (rpc .getblockheader (blocks [0 ])["versionHex" ], "20200000 " )
78
79
79
80
# Run through another 128 blocks, which will go from "locked in" to "active" regardless of signalling
80
81
blocks = self .generatetoaddress (rpc , 127 , rpc .getnewaddress ())
81
82
for n , block in enumerate (blocks ):
82
83
decode = rpc .getblockheader (block )
83
- assert_equal (decode ["versionHex" ], "21000000 " )
84
+ assert_equal (decode ["versionHex" ], "20200000 " )
84
85
assert_equal (rpc .getdeploymentinfo ()["deployments" ]["simplicity" ]["bip9" ]["status" ], "locked_in" )
85
86
block = rpc .getnewblockhex ()
86
- block = block [:7 ] + "0" + block [8 :] # turn off Simplicity signal
87
+ block = block [:4 ] + "0" + block [5 :] # turn off Simplicity signal
87
88
rpc .submitblock (block )
88
89
assert_equal (rpc .getdeploymentinfo ()["deployments" ]["simplicity" ]["bip9" ]["status" ], "locked_in" )
89
90
assert_equal (rpc .getdeploymentinfo ()["deployments" ]["simplicity" ]["bip9" ]["status_next" ], "active" )
@@ -103,15 +104,15 @@ def run_test(self):
103
104
if n < 143 :
104
105
assert_equal (decode ["versionHex" ], "20000000" )
105
106
elif n < 431 :
106
- # TESTDUMMY deployment: 144 blocks active, 144 blocks locked in
107
- assert_equal (decode ["versionHex" ], "30000000 " )
107
+ # TESTDUMMY and DYNAFED deployment: 144 blocks active, 144 blocks locked in
108
+ assert_equal (decode ["versionHex" ], "32000000 " )
108
109
else :
109
110
assert_equal (decode ["versionHex" ], "20000000" )
110
111
111
112
# Test activation starting from height 1000
112
113
# Note that for Simplicity this is an illogical combination (Simplicity without
113
114
# Taproot) but for purposes of this test it's fine.
114
- self .restart_node (0 , ["-evbparams=simplicity:500:::" ])
115
+ self .restart_node (0 , ["-evbparams=dynafed:0:::" , "-evbparams= simplicity:500:::" ])
115
116
self .nodes [0 ].invalidateblock (self .nodes [0 ].getblockhash (1 ))
116
117
self .test_activation (self .nodes [0 ], 500 )
117
118
0 commit comments