aboutsummaryrefslogtreecommitdiff
path: root/test/functional/rpc_blockchain.py
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-10-05 16:58:18 +0200
committerMacroFake <falke.marco@gmail.com>2022-10-20 14:45:50 +0200
commitfafc96aaf4c92feec50074e34a3fc1edc13cab4c (patch)
treeeff20532ee10475f4528153112ea2504a48ddc9f /test/functional/rpc_blockchain.py
parenta97791d9fb977cf2a0d19268253238b0fee173f6 (diff)
downloadbitcoin-fafc96aaf4c92feec50074e34a3fc1edc13cab4c.tar.xz
test: Test year 2106 block timestamps
* Use maximum timestamp in getblocktemplate test * Mine block with maximum timestamp and MTP in blockchain test
Diffstat (limited to 'test/functional/rpc_blockchain.py')
-rwxr-xr-xtest/functional/rpc_blockchain.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py
index d07d28879e..80e8fe55a3 100755
--- a/test/functional/rpc_blockchain.py
+++ b/test/functional/rpc_blockchain.py
@@ -89,6 +89,7 @@ class BlockchainTest(BitcoinTestFramework):
self._test_waitforblockheight()
self._test_getblock()
self._test_getdeploymentinfo()
+ self._test_y2106()
assert self.nodes[0].verifychain(4, 0)
def mine_chain(self):
@@ -255,6 +256,14 @@ class BlockchainTest(BitcoinTestFramework):
# calling with an explicit hash works
self.check_signalling_deploymentinfo_result(self.nodes[0].getdeploymentinfo(gbci207["bestblockhash"]), gbci207["blocks"], gbci207["bestblockhash"], "started")
+ def _test_y2106(self):
+ self.log.info("Check that block timestamps work until year 2106")
+ self.generate(self.nodes[0], 8)[-1]
+ time_2106 = 2**32 - 1
+ self.nodes[0].setmocktime(time_2106)
+ last = self.generate(self.nodes[0], 6)[-1]
+ assert_equal(self.nodes[0].getblockheader(last)["mediantime"], time_2106)
+
def _test_getchaintxstats(self):
self.log.info("Test getchaintxstats")