chainpoint/chainpoint-client-js

Unhandled rejection TypeError: Cannot set property 'submitted_to' of undefined

Gubaer opened this issue · 2 comments

I call submitHashes with a mock URI pointing to a mock for the chainpoint API.

const chp = require('chainpoint-client');

let mockUri  = 'http://127.0.0.1:9000';
let hash = 'a_hash';
let handles = await chp.submitHashes([hash], [mockUri]);

Below is the error stack I get. Any idea how to use the chainpoint client against a mock chainpoint api server?

Error stack:

Unhandled rejection TypeError: Cannot set property 'submitted_to' of undefined
    at <redacted>/node_modules/chainpoint-client/dist/bundle.js:1:421074
    at Vt (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:431838)
    at Ko (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:466791)
    at n.map.then.e (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:421041)
    at u (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:3604)
    at A._settlePromiseFromHandler (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:505275)
    at A._settlePromise (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:506075)
    at A._settlePromise0 (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:506774)
    at A._settlePromises (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:508101)
    at A._fulfill (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:507144)
    at f.s._resolve (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:516054)
    at f._promiseFulfilled (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:546973)
    at A._settlePromise (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:506176)
    at A._settlePromise0 (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:506774)
    at A._settlePromises (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:508101)
    at s._drainQueue (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:511103)
    at s._drainQueues (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:511164)
    at Immediate.drainQueues [as _onImmediate] (<redacted>/node_modules/chainpoint-client/dist/bundle.js:1:509375)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)

Assuming that the mock API's endpoints and return values are consistent with the full Node API, I don't see why there would be a problem. I cannot reproduce the error you have identified here given the code that you have supplied. It would be helpful if you would submit a fuller example that reliably reproduces this error.

My bad, found a stupid error on my side :-( Thanks for your help!