Skip to content

Commit

Permalink
Pass RPCEndpoint properly
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaStebaev committed Apr 5, 2024
1 parent 6da3a2a commit c76de08
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions skale/utils/contracts_provision/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# along with SKALE.py. If not, see <https://www.gnu.org/licenses/>.

from web3 import Web3
from web3.types import RPCEndpoint

from skale.contracts.manager.nodes import NodeStatus
from skale.transactions.result import TxRes
Expand Down Expand Up @@ -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'])


Expand Down

0 comments on commit c76de08

Please sign in to comment.