@@ -3,6 +3,12 @@ package migrations_test
33import (
44 "encoding/base64"
55 "encoding/json"
6+ crypto "gx/ipfs/QmTW4SdgBWq9GjsBsHeUx8WuGxzhgzAf88UMH2w62PC8yK/go-libp2p-crypto"
7+ "io/ioutil"
8+ "os"
9+ "strconv"
10+ "testing"
11+
612 "github.com/OpenBazaar/jsonpb"
713 "github.com/OpenBazaar/openbazaar-go/ipfs"
814 "github.com/OpenBazaar/openbazaar-go/pb"
@@ -11,11 +17,6 @@ import (
1117 "github.com/OpenBazaar/openbazaar-go/test/factory"
1218 "github.com/golang/protobuf/proto"
1319 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"
1920)
2021
2122const (
3132 "contractType": "PHYSICAL_GOOD",
3233 "format": "FIXED_PRICE",
3334 "pricingCurrency": "BTC",
34- "priceModifier": 1
35+ "priceModifier": 1,
36+ "shippingFromCountryCode": "NA"
3537 },
3638 "item": {
3739 "price": 100,
7173 "format": "MARKET_PRICE",
7274 "coinType": "BAT",
7375 "coinDivisibility": 8,
74- "priceModifier": 50
76+ "priceModifier": 50,
77+ "shippingFromCountryCode": "NA"
7578 },
7679 "item": {
7780 "skus": [
9093 "metadata": {
9194 "version": 5,
9295 "contractType": "PHYSICAL_GOOD",
93- "format": "FIXED_PRICE"
96+ "format": "FIXED_PRICE",
97+ "shippingFromCountryCode": "NA"
9498 },
9599 "item": {
96100 "skus": [
@@ -134,7 +138,8 @@ var (
134138 "contractType": "CRYPTOCURRENCY",
135139 "format": "MARKET_PRICE",
136140 "coinType": "BAT",
137- "coinDivisibility": 8
141+ "coinDivisibility": 8,
142+ "shippingFromCountryCode": "NA"
138143 },
139144 "item": {
140145 "skus": [
@@ -240,10 +245,14 @@ func TestMigrateListingsToV5Schema(t *testing.T) {
240245 }
241246
242247 if string (upMigratedListing ) != postMigrateListingsToV5Schema_ListingJSON {
248+ t .Log (string (upMigratedListing ))
249+ t .Log (postMigrateListingsToV5Schema_ListingJSON )
243250 t .Error ("Failed to migrate listing up" )
244251 }
245252
246253 if string (upMigratedCryptoListing ) != postMigrateListingsToV5Schema_CryptoListingJSON {
254+ t .Log (string (upMigratedCryptoListing ))
255+ t .Log (postMigrateListingsToV5Schema_CryptoListingJSON )
247256 t .Error ("Failed to migrate crypto listing up" )
248257 }
249258
0 commit comments