Fixed tests

This commit is contained in:
Jae Kwon
2015-06-24 14:04:40 -07:00
parent 9b96e2e171
commit 9e1794eaea
9 changed files with 102 additions and 103 deletions

View File

@ -11,15 +11,16 @@ import (
func TestProposalSignable(t *testing.T) {
proposal := &Proposal{
Height: 12345,
Round: 23456,
BlockParts: types.PartSetHeader{111, []byte("blockparts")},
POLParts: types.PartSetHeader{222, []byte("polparts")},
Signature: nil,
Height: 12345,
Round: 23456,
BlockPartsHeader: types.PartSetHeader{111, []byte("blockparts")},
POLRound: -1,
Signature: nil,
}
signBytes := account.SignBytes(config.GetString("chain_id"), proposal)
signStr := string(signBytes)
expected := Fmt(`{"chain_id":"%s","proposal":{"block_parts":{"hash":"626C6F636B7061727473","total":111},"height":12345,"pol_parts":{"hash":"706F6C7061727473","total":222},"round":23456}}`,
expected := Fmt(`{"chain_id":"%s","proposal":{"block_parts_header":{"hash":"626C6F636B7061727473","total":111},"height":12345,"pol_round":-1,"round":23456}}`,
config.GetString("chain_id"))
if signStr != expected {
t.Errorf("Got unexpected sign string for SendTx. Expected:\n%v\nGot:\n%v", expected, signStr)