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.

22 lines
464 B

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