fix: key length check when decoding instructions

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

View File

@ -471,9 +471,9 @@ export class SystemInstruction {
* @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}`,
);
}
}