From b3890ca8e9cf5b2fd986b567dd12280226f9f203 Mon Sep 17 00:00:00 2001 From: Sergei Tikhomirov Date: Fri, 13 Dec 2024 17:54:04 +0100 Subject: [PATCH] move Web3 provider RPC URL into env variable --- tests/incentivization/test_poc.nim | 7 +++++-- waku/incentivization/txid_proof.nim | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/incentivization/test_poc.nim b/tests/incentivization/test_poc.nim index 0495a44344..d6fadb1e6d 100644 --- a/tests/incentivization/test_poc.nim +++ b/tests/incentivization/test_poc.nim @@ -1,7 +1,7 @@ {.used.} import - std/[options], testutils/unittests, chronos, web3, stew/byteutils, stint, strutils + std/[options], testutils/unittests, chronos, web3, stew/byteutils, stint, strutils, os import waku/[node/peer_manager, waku_core], @@ -19,7 +19,10 @@ const TxHashSimpleTransfer* = TxHash.fromHex("0xa3985984b2ec3f1c3d473eb57a4820a56748f25dabbf9414f2b8380312b439cc") const ExpectedToAddress = Address.fromHex("0x5e809a85aa182a9921edd10a4163745bb3e36284") const ExpectedValue = 200500000000005063.u256 -const EthClient = "https://sepolia.infura.io/v3/470c2e9a16f24057aee6660081729fb9" + +# To set up the environment variable (replace Infura with your provider if needed): +# $ export WEB3_RPC_URL="https://sepolia.infura.io/v3/YOUR_API_KEY" +const EthClient = os.getEnv("WEB3_RPC_URL") suite "Waku Incentivization PoC Eligibility Proofs": ## Tests for service incentivization PoC. diff --git a/waku/incentivization/txid_proof.nim b/waku/incentivization/txid_proof.nim index 3a4d7dcdef..3f5b7c527a 100644 --- a/waku/incentivization/txid_proof.nim +++ b/waku/incentivization/txid_proof.nim @@ -36,6 +36,7 @@ proc isEligibleTxId*( if eligibilityProof.proofOfPayment.isNone(): return err("Eligibility proof is empty") var web3: Web3 + echo "WEB3_RPC_URL: " & ethClient try: web3 = await newWeb3(ethClient) except ValueError: