Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 00158b1

Browse files
committed
Update buyer_order_test
1 parent fc4a87f commit 00158b1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

repo/buyer_order_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package repo
22

33
import (
4+
"testing"
5+
46
"github.com/OpenBazaar/jsonpb"
57
"github.com/OpenBazaar/openbazaar-go/pb"
6-
"testing"
78
)
89

910
func TestToV5Order(t *testing.T) {
@@ -22,7 +23,7 @@ func TestToV5Order(t *testing.T) {
2223
RefundFee: 1000,
2324
Payment: &pb.Order_Payment{},
2425
},
25-
expected: `{"payment":{"method":"ADDRESS_REQUEST"},"bigRefundFee":"1000"}`,
26+
expected: `{"payment":{"method":"ADDRESS_REQUEST","amountCurrency":{"code":"BTC","divisibility":8}},"bigRefundFee":"1000"}`,
2627
},
2728
{
2829
name: "item quantity test",
@@ -34,7 +35,7 @@ func TestToV5Order(t *testing.T) {
3435
},
3536
Payment: &pb.Order_Payment{},
3637
},
37-
expected: `{"items":[{"bigQuantity":"19"}],"payment":{"method":"ADDRESS_REQUEST"}}`,
38+
expected: `{"items":[{"bigQuantity":"19"}],"payment":{"method":"ADDRESS_REQUEST","amountCurrency":{"code":"BTC","divisibility":8}}}`,
3839
},
3940
{
4041
name: "item quantity64 test",
@@ -46,7 +47,7 @@ func TestToV5Order(t *testing.T) {
4647
},
4748
Payment: &pb.Order_Payment{},
4849
},
49-
expected: `{"items":[{"bigQuantity":"19"}],"payment":{"method":"ADDRESS_REQUEST"}}`,
50+
expected: `{"items":[{"bigQuantity":"19"}],"payment":{"method":"ADDRESS_REQUEST","amountCurrency":{"code":"BTC","divisibility":8}}}`,
5051
},
5152
{
5253
name: "payment amount test",
@@ -55,7 +56,7 @@ func TestToV5Order(t *testing.T) {
5556
Amount: 2000,
5657
},
5758
},
58-
expected: `{"payment":{"method":"ADDRESS_REQUEST","bigAmount":"2000"}}`,
59+
expected: `{"payment":{"method":"ADDRESS_REQUEST","bigAmount":"2000","amountCurrency":{"code":"BTC","divisibility":8}}}`,
5960
},
6061
{
6162
name: "payment amount currency",
@@ -78,7 +79,6 @@ func TestToV5Order(t *testing.T) {
7879
if err != nil {
7980
t.Errorf("Test %s marshalling failed: %s", test.name, err)
8081
}
81-
8282
if out != test.expected {
8383
t.Errorf("Test %s incorrect output: Expected %s, got %s", test.name, test.expected, out)
8484
}

0 commit comments

Comments
 (0)