diff --git a/tools/rln_db_inspector/rln_db_inspector.nim b/tools/rln_db_inspector/rln_db_inspector.nim index d06b582f19..864f506127 100644 --- a/tools/rln_db_inspector/rln_db_inspector.nim +++ b/tools/rln_db_inspector/rln_db_inspector.nim @@ -19,29 +19,23 @@ logScope: when isMainModule: {.pop.} # 1. load configuration - let conf = RlnDbInspectorConf.loadConfig().isOkOr: - error "failure while loading the configuration", error=confRes.error + let conf = RlnDbInspectorConf.loadConfig().valueOr: + error "failure while loading the configuration", error quit(1) trace "configuration", conf = $conf # 2. initialize rlnInstance - let rlnInstanceRes = createRLNInstance(d=20, - tree_path = conf.rlnRelayTreePath) - if rlnInstanceRes.isErr(): - error "failure while creating RLN instance", error=rlnInstanceRes.error + let rlnInstance = createRLNInstance(d=20, + tree_path = conf.rlnRelayTreePath).valueOr: + error "failure while creating RLN instance", error quit(1) - let rlnInstance = rlnInstanceRes.get() - # 3. get metadata - let metadataGetRes = rlnInstance.getMetadata() - if metadataGetRes.isErr(): - error "failure while getting RLN metadata", error=metadataGetRes.error + let metadata = rlnInstance.getMetadata().valueOr: + error "failure while getting RLN metadata", error quit(1) - let metadata = metadataGetRes.get() - info "RLN metadata", lastProcessedBlock = metadata.lastProcessedBlock, chainId = metadata.chainId, contractAddress = metadata.contractAddress,