Skip to content

Commit 2648ec8

Browse files
committed
Add all signature lengths in SIG and DATASIG length checks
1 parent 4d10da6 commit 2648ec8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/cashscript/src/Argument.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ export function encodeFunctionArgument(argument: FunctionArgument, typeStr: stri
5959
throw Error(`Value for type ${type} should be a Uint8Array or hex string`);
6060
}
6161

62-
// Redefine SIG as a bytes65 (Schnorr) or bytes70, bytes71, bytes72 (ECDSA)
62+
// Redefine SIG as a bytes65 (Schnorr) or bytes71, bytes72, bytes73 (ECDSA)
6363
if (type === PrimitiveType.SIG && argument.byteLength !== 0) {
64-
if (![65, 70, 71, 72].includes(argument.byteLength)) {
64+
if (![65, 71, 72, 73].includes(argument.byteLength)) {
6565
throw new TypeError(`bytes${argument.byteLength}`, type);
6666
}
6767
type = new BytesType(argument.byteLength);
6868
}
6969

70-
// Redefine DATASIG as a bytes64 (Schnorr) or bytes70 (ECDSA) so it is included in the size checks below
70+
// Redefine DATASIG as a bytes64 (Schnorr) or bytes70, bytes71, bytes72 (ECDSA) so it is included in the size checks below
7171
if (type === PrimitiveType.DATASIG && argument.byteLength !== 0) {
72-
if (![64, 70].includes(argument.byteLength)) {
72+
if (![64, 70, 71, 72].includes(argument.byteLength)) {
7373
throw new TypeError(`bytes${argument.byteLength}`, type);
7474
}
7575
type = new BytesType(argument.byteLength);

0 commit comments

Comments
 (0)