Changeset View
Changeset View
Standalone View
Standalone View
test/functional/bip68-sequence.py
Show First 20 Lines • Show All 436 Lines • ▼ Show 20 Lines | class BIP68Test(BitcoinTestFramework): | ||||
def activateCSV(self): | def activateCSV(self): | ||||
# activation should happen at block height 576 | # activation should happen at block height 576 | ||||
csv_activation_height = 576 | csv_activation_height = 576 | ||||
height = self.nodes[0].getblockcount() | height = self.nodes[0].getblockcount() | ||||
assert_greater_than(csv_activation_height - height, 1) | assert_greater_than(csv_activation_height - height, 1) | ||||
self.nodes[0].generate(csv_activation_height - height - 1) | self.nodes[0].generate(csv_activation_height - height - 1) | ||||
assert_equal(self.get_csv_status(), False) | assert_equal(self.get_csv_status(), False) | ||||
disconnect_nodes(self.nodes[0], 1) | disconnect_nodes(self.nodes[0], self.nodes[1]) | ||||
self.nodes[0].generate(1) | self.nodes[0].generate(1) | ||||
assert_equal(self.get_csv_status(), True) | assert_equal(self.get_csv_status(), True) | ||||
# We have a block that has CSV activated, but we want to be at | # We have a block that has CSV activated, but we want to be at | ||||
# the activation point, so we invalidate the tip. | # the activation point, so we invalidate the tip. | ||||
self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash()) | self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash()) | ||||
connect_nodes(self.nodes[0], 1) | connect_nodes(self.nodes[0], self.nodes[1]) | ||||
sync_blocks(self.nodes) | sync_blocks(self.nodes) | ||||
# Use self.nodes[1] to test standardness relay policy | # Use self.nodes[1] to test standardness relay policy | ||||
def test_version2_relay(self, before_activation): | def test_version2_relay(self, before_activation): | ||||
inputs = [] | inputs = [] | ||||
outputs = {self.nodes[1].getnewaddress(): 1.0} | outputs = {self.nodes[1].getnewaddress(): 1.0} | ||||
rawtx = self.nodes[1].createrawtransaction(inputs, outputs) | rawtx = self.nodes[1].createrawtransaction(inputs, outputs) | ||||
rawtxfund = self.nodes[1].fundrawtransaction(rawtx)['hex'] | rawtxfund = self.nodes[1].fundrawtransaction(rawtx)['hex'] | ||||
Show All 12 Lines |