]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/transaction_test.go
Convert hardcoded path separators to filepath.Join
[rbdr/mobius] / hotline / transaction_test.go
index 4c7d3725168b54f9c39719158fc53e8a5490da7e..1fade255c63bc5e2047624b2d459b7257e93b066 100644 (file)
@@ -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,