fix: overly strict key length check when decoding stake instructions

This commit is contained in:
Justin Starry 2020-05-19 15:11:22 +08:00 committed by Michael Vines
parent 2116e2b181
commit 5f0b182a3b
1 changed files with 2 additions and 2 deletions

View File

@ -331,9 +331,9 @@ export class StakeInstruction {
* @private
*/
static checkKeyLength(keys: Array<any>, expectedLength: number) {
if (keys.length !== expectedLength) {
if (keys.length < expectedLength) {
throw new Error(
`invalid instruction; key length mismatch ${keys.length} != ${expectedLength}`,
`invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`,
);
}
}