From 48668aa36eaa28d54f4d43c650b22587fe2c67bb Mon Sep 17 00:00:00 2001 From: stubbsta Date: Thu, 12 Jun 2025 15:17:08 +0200 Subject: [PATCH] Add check before installing anvil --- scripts/install_anvil.sh | 19 ++++++++++--------- .../rln_keystore_generator.nim | 1 - .../group_manager/on_chain/group_manager.nim | 4 ---- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/scripts/install_anvil.sh b/scripts/install_anvil.sh index 13d5f8dfd..ba69e9509 100755 --- a/scripts/install_anvil.sh +++ b/scripts/install_anvil.sh @@ -2,13 +2,14 @@ # Install Anvil +if ! command -v anvil &> /dev/null; then + BASE_DIR="${XDG_CONFIG_HOME:-$HOME}" + FOUNDRY_DIR="${FOUNDRY_DIR-"$BASE_DIR/.foundry"}" + FOUNDRY_BIN_DIR="$FOUNDRY_DIR/bin" -BASE_DIR="${XDG_CONFIG_HOME:-$HOME}" -FOUNDRY_DIR="${FOUNDRY_DIR-"$BASE_DIR/.foundry"}" -FOUNDRY_BIN_DIR="$FOUNDRY_DIR/bin" - -curl -L https://foundry.paradigm.xyz | bash -# Extract the source path from the download result -echo "foundryup_path: $FOUNDRY_BIN_DIR" -# run foundryup -$FOUNDRY_BIN_DIR/foundryup \ No newline at end of file + curl -L https://foundry.paradigm.xyz | bash + # Extract the source path from the download result + echo "foundryup_path: $FOUNDRY_BIN_DIR" + # run foundryup + $FOUNDRY_BIN_DIR/foundryup +fi \ No newline at end of file diff --git a/tools/rln_keystore_generator/rln_keystore_generator.nim b/tools/rln_keystore_generator/rln_keystore_generator.nim index c5c0c95c0..ee5911abf 100644 --- a/tools/rln_keystore_generator/rln_keystore_generator.nim +++ b/tools/rln_keystore_generator/rln_keystore_generator.nim @@ -85,7 +85,6 @@ proc doRlnKeystoreGenerator*(conf: RlnKeystoreGeneratorConf) = quit(1) # 5. register on-chain - debug "credential idcommit", idCommitment = credential.idCommitment.inHex() try: waitFor groupManager.register(credential, conf.userMessageLimit) except Exception, CatchableError: diff --git a/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim b/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim index e8cd564f6..9433a9687 100644 --- a/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim +++ b/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim @@ -577,7 +577,6 @@ method init*(g: OnchainGroupManager): Future[GroupManagerResult[void]] {.async.} let ethRpc: Web3 = (await establishConnection(g)).valueOr: return err("failed to connect to Ethereum clients: " & $error) - debug "fetching chainId" var fetchedChainId: UInt256 g.retryWrapper(fetchedChainId, "Failed to get the chain id"): await ethRpc.provider.eth_chainId() @@ -605,8 +604,6 @@ method init*(g: OnchainGroupManager): Future[GroupManagerResult[void]] {.async.} let contractAddress = web3.fromHex(web3.Address, g.ethContractAddress) let wakuRlnContract = ethRpc.contractSender(WakuRlnContract, contractAddress) - debug "contract address", - contractAddress = contractAddress, ethContractAddress = g.ethContractAddress g.ethRpc = some(ethRpc) g.wakuRlnContract = some(wakuRlnContract) @@ -668,7 +665,6 @@ method init*(g: OnchainGroupManager): Future[GroupManagerResult[void]] {.async.} tx.chainId = Opt.some(g.chainId) let resultBytes = await g.ethRpc.get().provider.eth_call(tx, "latest") - debug "resultBytes", resultBytes = resultBytes, len = resultBytes.len if resultBytes.len == 0: return err("No result returned for function call: " & $functionSignature) let membershipExists = resultBytes.len == 32 and resultBytes[^1] == 1'u8