You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered this error message when calling the store API:
{"message":"TypeError: Cannot read property 'toString' of undefined\n at Object.proposeStorageDeal (/Users/james/numbers/starling-api/node_modules/filecoin-api-client/src/ cmd/client/propose-storage-deal.js:10:18)\n at proposeDeal (/Users/james/numbers/starling-api/lib/apis/store/controller/store.js:115:51)\n at ProposeDeals.Promise.all. importedFiles.map.file (/Users/james/numbers/starling-api/lib/apis/store/controller/store.js:157:16)\n at Array.map (<anonymous>)\n at ProposeDeals (/Users/james/ numbers/starling-api/lib/apis/store/controller/store.js:154:21)\n at store (/Users/james/numbers/starling-api/lib/apis/store/index.js:29:11)\n at process._tickCallback (internal/process/next_tick.js:68:7)","level":"error"}
After adding some debug console to the starling-api, I've found that the cid and name parameter passed to this function is always undefined if only 1 file is going to be stored.
This issue is expected to be fixed early next week, with the rewrite of the store command as part of the migration to lotus that @alexandrumatei36 is working on. I will update here once that's merged in.
Issue description
I encountered this error message when calling the
store
API:After adding some debug console to the starling-api, I've found that the
cid
andname
parameter passed to this function is alwaysundefined
if only 1 file is going to be stored.It turns out that in this line
The
FILE
object is actually an array if there's only one file (thefilesCount
here is1
)but the function
proposeDeal
should accept the file object instead of an array of the file objectsSteps to reproduce
The complete Python 3 code to invoke the API:
xmp.json:
where the
xmp/
folder contains only 1 file, anxmp.txt
fileEnvironment
starling-api commit hash: d6cb6b4
filecoin version: v0.5.8
The text was updated successfully, but these errors were encountered: