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.

23 lines
526 B

9 years ago
9 years ago
9 years ago
  1. package state
  2. import (
  3. "bytes"
  4. "testing"
  5. stypes "github.com/tendermint/tendermint/state/types"
  6. "github.com/tendermint/tendermint/wire"
  7. )
  8. func TestStateToFromVMAccount(t *testing.T) {
  9. acmAcc1, _ := stypes.RandAccount(true, 456)
  10. vmAcc := toVMAccount(acmAcc1)
  11. acmAcc2 := toStateAccount(vmAcc)
  12. acmAcc1Bytes := wire.BinaryBytes(acmAcc1)
  13. acmAcc2Bytes := wire.BinaryBytes(acmAcc2)
  14. if !bytes.Equal(acmAcc1Bytes, acmAcc2Bytes) {
  15. t.Errorf("Unexpected account wire bytes\n%X vs\n%X",
  16. acmAcc1Bytes, acmAcc2Bytes)
  17. }
  18. }