mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 19:37:27 -03:00
test: refactor: Replace SetHex with uint256 constructor directly
This avoids a hex-decoding and makes the next commit smaller.
This commit is contained in:
parent
7cc00bfc86
commit
fafe4b8051
1 changed files with 3 additions and 3 deletions
|
@ -86,7 +86,7 @@ BOOST_AUTO_TEST_CASE(CheckProofOfWork_test_negative_target)
|
|||
uint256 hash;
|
||||
unsigned int nBits;
|
||||
nBits = UintToArith256(consensus.powLimit).GetCompact(true);
|
||||
hash.SetHex("0x1");
|
||||
hash = uint256{1};
|
||||
BOOST_CHECK(!CheckProofOfWork(hash, nBits, consensus));
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ BOOST_AUTO_TEST_CASE(CheckProofOfWork_test_overflow_target)
|
|||
const auto consensus = CreateChainParams(*m_node.args, ChainType::MAIN)->GetConsensus();
|
||||
uint256 hash;
|
||||
unsigned int nBits{~0x00800000U};
|
||||
hash.SetHex("0x1");
|
||||
hash = uint256{1};
|
||||
BOOST_CHECK(!CheckProofOfWork(hash, nBits, consensus));
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ BOOST_AUTO_TEST_CASE(CheckProofOfWork_test_too_easy_target)
|
|||
arith_uint256 nBits_arith = UintToArith256(consensus.powLimit);
|
||||
nBits_arith *= 2;
|
||||
nBits = nBits_arith.GetCompact();
|
||||
hash.SetHex("0x1");
|
||||
hash = uint256{1};
|
||||
BOOST_CHECK(!CheckProofOfWork(hash, nBits, consensus));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue