-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: "list" argument must be an Array of Buffers #5
Comments
I noticed some type errors like this when I was rewriting stoic-identity in TypeScript. You could try out my fork with the IIRC the type errors I found were centered around de-serializing the local storage data. (It's hard to know for certain where I changed actual logic though cause the git diff is useless since I basically rewrote the whole |
I just tried with your fork but I get the same issue |
I think I figured it out, though it is very surprising that stoic-identity works at all if this is the case. Perhaps there has been a browser or dependency update that is causing this on my machine. This line needs to be changed: https://github.com/Toniq-Labs/stoic-identity/blob/main/src/index.js#L86 Original: const result = JSON.parse(await this.sign(Buffer.from(Buffer.concat([domainSeparator, new Uint8Array(requestId)])))); Fixed: const result = JSON.parse(await this.sign(Buffer.from(Buffer.concat([domainSeparator, Buffer.from(new Uint8Array(requestId))]))));
|
Nice find! I think it's because the type error is just ignored, but concat handles it OK anyway. Definitely worth the fix tho, thanks so much! |
We're also getting this error when integrating Stoic and trying to make a call with the identity:
Our code looks like this:
The code works with all other IC wallets, only having this issue with Stoic |
It turns out my issue was exactly the same as @lastmjs :) I thought that the fix already existed in the npm package. I was able to patch the code locally, but would be good to update the ic-stoic-identity npm package with the fix |
I'm trying to run this code:
The
test
canister function looks like this in TypeScript:and would have this candid:
When I run the frontend code above, I keep getting this error:
Everything executes just fine up to
await actor.test('hello')
, and somewhere during resolving actor.test the error is thrown. I've been trying a couple different combinations of canister methods and parameters and I'm not yet tracking down why this is happening.For some more information, it seems to be here in the source code where the error is being thrown: https://github.com/Toniq-Labs/stoic-identity/blob/main/src/index.js#L86
Any pointers?
The text was updated successfully, but these errors were encountered: