mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-03 06:13:08 +00:00
fix: more descriptive error for epoch and id secret params
This commit is contained in:
parent
367ea4a0a8
commit
08e26da876
@ -97,8 +97,12 @@ export class Zerokit {
|
||||
epoch = epochIntToBytes(dateToEpoch(epoch));
|
||||
}
|
||||
|
||||
if (epoch.length !== 32) throw new Error("invalid epoch");
|
||||
if (idSecretHash.length !== 32) throw new Error("invalid id secret hash");
|
||||
if (epoch.length !== 32)
|
||||
throw new Error(`Epoch must be 32 bytes, got ${epoch.length}`);
|
||||
if (idSecretHash.length !== 32)
|
||||
throw new Error(
|
||||
`ID secret hash must be 32 bytes, got ${idSecretHash.length}`
|
||||
);
|
||||
if (index < 0) throw new Error("index must be >= 0");
|
||||
if (
|
||||
rateLimit < RATE_LIMIT_PARAMS.MIN_RATE ||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user