From 0f35ab057011f0e871f6eb9af4567faeb6e3c0fa Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed, 28 Jun 2023 13:48:01 +0200 Subject: [PATCH] test: update test vectors for new StateID.time type --- privval/msgs_test.go | 4 ++-- proto/tendermint/types/types_test.go | 15 ++++++++------- types/block_test.go | 2 +- types/evidence_test.go | 2 +- types/proposal_test.go | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/privval/msgs_test.go b/privval/msgs_test.go index 5f15c65bca..296b7e83db 100644 --- a/privval/msgs_test.go +++ b/privval/msgs_test.go @@ -95,8 +95,8 @@ func TestPrivvalVectors(t *testing.T) { {"pubKey request", &privproto.PubKeyRequest{}, "0a00"}, {"pubKey response", &privproto.PubKeyResponse{PubKey: ppk, Error: nil}, "12340a321a30991a1c4f159f8e4730bf897e97e27c11f27ba0c1337111a3c102e1081a19372832b596623b1a248a0e00b156d80690cf"}, {"pubKey response with error", &privproto.PubKeyResponse{PubKey: cryptoproto.PublicKey{}, Error: remoteError}, "12140a0012100801120c697427732061206572726f72"}, - {"Vote Request", &privproto.SignVoteRequest{Vote: votepb}, "1aaa010aa701080210031802226c0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a1a2071aa7631e86d2b19d27f0c63e41ed08e5f8d43cfbb69d35913a7731b61bbdc622a20959a8f5ef2be68d0ed3a07ed8cff85991ee7995c2ac17030f742c135f9729fbe30d5bb03420b1209657874656e73696f6e"}, - {"Vote Response", &privproto.SignedVoteResponse{Vote: *votepb, Error: nil}, "22aa010aa701080210031802226c0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a1a2071aa7631e86d2b19d27f0c63e41ed08e5f8d43cfbb69d35913a7731b61bbdc622a20959a8f5ef2be68d0ed3a07ed8cff85991ee7995c2ac17030f742c135f9729fbe30d5bb03420b1209657874656e73696f6e"}, + {"Vote Request", &privproto.SignVoteRequest{Vote: votepb}, "1aaa010aa701080210031802226c0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a1a20b583d49b95a0a5526966b519d8b7bba2aefc800b370a7438c7063728904e58ee2a20959a8f5ef2be68d0ed3a07ed8cff85991ee7995c2ac17030f742c135f9729fbe30d5bb03420b1209657874656e73696f6e"}, + {"Vote Response", &privproto.SignedVoteResponse{Vote: *votepb, Error: nil}, "22aa010aa701080210031802226c0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a1a20b583d49b95a0a5526966b519d8b7bba2aefc800b370a7438c7063728904e58ee2a20959a8f5ef2be68d0ed3a07ed8cff85991ee7995c2ac17030f742c135f9729fbe30d5bb03420b1209657874656e73696f6e"}, {"Vote Response with error", &privproto.SignedVoteResponse{Vote: tmproto.Vote{}, Error: remoteError}, "22180a042202120012100801120c697427732061206572726f72"}, {"Proposal Request", &privproto.SignProposalRequest{Proposal: proposalpb}, "2a700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, {"Proposal Response", &privproto.SignedProposalResponse{Proposal: *proposalpb, Error: nil}, "32700a6e08011003180220022a4a0a208b01023386c371778ecb6368573e539afc3cc860ec3a2f614e54fe5652f4fc80122608c0843d122072db3d959635dff1bb567bedaa70573392c5159666a3f8caf11e413aac52207a320608f49a8ded053a10697427732061207369676e6174757265"}, diff --git a/proto/tendermint/types/types_test.go b/proto/tendermint/types/types_test.go index 5a8cc35b0c..b17844a135 100644 --- a/proto/tendermint/types/types_test.go +++ b/proto/tendermint/types/types_test.go @@ -52,10 +52,11 @@ func TestVoteSignBytes(t *testing.T) { StateID: []byte{}, // filled later }, }, - expectHex: "0100000001000000000000000200000000000000fb7c89bf010a91d50f890455582b7fed0c346e53ab" + - "33df7da0bcd85c10fa92ead7509905b5407ee72dadd93b4ae70a24ad8a7755fc677acd2b215710a05cfc47736" + - "f6d652d636861696e", - }, + expectHex: "0100000001000000000000000200000000000000" + + "fb7c89bf010a91d50f890455582b7fed0c346e53" + + "ab33df7da0bcd85c10fa92ea1854710e3fa0f558" + + "fee16269c62154c5ca00114f96d782df690a3f6d" + + "8e25c117736f6d652d636861696e"}, 1: { stateID: StateID{ AppVersion: 2, @@ -74,9 +75,9 @@ func TestVoteSignBytes(t *testing.T) { StateID: []byte{}, // filled later }, }, - expectHex: "0200000001000000000000000200000000000000fb7c89bf010a91d50f8904" + - "55582b7fed0c346e53ab33df7da0bcd85c10fa92ead7509905b5407ee72dadd93b4ae70a2" + - "4ad8a7755fc677acd2b215710a05cfc47736f6d652d636861696e", + expectHex: "0200000001000000000000000200000000000000fb7c89bf010a91d50f890455582b7fed0c34" + + "6e53ab33df7da0bcd85c10fa92ea1854710e3fa0f558fee16269c62154c5ca00114f96d782df690a3f6d8e2" + + "5c117736f6d652d636861696e", }, } diff --git a/types/block_test.go b/types/block_test.go index 3693b83007..adb797e555 100644 --- a/types/block_test.go +++ b/types/block_test.go @@ -375,7 +375,7 @@ func TestHeaderHash(t *testing.T) { ProposerProTxHash: crypto.ProTxHashFromSeedBytes([]byte("proposer_pro_tx_hash")), ProposedAppVersion: 1, }, - expectHash: hexBytesFromString(t, "5CF83D17EEC01506B3F1EA0596B49CD21B7DEBDCB18E3204A99E6BDC5C470B9B"), + expectHash: hexBytesFromString(t, "FF24DDAB9E1550BEB40AB7AD432A4D577560E9B87A80C7BB86E75263974B87E0"), }, { "nil header yields nil", diff --git a/types/evidence_test.go b/types/evidence_test.go index bd07d6cf00..62058bb845 100644 --- a/types/evidence_test.go +++ b/types/evidence_test.go @@ -302,7 +302,7 @@ func TestEvidenceVectors(t *testing.T) { }{ {"duplicateVoteEvidence", EvidenceList{&DuplicateVoteEvidence{VoteA: v2, VoteB: v}}, - "17d639d1c1ac431802a566f190ee5fb7b478204ac8990230df5134388dea0a93", + "87904f3525bfdb8474a18bc44fcadf76f63f0e7cabc3063f5eae8dcf0eb11d79", }, } diff --git a/types/proposal_test.go b/types/proposal_test.go index ae320c0991..9a31ab51c1 100644 --- a/types/proposal_test.go +++ b/types/proposal_test.go @@ -61,7 +61,7 @@ func TestProposalSignable(t *testing.T) { func TestProposalString(t *testing.T) { str := getTestProposal(t).String() - expected := `Proposal{12345/23456 (2D2D4A756E655F31355F323032305F616D696E6F5F7761735F72656D6F766564:111:2D2D4A756E65:D8A08898004B, -1) 000000000000 @ 2018-02-11T07:09:22.765Z}` + expected := `Proposal{12345/23456 (2D2D4A756E655F31355F323032305F616D696E6F5F7761735F72656D6F766564:111:2D2D4A756E65:E97D78757A53, -1) 000000000000 @ 2018-02-11T07:09:22.765Z}` assert.Equal(t, expected, str) }