Skip to content

Add exception to snake case in instruction name for Anchor #96

@GuidoDipietro

Description

@GuidoDipietro

Describe the bug
Anchor instructions named something_number where "number" is an integer fail from the client side with "Fallback instructions are not supported" as it derives the discriminator incorrectly.

To Reproduce
Name an instruction instruction_1 on the CIDL and try to call it.

Extension (mark with an X the extension):

  • Solana Native [ ]
  • Solana Anchor [x]

Solution
Match /_([0-9])*/ and replace by $(1). Basically, remove the last underscore if the instruction name finishes with _number.

Metadata

Metadata

Labels

BugThis is an item that causes unwanted behaviorTriageThis item needs to be prioritize

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions