fix set accounts interface... for the LAST TIME

This commit is contained in:
Julien Cassis 2020-11-17 18:14:21 -05:00
parent 3d0443cf4d
commit c4868dd564
1 changed files with 5 additions and 2 deletions

View File

@ -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 {