Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc_mining_basic.py
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# them are covered in mining_basic.py | # them are covered in mining_basic.py | ||||
assert_equal(node.getmempoolinfo()['size'], 0) | assert_equal(node.getmempoolinfo()['size'], 0) | ||||
assert_getblocktemplate({ | assert_getblocktemplate({ | ||||
# Although the coinbase value need not necessarily be the same as | # Although the coinbase value need not necessarily be the same as | ||||
# the last block due to halvings and fees, we know this to be true | # the last block due to halvings and fees, we know this to be true | ||||
# since we are not crossing a halving boundary and there are no | # since we are not crossing a halving boundary and there are no | ||||
# transactions in the mempool. | # transactions in the mempool. | ||||
'coinbasevalue': block_reward * COIN, | 'coinbasevalue': block_reward * COIN, | ||||
'mintime': AXION_ACTIVATION_TIME + 1, | |||||
}) | }) | ||||
# First block with the new rules | # First block with the new rules | ||||
node.generatetoaddress(1, address) | node.generatetoaddress(1, address) | ||||
# We expect the coinbase to have multiple outputs now | # We expect the coinbase to have multiple outputs now | ||||
coinbase = get_best_coinbase() | coinbase = get_best_coinbase() | ||||
assert_greater_than_or_equal(len(coinbase['vout']), 2) | assert_greater_than_or_equal(len(coinbase['vout']), 2) | ||||
total = Decimal() | total = Decimal() | ||||
for o in coinbase['vout']: | for o in coinbase['vout']: | ||||
total += o['value'] | total += o['value'] | ||||
assert_equal(total, block_reward) | assert_equal(total, block_reward) | ||||
assert_getblocktemplate({ | assert_getblocktemplate({ | ||||
# Again, we assume the coinbase value is the same as prior blocks. | # Again, we assume the coinbase value is the same as prior blocks. | ||||
'coinbasevalue': block_reward * COIN, | 'coinbasevalue': block_reward * COIN, | ||||
'mintime': AXION_ACTIVATION_TIME + 1, | |||||
}) | |||||
# Move MTP forward | |||||
node.setmocktime(AXION_ACTIVATION_TIME + 1) | |||||
node.generatetoaddress(6, address) | |||||
assert_getblocktemplate({ | |||||
'coinbasevalue': block_reward * COIN, | |||||
'mintime': AXION_ACTIVATION_TIME + 2, | |||||
}) | }) | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
AbcMiningRPCTest().main() | AbcMiningRPCTest().main() |