particl/particl-market

Unable to publish listing - CryptocurrencyAddress field not populated

Closed this issue · 1 comments

Any attempt to add listing failed on command: [template post,1,1]
error displayed in console:

TypeError: Cannot read property 'type' of undefined                                                                                                                                            
    at ListingItemFactory.<anonymous> (~/PART/particl-desktop/node_modules/particl-marketplace/dist/api/factories/ListingItemFactory.js:401:62)
    at Generator.next (<anonymous>)
    at ~/PART/particl-desktop/node_modules/tslib/tslib.js:105:75
    at Promise (<anonymous>)
    at Object.__awaiter (~/PART/particl-desktop/node_modules/tslib/tslib.js:101:16)
    at ListingItemFactory.getMessageCryptoCurrency (~/PART/particl-desktop/node_modules/particl-marketplace/dist/api/factories/ListingItemFactory.js:391:24)
    at ListingItemFactory.<anonymous> (~/PART/particl-desktop/node_modules/particl-marketplace/dist/api/factories/ListingItemFactory.js:371:47)
    at Generator.next (<anonymous>)
    at fulfilled (~/PART/particl-desktop/node_modules/tslib/tslib.js:102:62)
    at <anonymous>
- info: [app] POST /api/rpc 500 167.962 ms - 59

Exception happen on this line:

type: itemPrice.CryptocurrencyAddress.type,

It turns out that CryptocurrencyAddress in not defined in template created by ListingItemFactory.
Also in listing template cryptocurrencyAddressId equals null:

PaymentInformation: {
  //..skip..
  ItemPrice: {
  //..skip.. 
    cryptocurrencyAddressId: null
  }
}

Tested on both versions: published to npm and from git.

Maybe not a bug in particl-marget, but lack of proper RPC calls from particl-desktop.

Cannot reproduce after commit b97bbb7
Closing