mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 21:01:21 +00:00
privval: Switch to amino encoding in SignBytes (#2459)
* switch to amino for SignBytes and add Reply with error message - currently only Vote is done * switch Reply type in socket for other messages - add error description on error * add TODOs regarding error handling * address comments from peer review session (thx @xla) - contains all changes besides the test-coverage / error'ing branches * increase test coverage: - add tests for each newly introduced error'ing code path * return error if received wrong response * add test for wrong response branches (ErrUnexpectedResponse) * update CHANGELOG_PENDING and related documentation (spec) * fix typo: s/CanonicallockID/CanonicalBlockID * fixes from review
This commit is contained in:
committed by
Ethan Buchman
parent
47bc15c27a
commit
fc073746a0
@ -24,17 +24,12 @@ func init() {
|
||||
}
|
||||
|
||||
func TestProposalSignable(t *testing.T) {
|
||||
signBytes := testProposal.SignBytes("test_chain_id")
|
||||
signStr := string(signBytes)
|
||||
chainID := "test_chain_id"
|
||||
signBytes := testProposal.SignBytes(chainID)
|
||||
|
||||
expected := `{"@chain_id":"test_chain_id","@type":"proposal","block_parts_header":{"hash":"626C6F636B7061727473","total":"111"},"height":"12345","pol_block_id":{},"pol_round":"-1","round":"23456","timestamp":"2018-02-11T07:09:22.765Z"}`
|
||||
if signStr != expected {
|
||||
t.Errorf("Got unexpected sign string for Proposal. Expected:\n%v\nGot:\n%v", expected, signStr)
|
||||
}
|
||||
|
||||
if signStr != expected {
|
||||
t.Errorf("Got unexpected sign string for Proposal. Expected:\n%v\nGot:\n%v", expected, signStr)
|
||||
}
|
||||
expected, err := cdc.MarshalBinary(CanonicalizeProposal(chainID, testProposal))
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, expected, signBytes, "Got unexpected sign bytes for Proposal")
|
||||
}
|
||||
|
||||
func TestProposalString(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user