MCPcopy Create free account
hub / github.com/ElementsProject/elements / run_test

Method run_test

test/functional/feature_blocksign.py:180–222  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

178 self.mine_block(transactions)
179
180 def run_test(self):
181 # Have every node except last import its block signing private key.
182 for i in range(self.num_keys):
183 self.nodes[i].importprivkey(self.wifs[i])
184
185 self.check_height(0)
186
187 # mine a block with no transactions
188 self.log.info("Mining and signing 101 blocks to unlock funds")
189 self.mine_blocks(101, False)
190
191 # mine blocks with transactions
192 self.log.info("Mining and signing non-empty blocks")
193 self.mine_blocks(10, True)
194
195 # Height check also makes sure non-signing, p2p connected node gets block
196 self.check_height(111)
197
198 # signblock rpc field stuff
199 tip = self.nodes[0].getblockhash(self.nodes[0].getblockcount())
200 header = self.nodes[0].getblockheader(tip)
201 block = self.nodes[0].getblock(tip)
202 info = self.nodes[0].getdeploymentinfo()
203
204 assert 'signblock_witness_asm' in header
205 assert 'signblock_witness_hex' in header
206 assert 'signblock_witness_asm' in block
207 assert 'signblock_witness_hex' in block
208
209 assert_equal(info['deployments']['dynafed']['bip9']['status'], "defined")
210
211 # Next let's activate dynafed
212 blocks_til_dynafed = 431 - self.nodes[0].getblockcount()
213 self.log.info("Activating dynafed")
214 self.mine_blocks(blocks_til_dynafed, False)
215 self.check_height(111+blocks_til_dynafed)
216
217 assert_equal(self.nodes[0].getdeploymentinfo()['deployments']['dynafed']['bip9']['status'], "locked_in")
218
219 self.log.info("Mine some dynamic federation blocks without txns")
220 self.mine_blocks(10, False)
221 self.log.info("Mine some dynamic federation blocks with txns")
222 self.mine_blocks(10, True)
223
224if __name__ == '__main__':
225 BlockSignTest().main()

Callers

nothing calls this directly

Calls 5

check_heightMethod · 0.95
mine_blocksMethod · 0.95
assert_equalFunction · 0.90
importprivkeyMethod · 0.80
infoMethod · 0.80

Tested by

no test coverage detected