def METHOD_NAME(self):
    self.coinbase_blocks = self.nodes[0].generate(1)
    self.nodes[0].generate(100)
    height = 102  # height of the next block to build
    hashTip = self.nodes[0].getbestblockhash()
    hashFinalSaplingRoot = int("0x" + self.nodes[0].getblock(hashTip)['finalsaplingroot'], 0)
    self.tip = int("0x"+hashTip , 0)
    self.nodeaddress = self.nodes[0].getnewaddress()
    '''Check that the rules are enforced.'''
    for valid in (True, False):
        spendtx = self.create_transaction(self.nodes[0],
                                          self.coinbase_blocks[0],
                                          self.nodeaddress, 1.0)
        if not valid:
            self.invalidate_transaction(spendtx)
            spendtx.rehash()
        gbt = self.nodes[0].getblocktemplate()
        self.block_time = gbt["mintime"] + 1
        self.block_bits = int("0x" + gbt["bits"], 0)
        block = create_block(self.tip, create_coinbase(height),
                             self.block_time, self.block_bits,
                             hashFinalSaplingRoot)
        block.nVersion = 4
        block.vtx.append(spendtx)
        block.hashMerkleRoot = block.calc_merkle_root()
        block.rehash()
        block.solve()
        self.tip = block.sha256
        yield TestInstance([[block, valid]])