diff --git a/core/payment-driver/erc20next/config-payments.toml b/core/payment-driver/erc20next/config-payments.toml index 7a3543e41e..2974e5b752 100644 --- a/core/payment-driver/erc20next/config-payments.toml +++ b/core/payment-driver/erc20next/config-payments.toml @@ -30,7 +30,7 @@ max-fee-per-gas = 10.0 gas-left-warning-limit = 1000000 transaction-timeout = 100 token = { address = "0x33af15c79d64b85ba14aaffaa4577949104b22e8", symbol = "tGLM" } -multi-contract = { address = "0x7777784f803a7bf1d7f115f849d29ce5706da64a", max-at-once = 10 } +# multi-contract = { address = "0x7777784f803a7bf1d7f115f849d29ce5706da64a", max-at-once = 10 } confirmation-blocks = 1 block-explorer-url = "https://goerli.etherscan.io" diff --git a/core/payment-driver/erc20next/src/service.rs b/core/payment-driver/erc20next/src/service.rs index 7f1a362b6d..d30101907d 100644 --- a/core/payment-driver/erc20next/src/service.rs +++ b/core/payment-driver/erc20next/src/service.rs @@ -2,12 +2,13 @@ The service that binds this payment driver into yagna via GSB. */ -use std::env; +use std::{env, str::FromStr}; // External crates use erc20_payment_lib::config; use erc20_payment_lib::config::AdditionalOptions; use erc20_payment_lib::misc::load_private_keys; use erc20_payment_lib::runtime::start_payment_engine; +use ethereum_types::H160; use std::sync::Arc; // Workspace uses @@ -62,17 +63,28 @@ impl Erc20NextService { }; let env_overrides = [ - ("goerli", "GOERLI_GETH_ADDR"), - ("polygon", "POLYGON_GETH_ADDR"), - ("mumbai", "MUMBAI_GETH_ADDR"), + ("goerli", "GOERLI_GETH_ADDR", "GOERLI_TGLM_CONTRACT_ADDRESS"), + ( + "polygon", + "POLYGON_GETH_ADDR", + "POLYGON_GLM_CONTRACT_ADDRESS", + ), ]; for env_override in env_overrides { - if let Ok(addr) = env::var(env_override.1) { - log::info!("Geth addr override: {addr}"); - if let Some(goerli_conf) = config.chain.get_mut(env_override.0) { + log::info!("Checking overrides for {}", env_override.0); + if let Some(goerli_conf) = config.chain.get_mut(env_override.0) { + if let Ok(addr) = env::var(env_override.1) { + log::info!("Geth addr: {addr}"); + goerli_conf.rpc_endpoints = vec![addr]; } + if let Ok(addr) = env::var(env_override.2) { + log::info!("Token addr: {addr}"); + + goerli_conf.token.as_mut().unwrap().address = + H160::from_str(&addr).unwrap(); + } } } diff --git a/goth_tests/pyproject.toml b/goth_tests/pyproject.toml index c7f18f0604..20a53dd18c 100644 --- a/goth_tests/pyproject.toml +++ b/goth_tests/pyproject.toml @@ -8,10 +8,7 @@ version = "0.1.1" description = "Integration tests for yagna" authors = ["GolemFactory "] license = "LGPL-3.0-or-later" -classifiers = [ - "Development Status :: 3 - Alpha", - "Framework :: AsyncIO", -] +classifiers = ["Development Status :: 3 - Alpha", "Framework :: AsyncIO"] repository = "https://github.com/golemfactory/yagna" documentation = "https://handbook.golem.network" readme = "README.md" @@ -22,9 +19,9 @@ pytest = "^6.2" pytest-asyncio = "^0.20.2" pytest-rerunfailures = "^10.3" pytest-split = "^0.8.1" -goth = "^0.15.0" +# goth = "^0.15.0" # to use development goth version uncomment below -# goth = { git = "https://github.com/golemfactory/goth.git", rev = "d2951a62e2a7cf0712f7f4a66c4a080777841611" } +goth = { git = "https://github.com/golemfactory/goth.git", rev = "664c85965cee5fed14c5b42e81ff2ca343184e08" } [tool.poetry.dev-dependencies] black = "^20.8b1"