From d74f4910729cf6449849b7bcddb8da6cb714a7d0 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 17 Jan 2018 19:42:05 -0500 Subject: [PATCH] x/auth: fix test --- x/auth/account_test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/x/auth/account_test.go b/x/auth/account_test.go index bdffb8c61..a7397dc45 100644 --- a/x/auth/account_test.go +++ b/x/auth/account_test.go @@ -18,6 +18,10 @@ func TestBaseAccount(t *testing.T) { acc := NewBaseAccountWithAddress(addr) + // need a codec for marshaling + codec := wire.NewCodec() + crypto.RegisterWire(codec) + err := acc.SetPubKey(pub) assert.Nil(t, err) assert.Equal(t, pub, acc.GetPubKey()) @@ -32,15 +36,15 @@ func TestBaseAccount(t *testing.T) { assert.Nil(t, err) assert.Equal(t, seq, acc.GetSequence()) - b, err := wire.MarshalBinary(acc) + b, err := codec.MarshalBinary(acc) assert.Nil(t, err) var acc2 BaseAccount - err = wire.UnmarshalBinary(b, &acc2) + err = codec.UnmarshalBinary(b, &acc2) assert.Nil(t, err) assert.Equal(t, acc, acc2) acc2 = BaseAccount{} - err = wire.UnmarshalBinary(b[:len(b)/2], &acc2) + err = codec.UnmarshalBinary(b[:len(b)/2], &acc2) assert.NotNil(t, err) }