X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/22c599abc18895f73e96095f35b71cf3357d41b4..19dcc94821d1fac803c571b1dc11764213713682:/hotline/transaction_test.go diff --git a/hotline/transaction_test.go b/hotline/transaction_test.go index 227b9e0..1fade25 100644 --- a/hotline/transaction_test.go +++ b/hotline/transaction_test.go @@ -142,16 +142,25 @@ func TestReadTransaction(t *testing.T) { { name: "when buf contains all bytes for a single transaction", args: args{ - buf: sampleTransaction.Payload(), + buf: func() []byte { + b, _ := sampleTransaction.MarshalBinary() + return b + }(), }, want: sampleTransaction, - want1: len(sampleTransaction.Payload()), + want1: func() int { + b, _ := sampleTransaction.MarshalBinary() + return len(b) + }(), wantErr: false, }, { name: "when len(buf) is less than the length of the transaction", args: args{ - buf: sampleTransaction.Payload()[:len(sampleTransaction.Payload()) - 1], + buf: func() []byte { + b, _ := sampleTransaction.MarshalBinary() + return b[:len(b)-1] + }(), }, want: nil, want1: 0,