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.

25 lines
760 B

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