From c76de083ca8e3697615a4ceaa3d1032370a7f72e Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Fri, 5 Apr 2024 15:24:38 +0300 Subject: [PATCH] Pass RPCEndpoint properly --- skale/utils/contracts_provision/main.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/skale/utils/contracts_provision/main.py b/skale/utils/contracts_provision/main.py index 38542390..18370cb6 100644 --- a/skale/utils/contracts_provision/main.py +++ b/skale/utils/contracts_provision/main.py @@ -18,6 +18,7 @@ # along with SKALE.py. If not, see . from web3 import Web3 +from web3.types import RPCEndpoint from skale.contracts.manager.nodes import NodeStatus from skale.transactions.result import TxRes @@ -48,18 +49,19 @@ def _skip_evm_time(web3: Web3, seconds: int, mine: bool = True) -> int: """For test purposes only, works only with hardhat node""" - res = web3.provider.make_request('evm_increaseTime', [seconds]) - web3.provider.make_request("evm_mine", []) + res = web3.provider.make_request(RPCEndpoint('evm_increaseTime'), [seconds]) + if mine: + web3.provider.make_request(RPCEndpoint('evm_mine'), []) return int(res['result']) def set_automining(web3: Web3, value: bool) -> int: - res = web3.provider.make_request('evm_setAutomine', [value]) + res = web3.provider.make_request(RPCEndpoint('evm_setAutomine'), [value]) return int(res['result']) def set_mining_interval(web3: Web3, ms: int) -> int: - res = web3.provider.make_request('evm_setIntervalMining', [ms]) + res = web3.provider.make_request(RPCEndpoint('evm_setIntervalMining'), [ms]) return int(res['result'])