Closed jorgenbuilder closed 3 years ago
Seems there's a broken import with @dfinity/candid 0.10.0... will take a look.
I was receiving the following error, which the latest commit seems to have fixed:
POST http://localhost:8000/api/v2/canister/rrkah-fqaaa-aaaaa-aaaaq-cai/call
422 (Unprocessable Entity)
call @ index.ts:205
async function (async)
call @ index.ts:166
caller @ actor.ts:349
handler @ actor.ts:372
(anonymous) @ account.tsx:19
index.ts:213 Uncaught (in promise) Error: Server returned an error:
Code: 422 (Unprocessable Entity)
Body: Could not parse body as submit message: Invalid CBOR encoding: invalid type: map, expected byte array
at HttpAgent.call (index.ts:213)
at async caller (actor.ts:349)
EDIT I don't think mismatched versions were the issue, but perhaps some worthwhile changes here nonetheless.
Mismatching versions of
@dfinity/agent
(0.9.1 / 0.10.0) causes errors when hashing principals. We should bump these versions for that reason, and perhaps bump stoic identity to version 1.5.1.I believe 0.10.0 added a new parameter_arr
to thePrincipal
class, so thisvalue instanceof Principal
returns falsy. Maybe @dfinity/agent should do a different check, likevalue.hasOwnProperty(toUint8Array)
which would be less error prone here. I'll mention that on the forums. For now I think we should get this in.