Skip to content

Commit

Permalink
fix set account inerface
Browse files Browse the repository at this point in the history
  • Loading branch information
jubeless committed Nov 17, 2020
1 parent 2f2a32f commit 63e2f71
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 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)
}
err := v.setAccounts(accounts)
if err != nil {
return nil, fmt.Errorf("unable to set accounts for instructions: %w", err)
}

}
return inst, nil
}

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

type Instruction struct {
Expand Down

0 comments on commit 63e2f71

Please sign in to comment.