Skip to content

Commit

Permalink
fix: key length check when decoding instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarry committed May 19, 2020
1 parent 8813226 commit 00c6362
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/system-program.js
Expand Up @@ -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}`,
);
}
}
Expand Down

0 comments on commit 00c6362

Please sign in to comment.