Skip to content

Commit

Permalink
Fixed state hash decoding in TxStateSnapshotHashSpec (#3923)
Browse files Browse the repository at this point in the history
  • Loading branch information
phearnot authored Dec 7, 2023
1 parent 033ea1b commit 9f95648
Showing 1 changed file with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,128 +173,128 @@ class TxStateSnapshotHashSpec extends PropSpec {
wavesBalances,
"CiQKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EgYQgJTr3AMKJAoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoSBhCAqNa5Bw==",
ByteStr.empty,
"",
"954bf440a83542e528fe1e650471033e42d97c5896cc571aec39fccc912d7db0"
Hex.toHexString(TxStateSnapshotHashBuilder.InitStateHash.arr),
"f0a8b6745534c2d20412f40cdb097b7050898e44531a661ef64fc5be0744ac72"
),
(
"asset balances",
assetBalances,
"CkMKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EiUKIF5mn4IKZ9CIbYdHjPBDoqx4XMevVdwxzhB1OUvTUKJbEJBOCkQKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEiYKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEKCcAQ==",
ByteStr.empty,
"954bf440a83542e528fe1e650471033e42d97c5896cc571aec39fccc912d7db0",
"534e27c3a787536e18faf844ff217a8f14e5323dfcd3cc5b9ab3a8e261f60cf7"
"f0a8b6745534c2d20412f40cdb097b7050898e44531a661ef64fc5be0744ac72",
"16c4803d12ee8e9d6c705ca6334fd84f57c0e78c4ed8a9a3dc6c28dcd9b29a34"
),
(
"data entries",
dataEntries,
"YloKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EgUKA2ZvbxISCgNiYXJqC1N0cmluZ1ZhbHVlEiEKA2JhemIaAVRg/VDvIN5FcSB9+5yIvnwcL4oixwrYj7ViLwoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoSCAoDZm9vULAJEgcKA2JhclgB",
ByteStr.empty,
"534e27c3a787536e18faf844ff217a8f14e5323dfcd3cc5b9ab3a8e261f60cf7",
"b1440780a268eeaf9f6bb285a97ee35582cb84382576e84432b2e61b86d64581"
"16c4803d12ee8e9d6c705ca6334fd84f57c0e78c4ed8a9a3dc6c28dcd9b29a34",
"d33269372999bfd8f7afdf97e23bc343bcf3812f437e8971681a37d56868ec8a"
),
(
"account script",
accountScript,
"Wi4KIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoEgcGAQaw0U/PGPoB",
ByteStr.empty,
"b1440780a268eeaf9f6bb285a97ee35582cb84382576e84432b2e61b86d64581",
"ca42620b03b437e025bec14152c3f7d8ff65b8fb1062b5013363186484176cb7"
"d33269372999bfd8f7afdf97e23bc343bcf3812f437e8971681a37d56868ec8a",
"dcdf7df91b11fdbeb2d99c4fd64abb4657adfda15eed63b1d4730aa2b6275ee2"
),
(
"asset script",
assetScript,
"QisKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEgcGAQaw0U/P",
ByteStr.empty,
"ca42620b03b437e025bec14152c3f7d8ff65b8fb1062b5013363186484176cb7",
"4e9cbb5349a31d2954d57f67d2fc5cf73dd1ce90b508299cf5f92b1b45ca668f"
"dcdf7df91b11fdbeb2d99c4fd64abb4657adfda15eed63b1d4730aa2b6275ee2",
"d3c7f2aeb1d978ecebc2fe1f0555e4378cef5171db460d8bbfebef0e59c3a44c"
),
(
"new lease",
newLease,
"EiIKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1GICa4uEQEiIKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEICuzb4UGmYKILiCMyyFggW8Zd2LGt/AtMr7WWp+kfWbzlN93pXZqzqNEiBQx1mvQnelVPDNtCyxR82wU73hEX9bBDsNfUlEuNBgaBoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoggPKLqAk=",
ByteStr.empty,
"4e9cbb5349a31d2954d57f67d2fc5cf73dd1ce90b508299cf5f92b1b45ca668f",
"8615df0268bcc76e851a9925e07f212a875a1bd047b0cccbc4ad3d842895f16e"
"d3c7f2aeb1d978ecebc2fe1f0555e4378cef5171db460d8bbfebef0e59c3a44c",
"2665ce187b867f2dae95699882d9fd7c31039c505b8af93ed22cada90524ff37"
),
(
"cancelled lease",
cancelledLease,
"EiIKGgFUMCPLqLW81X2Atgaj2KwF9QkaJq47Cev9GICo1rkHEhwKGgFUYSJd8vzI9rq7GdIuDy65JMc8zi497E98IiIKILiCMyyFggW8Zd2LGt/AtMr7WWp+kfWbzlN93pXZqzqN",
ByteStr.empty,
"8615df0268bcc76e851a9925e07f212a875a1bd047b0cccbc4ad3d842895f16e",
"3bb24694ea57c1d6b2eec2c549d5ba591853bd7f21959027d2793d5c0846cc8d"
"2665ce187b867f2dae95699882d9fd7c31039c505b8af93ed22cada90524ff37",
"dafc56fb4f5e13ddd3e82547874e154c5c61ac556e76e9e9766b5d7ccbc1e1be"
),
(
"sponsorship",
sponsorship,
"aiUKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEPwq",
ByteStr.empty,
"3bb24694ea57c1d6b2eec2c549d5ba591853bd7f21959027d2793d5c0846cc8d",
"4fd2ceeb81d4d9c7ebad4391fbd938cfc40564088d2cc71801d308d56eca9b75"
"dafc56fb4f5e13ddd3e82547874e154c5c61ac556e76e9e9766b5d7ccbc1e1be",
"d9eab5091d57c18c38e0a8702e7cbe6f133e109281f2ef0f2bc88686b458f31f"
),
(
"alias",
alias,
"SiYKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEgh3YXZlc2V2bw==",
ByteStr.empty,
"4fd2ceeb81d4d9c7ebad4391fbd938cfc40564088d2cc71801d308d56eca9b75",
"0f02911227a9835c1248822f4e500213c4fc4c05a83a5d27680f67d1d1f6a8ee"
"d9eab5091d57c18c38e0a8702e7cbe6f133e109281f2ef0f2bc88686b458f31f",
"eaa251c161cfe875932275ce6ff8873cd169099e021f09245f4069ccd58d6669"
),
(
"order fill",
volumeAndFee,
"UisKIMkknO8yHpMUT/XKkkdlrbYCG0Dt+qvVgphfgtRbyRDMEICU69wDGNAPUisKIJZ9YwvJObbWItHAD2zhbaFOTFx2zQ4p0Xbo81GXHKeEEICU69wDGNAP",
ByteStr.empty,
"0f02911227a9835c1248822f4e500213c4fc4c05a83a5d27680f67d1d1f6a8ee",
"4d0d2c893b435d1bbc3464c59ceda196961b94a81cfb9bb2c50fe03c06f23d00"
"eaa251c161cfe875932275ce6ff8873cd169099e021f09245f4069ccd58d6669",
"de22575b5c2ef7de6388c0ea96e6d0f172802f4c8e33684473c91af65866b1d4"
),
(
"new asset",
newAsset,
"KkYKIF5mn4IKZ9CIbYdHjPBDoqx4XMevVdwxzhB1OUvTUKJbEiDcYGFqY9MotHTpDpskoycN/Mt62bZfPxIC4fpU0ZTBniABKkYKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEiDcYGFqY9MotHTpDpskoycN/Mt62bZfPxIC4fpU0ZTBnhgIMi8KIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEAEaCQT/////////9jIlCiBeZp+CCmfQiG2HR4zwQ6KseFzHr1XcMc4QdTlL01CiWxoBAQ==",
ByteStr.empty,
"4d0d2c893b435d1bbc3464c59ceda196961b94a81cfb9bb2c50fe03c06f23d00",
"e2baa6d7e863fc1f5f6cec326b01e577c4509e927f3b13ed7818af9075be82c3"
"de22575b5c2ef7de6388c0ea96e6d0f172802f4c8e33684473c91af65866b1d4",
"5f09358e944a386ad12b4f6e22c79a5c614967f6da40465e30d878e9b58e75e2"
),
(
"reissued asset",
reissuedAsset,
"MigKIDhvjT3TTlJ+v4Ni205vcYc1m9WWgnQPFovjmJI1H62yGgQ7msoA",
ByteStr.empty,
"e2baa6d7e863fc1f5f6cec326b01e577c4509e927f3b13ed7818af9075be82c3",
"a161ea70fa027f6127763cdb946606e3d65445915ec26c369e0ff28b37bee8cd"
"5f09358e944a386ad12b4f6e22c79a5c614967f6da40465e30d878e9b58e75e2",
"6d5e0f4e2a4b650541b66711bbc687f51fea7bc3aa35b43642e21ab3dd064743"
),
(
"renamed asset",
renamedAsset,
"OkMKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEgduZXduYW1lGhZzb21lIGZhbmN5IGRlc2NyaXB0aW9u",
ByteStr.empty,
"a161ea70fa027f6127763cdb946606e3d65445915ec26c369e0ff28b37bee8cd",
"7a43e1fb599e8a921ecb2a83b4b871bd46db4569bf5c4f6c9225479191450a58"
"6d5e0f4e2a4b650541b66711bbc687f51fea7bc3aa35b43642e21ab3dd064743",
"885ac4b03397e63cdc1a2e3fe60d2aae0d4701e5cfb8c19ca80feb912a028a48"
),
(
"failed transaction",
failedTransaction,
"CiQKGgFUQsXJY3P1D9gTUGBPHBTypsklatr9GbAqEgYQ4PHE1wlwAQ==",
ByteStr(fastHash(Ints.toByteArray(0xaabbef20))),
"7a43e1fb599e8a921ecb2a83b4b871bd46db4569bf5c4f6c9225479191450a58",
"dfa190a84d59edda03428c93c4b1be4c50f12adf3c11528ef0bdd8db1edaf49b"
"885ac4b03397e63cdc1a2e3fe60d2aae0d4701e5cfb8c19ca80feb912a028a48",
"4185fb099c6dd4f483d4488045cc0912f02b9c292128b90142367af680ce2a32"
),
(
"elided transaction",
elidedTransaction,
"cAI=",
ByteStr(fastHash(Ints.toByteArray(0xaabbef40))),
"dfa190a84d59edda03428c93c4b1be4c50f12adf3c11528ef0bdd8db1edaf49b",
"002f4f7f3741668c10a8ba92b4b183680fd6659bafd36037be6f9a636510b128"
"4185fb099c6dd4f483d4488045cc0912f02b9c292128b90142367af680ce2a32",
"7a15507d73ff9f98c3c777e687e23a4c8b33d02212203be73f0518403e91d431"
),
(
"all together",
all,
"CkMKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EiUKIF5mn4IKZ9CIbYdHjPBDoqx4XMevVdwxzhB1OUvTUKJbEJBOCkQKGgFUQsXJ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UT/XKkkdlrbYCG0Dt+qvVgphfgtRbyRDMEICU69wDGNAPUisKIJZ9YwvJObbWItHAD2zhbaFOTFx2zQ4p0Xbo81GXHKeEEICU69wDGNAPWi4KIFDHWa9Cd6VU8M20LLFHzbBTveERf1sEOw19SUS40GBoEgcGAQaw0U/PGPoBYloKGgFUYP1Q7yDeRXEgffuciL58HC+KIscK2I+1EgUKA2ZvbxISCgNiYXJqC1N0cmluZ1ZhbHVlEiEKA2JhemIaAVRg/VDvIN5FcSB9+5yIvnwcL4oixwrYj7ViLwoaAVRCxcljc/UP2BNQYE8cFPKmySVq2v0ZsCoSCAoDZm9vULAJEgcKA2JhclgBaiUKIHidwBEj1TYPcIKv1LRquL/otRYLv7UmwEPl/Hg6T4lOEPwqcAE=",
ByteStr(fastHash(Ints.toByteArray(0xaabbef50))),
"002f4f7f3741668c10a8ba92b4b183680fd6659bafd36037be6f9a636510b128",
"a65304008a49f4ae10cd4af0e61c5d59ba048f0766846d9239d0b28275a0184b"
"7a15507d73ff9f98c3c777e687e23a4c8b33d02212203be73f0518403e91d431",
"6502773294f32cc1702d374ffc1e67ee278cd63c5f00432f80f64a689fcb17f9"
)
)

Expand All @@ -307,7 +307,7 @@ class TxStateSnapshotHashSpec extends PropSpec {
val raw = Hex.toHexString(
TxStateSnapshotHashBuilder
.createHashFromSnapshot(snapshot, Some(TxStateSnapshotHashBuilder.TxStatusInfo(txId, meta)))
.createHash(ByteStr.decodeBase64(prev).get)
.createHash(ByteStr(Hex.decodeStrict(prev)))
.arr
)
PBSnapshots.toProtobuf(snapshot, meta) shouldEqual pbSnapshot
Expand Down

0 comments on commit 9f95648

Please sign in to comment.