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

package state
import (
"bytes"
"testing"
stypes "github.com/tendermint/tendermint/state/types"
"github.com/tendermint/tendermint/wire"
)
func TestStateToFromVMAccount(t *testing.T) {
acmAcc1, _ := stypes.RandAccount(true, 456)
vmAcc := toVMAccount(acmAcc1)
acmAcc2 := toStateAccount(vmAcc)
acmAcc1Bytes := wire.BinaryBytes(acmAcc1)
acmAcc2Bytes := wire.BinaryBytes(acmAcc2)
if !bytes.Equal(acmAcc1Bytes, acmAcc2Bytes) {
t.Errorf("Unexpected account wire bytes\n%X vs\n%X",
acmAcc1Bytes, acmAcc2Bytes)
}
}