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
When addPermittedAction is called with some IPFS CIDs, it fails with the following error:
/Users/me/code/lit-custom-auth/node_modules/@ethersproject/basex/src.ts/index.ts:112
throw new Error("Non-base" + this.base + " character");
^
Error: Non-base58 character
at BaseX.decode (/Users/me/code/lit-custom-auth/node_modules/@ethersproject/basex/src.ts/index.ts:112:23)
at Object.getBytesFromMultihash (/Users/me/code/lit-custom-auth/packages/contracts-sdk/src/lib/contracts-sdk.ts:1710:43)
at LitContracts.addPermittedAction (/Users/me/code/lit-custom-auth/packages/contracts-sdk/src/lib/contracts-sdk.ts:1495:36)
at main (file:///Users/me/code/lit-custom-auth/apps/backend/src/main.ts:137:56)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at file:///Users/me/code/lit-custom-auth/apps/backend/src/main.ts:145:1
This is workaroundable (at least for aforementioned lit actions code) by using an ancient library that's used in the examples as well (ipfs-only-hash). The lit actions code is taken from the custom-auth example
The text was updated successfully, but these errors were encountered:
This is wrong: Only v0 CIDs are guaranteed base58 (which explains why the ipfs-only-hash library works). V1 CIDs may be base58 but as shown in this issue, this would cause problems:
// this snippet errors// litActionCode is same as one from "steps to reproduce"constipfsCid=awaitstringToCidV0(litActionCode);ethers.utils.base58.decode(ipfsCid.toString())
multiformats library can be used to properly implement getBytesFromMultihash function. CID class from this library provides a way to get the CID as bytes
Uh oh!
There was an error while loading. Please reload this page.
Is there an existing issue for this?
SDK version
@lit-protocol/[email protected]
@lit-protocol/[email protected]
Lit Network
datil-test
Description of the bug/issue
When
addPermittedAction
is called with some IPFS CIDs, it fails with the following error:Severity of the bug
N/A
Steps To Reproduce
The following code will result in the error:
Link to code
No response
Anything else?
This is workaroundable (at least for aforementioned lit actions code) by using an ancient library that's used in the examples as well (ipfs-only-hash). The lit actions code is taken from the custom-auth example
The text was updated successfully, but these errors were encountered: