You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
622 B

9 years ago
9 years ago
9 years ago
  1. package types
  2. import (
  3. "testing"
  4. )
  5. func TestProposalSignable(t *testing.T) {
  6. proposal := &Proposal{
  7. Height: 12345,
  8. Round: 23456,
  9. BlockPartsHeader: PartSetHeader{111, []byte("blockparts")},
  10. POLRound: -1,
  11. }
  12. signBytes := SignBytes("test_chain_id", proposal)
  13. signStr := string(signBytes)
  14. expected := `{"chain_id":"test_chain_id","proposal":{"block_parts_header":{"hash":"626C6F636B7061727473","total":111},"height":12345,"pol_round":-1,"round":23456}}`
  15. if signStr != expected {
  16. t.Errorf("Got unexpected sign string for SendTx. Expected:\n%v\nGot:\n%v", expected, signStr)
  17. }
  18. }