mirror of
https://github.com/logos-messaging/js-rln.git
synced 2026-01-02 13:43:06 +00:00
fix type issue
This commit is contained in:
parent
aece0e3dc3
commit
73e3b50ce8
12
src/rln.ts
12
src/rln.ts
@ -271,14 +271,14 @@ export class RLNInstance {
|
||||
throw Error("RLN Contract is not initialized.");
|
||||
}
|
||||
|
||||
if (!options.identity || !options.signature) {
|
||||
throw Error("Missing signature or identity to register membership.");
|
||||
let identity = "identity" in options && options.identity;
|
||||
|
||||
if ("signature" in options) {
|
||||
identity = await this.generateSeededIdentityCredential(options.signature);
|
||||
}
|
||||
|
||||
let identity = options.identity;
|
||||
|
||||
if (options.signature) {
|
||||
identity = await this.generateSeededIdentityCredential(signature);
|
||||
if (!identity) {
|
||||
throw Error("Missing signature or identity to register membership.");
|
||||
}
|
||||
|
||||
return this.contract.registerWithIdentity(identity);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user