@@ -3,6 +3,12 @@ package migrations_test
3
3
import (
4
4
"encoding/base64"
5
5
"encoding/json"
6
+ crypto "gx/ipfs/QmTW4SdgBWq9GjsBsHeUx8WuGxzhgzAf88UMH2w62PC8yK/go-libp2p-crypto"
7
+ "io/ioutil"
8
+ "os"
9
+ "strconv"
10
+ "testing"
11
+
6
12
"github.com/OpenBazaar/jsonpb"
7
13
"github.com/OpenBazaar/openbazaar-go/ipfs"
8
14
"github.com/OpenBazaar/openbazaar-go/pb"
@@ -11,11 +17,6 @@ import (
11
17
"github.com/OpenBazaar/openbazaar-go/test/factory"
12
18
"github.com/golang/protobuf/proto"
13
19
coremock "github.com/ipfs/go-ipfs/core/mock"
14
- crypto "gx/ipfs/QmTW4SdgBWq9GjsBsHeUx8WuGxzhgzAf88UMH2w62PC8yK/go-libp2p-crypto"
15
- "io/ioutil"
16
- "os"
17
- "strconv"
18
- "testing"
19
20
)
20
21
21
22
const (
31
32
"contractType": "PHYSICAL_GOOD",
32
33
"format": "FIXED_PRICE",
33
34
"pricingCurrency": "BTC",
34
- "priceModifier": 1
35
+ "priceModifier": 1,
36
+ "shippingFromCountryCode": "NA"
35
37
},
36
38
"item": {
37
39
"price": 100,
71
73
"format": "MARKET_PRICE",
72
74
"coinType": "BAT",
73
75
"coinDivisibility": 8,
74
- "priceModifier": 50
76
+ "priceModifier": 50,
77
+ "shippingFromCountryCode": "NA"
75
78
},
76
79
"item": {
77
80
"skus": [
90
93
"metadata": {
91
94
"version": 5,
92
95
"contractType": "PHYSICAL_GOOD",
93
- "format": "FIXED_PRICE"
96
+ "format": "FIXED_PRICE",
97
+ "shippingFromCountryCode": "NA"
94
98
},
95
99
"item": {
96
100
"skus": [
@@ -134,7 +138,8 @@ var (
134
138
"contractType": "CRYPTOCURRENCY",
135
139
"format": "MARKET_PRICE",
136
140
"coinType": "BAT",
137
- "coinDivisibility": 8
141
+ "coinDivisibility": 8,
142
+ "shippingFromCountryCode": "NA"
138
143
},
139
144
"item": {
140
145
"skus": [
@@ -240,10 +245,14 @@ func TestMigrateListingsToV5Schema(t *testing.T) {
240
245
}
241
246
242
247
if string (upMigratedListing ) != postMigrateListingsToV5Schema_ListingJSON {
248
+ t .Log (string (upMigratedListing ))
249
+ t .Log (postMigrateListingsToV5Schema_ListingJSON )
243
250
t .Error ("Failed to migrate listing up" )
244
251
}
245
252
246
253
if string (upMigratedCryptoListing ) != postMigrateListingsToV5Schema_CryptoListingJSON {
254
+ t .Log (string (upMigratedCryptoListing ))
255
+ t .Log (postMigrateListingsToV5Schema_CryptoListingJSON )
247
256
t .Error ("Failed to migrate crypto listing up" )
248
257
}
249
258
0 commit comments