chore(v1): fix deprecation warnings

This commit is contained in:
Lorenzo Delgado 2023-02-06 10:00:57 +01:00 committed by GitHub
parent 528cc5ad34
commit e56dbd06d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -72,7 +72,7 @@ proc setupWakuRPC*(node: EthereumNode, keys: KeyStorage, rpcsrv: RpcServer,
##
## Returns key identifier on success and an error on failure.
result = generateRandomID(rng[]).Identifier
keys.asymKeys.add(result.string, KeyPair.random(rng[]))
keys.asymKeys[result.string] = KeyPair.random(rng[])
rpcsrv.rpc("waku_addPrivateKey") do(key: PrivateKey) -> Identifier:
## Stores the key pair, and returns its ID.
@ -82,7 +82,7 @@ proc setupWakuRPC*(node: EthereumNode, keys: KeyStorage, rpcsrv: RpcServer,
## Returns key identifier on success and an error on failure.
result = generateRandomID(rng[]).Identifier
keys.asymKeys.add(result.string, key.toKeyPair())
keys.asymKeys[result.string] = key.toKeyPair()
rpcsrv.rpc("waku_deleteKeyPair") do(id: Identifier) -> bool:
## Deletes the specifies key if it exists.
@ -133,7 +133,7 @@ proc setupWakuRPC*(node: EthereumNode, keys: KeyStorage, rpcsrv: RpcServer,
if randomBytes(key) != key.len:
raise newException(KeyGenerationError, "Failed generating key")
keys.symKeys.add(result.string, key)
keys.symKeys[result.string] = key
rpcsrv.rpc("waku_addSymKey") do(key: SymKey) -> Identifier:
@ -144,7 +144,7 @@ proc setupWakuRPC*(node: EthereumNode, keys: KeyStorage, rpcsrv: RpcServer,
## Returns key identifier on success and an error on failure.
result = generateRandomID(rng[]).Identifier
keys.symKeys.add(result.string, key)
keys.symKeys[result.string] = key
rpcsrv.rpc("waku_generateSymKeyFromPassword") do(password: string) -> Identifier:
## Generates the key from password, stores it, and returns its ID.
@ -161,7 +161,7 @@ proc setupWakuRPC*(node: EthereumNode, keys: KeyStorage, rpcsrv: RpcServer,
raise newException(KeyGenerationError, "Failed generating key")
result = generateRandomID(rng[]).Identifier
keys.symKeys.add(result.string, symKey)
keys.symKeys[result.string] = symKey
rpcsrv.rpc("waku_hasSymKey") do(id: Identifier) -> bool:
## Returns true if there is a key associated with the name string.

View File

@ -593,7 +593,7 @@ proc subscribeFilter*(
else:
filter.handler = handler
filters.add(id, filter)
filters[id] = filter
debug "Filter added", filter = id
return id