Skip to content

Commit

Permalink
Merge pull request #35 from DanielSchiavini/refactor/ci-performance
Browse files Browse the repository at this point in the history
Fix lack of fund errors
  • Loading branch information
charles-cooper authored May 3, 2024
2 parents 4cb94d5 + 70cea12 commit 979bded
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from hexbytes import HexBytes

import vyper.evm.opcodes as evm_opcodes
from tests.evm_backends.base_env import BaseEnv, EvmError
from tests.evm_backends.base_env import BaseEnv, ExecutionReverted
from tests.evm_backends.pyevm_env import PyEvmEnv
from tests.evm_backends.revm_env import RevmEnv
from tests.utils import working_directory
Expand Down Expand Up @@ -314,7 +314,7 @@ def assert_side_effects_invoked(side_effects_contract, side_effects_trigger, n=1
@pytest.fixture(scope="module")
def tx_failed(env):
@contextmanager
def fn(exception=EvmError, exc_text=None):
def fn(exception=ExecutionReverted, exc_text=None):
with pytest.raises(exception) as excinfo:
yield

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_initial_state(market_maker):
def test_initiate(env, market_maker, erc20, tx_failed):
a0 = env.accounts[0]
ether, ethers = to_wei(1, "ether"), to_wei(2, "ether")
env.set_balance(a0, ethers)
env.set_balance(a0, ethers * 2)
erc20.approve(market_maker.address, ethers)
market_maker.initiate(erc20.address, ether, value=ethers)
assert market_maker.totalEthQty() == ethers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ def get_balance():


def test_initial_state(env, tx_failed, get_contract, get_balance, contract_code):
env.set_balance(env.deployer, to_wei(2, "ether"))
# Initial deposit has to be divisible by two
with tx_failed():
get_contract(contract_code, value=13)
env.set_balance(env.deployer, to_wei(2, "ether"))
# Seller puts item up for sale
a0_pre_bal, a1_pre_bal = get_balance()
c = get_contract(contract_code, value=to_wei(2, "ether"))
Expand Down Expand Up @@ -73,8 +73,8 @@ def test_abort(env, tx_failed, get_balance, get_contract, contract_code):

def test_purchase(env, get_contract, tx_failed, get_balance, contract_code):
a0, a1, a2, a3 = env.accounts[:4]
env.set_balance(a0, 10**18)
env.set_balance(a1, 10**18)
for a in env.accounts[:4]:
env.set_balance(a, 10**18)

init_bal_a0, init_bal_a1 = get_balance()
c = get_contract(contract_code, value=2)
Expand Down

0 comments on commit 979bded

Please sign in to comment.