(self, node, txs, *, with_witness=False, accept)
| 121 | self.block_submit(self.nodes[0], test6txs, with_witness=True, accept=True) |
| 122 | |
| 123 | def block_submit(self, node, txs, *, with_witness=False, accept): |
| 124 | tmpl = node.getblocktemplate(NORMAL_GBT_REQUEST_PARAMS) |
| 125 | assert_equal(tmpl['previousblockhash'], self.lastblockhash) |
| 126 | assert_equal(tmpl['height'], self.lastblockheight + 1) |
| 127 | block = create_block(tmpl=tmpl, ntime=self.lastblocktime + 1, txlist=txs) |
| 128 | if with_witness: |
| 129 | add_witness_commitment(block) |
| 130 | block.solve() |
| 131 | assert_equal(None if accept else NULLDUMMY_ERROR, node.submitblock(block.serialize().hex())) |
| 132 | if accept: |
| 133 | assert_equal(node.getbestblockhash(), block.hash) |
| 134 | self.lastblockhash = block.hash |
| 135 | self.lastblocktime += 1 |
| 136 | self.lastblockheight += 1 |
| 137 | else: |
| 138 | assert_equal(node.getbestblockhash(), self.lastblockhash) |
| 139 | |
| 140 | |
| 141 | if __name__ == '__main__': |
no test coverage detected