Fixed functional test cases.

This commit is contained in:
Just Wonder 2020-06-19 22:24:29 -07:00
parent 9ad1e217b5
commit f175979d91
4 changed files with 15 additions and 3 deletions

View File

@ -303,7 +303,7 @@ public:
consensus.BIP34Hash = uint256();
consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in rpc activation tests)
consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in rpc activation tests)
consensus.RandomXHeight = 20; // RandomxX acticated on regtest.
consensus.RandomXHeight = 2000000; // RandomX acticated on regtest.
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.nPowTargetTimespan = 2.0 * 60; // Two minutes
consensus.nPowTargetSpacing = 2.0 * 60; // Two minutes

View File

@ -627,6 +627,10 @@ class FullBlockTest(ComparisonTestFramework):
b44.nBits = 0x207fffff
b44.vtx.append(coinbase)
b44.hashMerkleRoot = b44.calc_merkle_root()
b44.merkle_root = uint256_from_str(bytes.fromhex("3cf6c3b6da3f4058853ee70369ee43d473aca91ae8fc8f44a645beb21c392d80"))
b44.nNonce = height
b44.major_version = 10 # CN variant 4
b44.timestamp = b44.nTime
b44.solve()
self.tip = b44
self.block_heights[b44.sha256] = height
@ -642,6 +646,10 @@ class FullBlockTest(ComparisonTestFramework):
b45.nBits = 0x207fffff
b45.vtx.append(non_coinbase)
b45.hashMerkleRoot = b45.calc_merkle_root()
b45.merkle_root = uint256_from_str(bytes.fromhex("3cf6c3b6da3f4058853ee70369ee43d473aca91ae8fc8f44a645beb21c392d80"))
b45.nNonce = height
b45.major_version = 10 # CN variant 4
b45.timestamp = b45.nTime
b45.calc_sha256()
b45.solve()
self.block_heights[b45.sha256] = self.block_heights[self.tip.sha256]+1
@ -658,6 +666,10 @@ class FullBlockTest(ComparisonTestFramework):
b46.nBits = 0x207fffff
b46.vtx = []
b46.hashMerkleRoot = 0
b46.merkle_root = uint256_from_str(bytes.fromhex("3cf6c3b6da3f4058853ee70369ee43d473aca91ae8fc8f44a645beb21c392d80"))
b46.nNonce = height
b46.major_version = 10 # CN variant 4
b46.timestamp = b45.nTime
b46.solve()
self.block_heights[b46.sha256] = self.block_heights[b44.sha256]+1
self.tip = b46

View File

@ -23,7 +23,7 @@ import socket
import struct
import time
import pycryptonight
import pycryptonight # pip3 install py-cryptonight
from test_framework.siphash import siphash256
from test_framework.util import hex_str_to_bytes, bytes_to_hex_str

View File

@ -330,7 +330,7 @@ class BitcoinTestFramework():
For backwared compatibility of the python scripts with previous
versions of the cache, this helper function sets mocktime to Jan 1,
2014 + (201 * 10 * 60)"""
self.mocktime = 1388534400 + (201 * 10 * 60)
self.mocktime = 1582959692 + (201 * 10 * 60)
def disable_mocktime(self):
self.mocktime = 0