Skip to content

Commit

Permalink
test: update test vectors for new StateID.time type
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Jun 28, 2023
1 parent 585388d commit 0f35ab0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions privval/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
15 changes: 8 additions & 7 deletions proto/tendermint/types/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -74,9 +75,9 @@ func TestVoteSignBytes(t *testing.T) {
StateID: []byte{}, // filled later
},
},
expectHex: "0200000001000000000000000200000000000000fb7c89bf010a91d50f8904" +
"55582b7fed0c346e53ab33df7da0bcd85c10fa92ead7509905b5407ee72dadd93b4ae70a2" +
"4ad8a7755fc677acd2b215710a05cfc47736f6d652d636861696e",
expectHex: "0200000001000000000000000200000000000000fb7c89bf010a91d50f890455582b7fed0c34" +
"6e53ab33df7da0bcd85c10fa92ea1854710e3fa0f558fee16269c62154c5ca00114f96d782df690a3f6d8e2" +
"5c117736f6d652d636861696e",
},
}

Expand Down
2 changes: 1 addition & 1 deletion types/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion types/evidence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func TestEvidenceVectors(t *testing.T) {
}{
{"duplicateVoteEvidence",
EvidenceList{&DuplicateVoteEvidence{VoteA: v2, VoteB: v}},
"17d639d1c1ac431802a566f190ee5fb7b478204ac8990230df5134388dea0a93",
"87904f3525bfdb8474a18bc44fcadf76f63f0e7cabc3063f5eae8dcf0eb11d79",
},
}

Expand Down
2 changes: 1 addition & 1 deletion types/proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 0f35ab0

Please sign in to comment.