codama-idl / codama

Generate clients, CLIs, documentation and more from your Solana programs
MIT License
101 stars 20 forks source link

[0.21] Fix: kinobi error does not use optional account instruction name but InstructionNode #204

Closed aspnxdd closed 2 months ago

aspnxdd commented 2 months ago

I noticed that the error KINOBI_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE, was printing [object Object] on the instruction name.

With this PR we log the instruction name instead of [object Object] since it was using the InstructionNode object.

Prev error:

KinobiError: Cannot use optional account [adminWallet] as the [adminWallet] PDA seed for the [adminLpTokenAccount] account of the [[object Object]] instruction.

Current error:

KinobiError: Cannot use optional account [adminWallet] as the [adminWallet] PDA seed for the [adminLpTokenAccount] account of the [createBook] instruction.
changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: e86e872aead9078c973d06540e55af0cea4b3e51

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages | Name | Type | | ---------------------------- | ----- | | @kinobi-so/errors | Patch | | kinobi | Patch | | @kinobi-so/nodes-from-anchor | Patch | | @kinobi-so/nodes | Patch | | @kinobi-so/renderers-core | Patch | | @kinobi-so/renderers-js-umi | Patch | | @kinobi-so/renderers-js | Patch | | @kinobi-so/renderers-rust | Patch | | @kinobi-so/validators | Patch | | @kinobi-so/visitors-core | Patch | | @kinobi-so/visitors | Patch | | @kinobi-so/renderers | Patch | | @kinobi-so/node-types | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

lorisleiva commented 2 months ago

Hey, thanks for fixing the error message. However, could you please keep the instruction variable in the error context? This enables people to access the instruction node if they catch the error.

EDIT: could you also add a patch changeset by running changeset in your terminal? This will make it possible to trigger a new release once merged.