Skip to content

Commit

Permalink
test: Change test hash values due to BPV updates
Browse files Browse the repository at this point in the history
  • Loading branch information
s2quake committed Oct 8, 2024
1 parent e87d526 commit c045fc8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions test/Libplanet.Tests/Action/ActionEvaluatorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,9 @@ DumbAction MakeAction(Address address, char identifier, Address? transferTo = nu
// have to be updated, since the order may change due to different PreEvaluationHash.
(int TxIdx, int ActionIdx, string[] UpdatedStates, Address Signer)[] expectations =
{
(0, 0, new[] { "A", null, null, null, null }, _txFx.Address1), // Adds "A"
(0, 1, new[] { "A", "B", null, null, null }, _txFx.Address1), // Adds "B"
(1, 0, new[] { "A", "B", "C", null, null }, _txFx.Address2), // Adds "C"
(1, 0, new[] { null, null, "C", null, null }, _txFx.Address2), // Adds "A"
(0, 0, new[] { "A", null, "C", null, null }, _txFx.Address1), // Adds "B"
(0, 1, new[] { "A", "B", "C", null, null }, _txFx.Address1), // Adds "C"
};
Assert.Equal(expectations.Length, evals.Length);
foreach (var (expect, eval) in expectations.Zip(evals, (x, y) => (x, y)))
Expand Down Expand Up @@ -649,9 +649,9 @@ DumbAction MakeAction(Address address, char identifier, Address? transferTo = nu
// have to be updated, since the order may change due to different PreEvaluationHash.
expectations = new (int TxIdx, int ActionIdx, string[] UpdatedStates, Address Signer)[]
{
(0, 0, new[] { "A,D", "B", "C", null, null }, _txFx.Address1), // Adds "D"
(1, 0, new[] { "A,D", "B", "C", "E", null }, _txFx.Address2), // Adds "E"
(2, 0, new[] { "A,D", "B", "C", "E", "F" }, _txFx.Address3), // Adds "F"
(1, 0, new[] { "A", "B", "C", "E", null }, _txFx.Address2), // Adds "D"
(2, 0, new[] { "A", "B", "C", "E", "F" }, _txFx.Address3), // Adds "E"
(0, 0, new[] { "A,D", "B", "C", "E", "F" }, _txFx.Address1), // Adds "F"
};
Assert.Equal(expectations.Length, evals.Length);
foreach (var (expect, eval) in expectations.Zip(evals, (x, y) => (x, y)))
Expand Down
2 changes: 1 addition & 1 deletion test/Libplanet.Tests/Blocks/BlockMetadataTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public void DerivePreEvaluationHash()

HashDigest<SHA256> hash = GenesisMetadata.DerivePreEvaluationHash();
AssertBytesEqual(
FromHex("9ff328716814fed03de454dfc0a9d9aeb0077ad0c393513bf29895a45ded13aa"),
FromHex("4b9d55d06e4db1d693d6843f67b5e818fa819a8f29cde18582631b8c8f6f11cb"),
hash.ByteArray);
}

Expand Down
20 changes: 10 additions & 10 deletions test/Libplanet.Tests/Blocks/PreEvaluationBlockHeaderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ public void VerifySignature()

// Same as block1.MakeSignature(_contents.Block1Key, arbitraryHash)
ImmutableArray<byte> validSig = ByteUtil.ParseHexToImmutable(
"3045022100f975e902971092f16dbbb1fe6b7c956de648a8cd62346dbadc07e5fca4ce3" +
"07a02200987a349f0763efd0448659ed66c6bd0ad0971dd57fbb89c672aed592fbd70d6");
"304402203ed4c76c5196b0fe280ea0235ba05211cfd4a96d2660e2c6883d11ddb49c47" +
"e90220095958c7c019db2bb71e9f5fc857ff6c94c2cfdf8484f08050694451ddfe569c");
AssertBytesEqual(
validSig,
block1.MakeSignature(_contents.Block1Key, arbitraryHash));
Expand Down Expand Up @@ -215,22 +215,22 @@ public void DeriveBlockHash()
_contents.GenesisMetadata,
_contents.GenesisMetadata.DerivePreEvaluationHash());
AssertBytesEqual(
fromHex("d790aa3b2d985d58e6fe6547336ca9d2bfdb749a27cd58a17dbfd0c6880da8e3"),
fromHex("6f8f1d4ca79463e85f56b2927ac4414bd8b0ac86942a2af44fa71ac10c61c3d5"),
genesis.DeriveBlockHash(default, null)
);
AssertBytesEqual(
fromHex("47b5227dfdd99af4faf9ae9e82ef3b615063179d275081eae4c122685bbf7dcb"),
fromHex("59a9d5a9f3de4859f557437f3667f91cda146b6e980bda8cb4f0c1b9eff3bd43"),
genesis.DeriveBlockHash(
default,
genesis.MakeSignature(_contents.GenesisKey, default)
)
);
AssertBytesEqual(
fromHex("2c45bb52e4c7d79caa28da9b63ec0f492262836c975bfa5bb27f62e96f2aad99"),
fromHex("0b5ea8cf0a678075b9438cdf7d0a01bf61ec62c05d9320c597a255f63196f437"),
genesis.DeriveBlockHash(arbitraryHash, null)
);
AssertBytesEqual(
fromHex("e985fcdce3f73dee90a4eaec9399283f856bb6f9326e4300bbe1d6126ff7ad55"),
fromHex("8f8e5bdcbff809c89fcd295adba98c194babacb6ed69639b13cdc1b990b6c8e0"),
genesis.DeriveBlockHash(
arbitraryHash,
genesis.MakeSignature(_contents.GenesisKey, arbitraryHash))
Expand All @@ -240,19 +240,19 @@ public void DeriveBlockHash()
_contents.Block1Metadata,
_contents.Block1Metadata.DerivePreEvaluationHash());
AssertBytesEqual(
fromHex("ade696a646c9e4321cc90160807cba3d15d7cd28556d2dfb4103e8730a46038c"),
fromHex("b15d91c7df2b6e568110dc0e0547e79218645fef159d90ca87ea6d347c814be7"),
block1.DeriveBlockHash(default, null)
);
AssertBytesEqual(
fromHex("b3157a151d2168653e21ffc850f9d1a96bca6310275cccbeb9bd705f67c2e1c9"),
fromHex("de112dcbe27aa0f040ee9dc93c8681bb58b514e52f769f72d60cbaaf203962e8"),
block1.DeriveBlockHash(default, block1.MakeSignature(_contents.Block1Key, default))
);
AssertBytesEqual(
fromHex("3fd4ee37ed2fc5dae5a9533984f06b3975e176bdaa70689a3c14acd8b4ea384d"),
fromHex("1c3481fade04f4f82734f497fcdafb85745134506eacac288acb25f5d989be06"),
block1.DeriveBlockHash(arbitraryHash, null)
);
AssertBytesEqual(
fromHex("83ceb4d1e5bbc385daaebfd044a5e4ba65bf1d8b63ef0aabe4d68fc5642b4516"),
fromHex("37cc2ae1e59e01192d14dc6d09b9d52e4fbc8cdf11db2fa181f000fd2c00b6c1"),
block1.DeriveBlockHash(
arbitraryHash, block1.MakeSignature(_contents.Block1Key, arbitraryHash)
)
Expand Down

0 comments on commit c045fc8

Please sign in to comment.