LiskArchive / lisk-sdk

🔩 Lisk software development kit
https://lisk.com
Apache License 2.0
2.72k stars 454 forks source link

if mandatoryKeys.length + optionalKeys.length <= 0 #7445

Closed sitetester closed 9 months ago

sitetester commented 2 years ago

Description

There is a <= 0 check in this code block. We should remove < check.

// Check if key count is out of bounds
if (
    mandatoryKeys.length + optionalKeys.length > MAX_NUMBER_OF_SIGNATURES ||
    mandatoryKeys.length + optionalKeys.length <= 0
) {
    return {
        status: VerifyStatus.FAIL,
        error: new Error('The count of Mandatory and Optional keys should be between 1 and 64.'),
    };
}

Motivation

Since mandatoryKeys & optionalKeys are both arrays, their length can never be less than 0.

Additional Information

framework/src/modules/auth/commands/register_multisignature.ts

shuse2 commented 9 months ago

Closing this issue for no activity