fix: when there is no instruction index, default to the current instruction by supplying u16:MAX

This commit is contained in:
steveluscher 2022-03-24 11:03:57 -07:00 committed by Steven Luscher
parent c73cdfd6ce
commit 9cf7720922

View File

@ -94,7 +94,11 @@ export class Ed25519Program {
const instructionData = Buffer.alloc(messageDataOffset + message.length);
const index = instructionIndex != null ? instructionIndex : 0;
const index =
instructionIndex == null
? 0xffff // An index of `u16::MAX` makes it default to the current instruction.
: instructionIndex;
ED25519_INSTRUCTION_LAYOUT.encode(
{
numSignatures,