Skip to content

Commit

Permalink
fix set accounts interface... for the LAST TIME
Browse files Browse the repository at this point in the history
  • Loading branch information
jubeless committed Nov 17, 2020
1 parent 3d0443c commit c4868dd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions serum/instruction.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@ func DecodeInstruction(accounts []solana.PublicKey, compiledInstruction *solana.
}

if v, ok := inst.Impl.(AccountSettable); ok {
v.setAccounts(accounts, compiledInstruction.Accounts)
err := v.setAccounts(accounts, compiledInstruction.Accounts)
if err != nil {
return nil, fmt.Errorf("unable to set accounts for instruction: %w", err)
}
}

return inst, nil
}

type AccountSettable interface {
setAccounts(accounts []solana.PublicKey, instructionActIdx []uint8)
setAccounts(accounts []solana.PublicKey, instructionActIdx []uint8) error
}

type Instruction struct {
Expand Down

0 comments on commit c4868dd

Please sign in to comment.