package state import ( "testing" "github.com/nspcc-dev/neo-go/pkg/io" "github.com/stretchr/testify/assert" ) func TestDecodeEncodeUnspentCoin(t *testing.T) { unspent := &UnspentCoin{ States: []Coin{ CoinConfirmed, CoinSpent, CoinSpent, CoinSpent, CoinConfirmed, }, } buf := io.NewBufBinWriter() unspent.EncodeBinary(buf.BinWriter) assert.Nil(t, buf.Err) unspentDecode := &UnspentCoin{} r := io.NewBinReaderFromBuf(buf.Bytes()) unspentDecode.DecodeBinary(r) assert.Nil(t, r.Err) }