Skip to content

Commit

Permalink
fix: wrap non-array instruction args as structs (#995)
Browse files Browse the repository at this point in the history
  • Loading branch information
silaslenihan authored Dec 31, 2024
1 parent 4d88833 commit 0df579b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/solana/codec/solana.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ func asStruct(
named[idx+desLen] = commonencodings.NamedTypeCodec{Name: cases.Title(language.English, cases.NoLower).String(fieldName), Codec: typedCodec}
}

// accounts have to be in a struct, instruction args don't
if len(named) == 1 && isInstructionArgs {
// accounts have to be in a struct, instruction args don't if they're an array
if len(named) == 1 && isInstructionArgs && (fields[0].Type.IsIdlTypeVec() || fields[0].Type.IsArray()) {
return name, named[0].Codec, nil
}

Expand Down

0 comments on commit 0df579b

Please sign in to comment.