Skip to content

Commit

Permalink
pr review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wolovim committed Oct 26, 2020
1 parent 3071442 commit 9204d84
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 18 deletions.
2 changes: 1 addition & 1 deletion tests/integration/generate_fixtures/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def mine_block(web3):
def mine_transaction_hash(web3, txn_hash):
start_time = time.time()
web3.geth.miner.start(1)
while time.time() < start_time + 240:
while time.time() < start_time + 120:
try:
receipt = web3.eth.getTransactionReceipt(txn_hash)
except TransactionNotFound:
Expand Down
3 changes: 0 additions & 3 deletions tests/integration/generate_fixtures/parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@
"minimumDifficulty": "0x020000",
"difficultyBoundDivisor": "0x0800",
"durationLimit": "0x0d",
# "blockReward": "0x4563918244F40000", # homestead
# "blockReward": "0x29a2241af62c0000", # byzantium
"blockReward": "0x1bc16d674ec80000", # constantinople
"difficultyBombDelays": {
# "0x0": "0x2dc6c0", # byzantium
"0x0": "0x1e8480",
},
"homesteadTransition": 0,
Expand Down
11 changes: 0 additions & 11 deletions tests/integration/test_ethereum_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ def revert_contract(web3, revert_contract_factory, revert_contract_deploy_txn_ha
return revert_contract_factory(contract_address)


@pytest.fixture(scope="module")
def revert_contract_address(revert_contract, address_conversion_func):
return address_conversion_func(revert_contract.address)


UNLOCKABLE_PRIVATE_KEY = '0x392f63a79b1ff8774845f3fa69de4a13800a59e7083f5187f1558f0797ad0f01'


Expand Down Expand Up @@ -332,12 +327,6 @@ def test_eth_chainId(self, web3):
def test_eth_getTransactionReceipt_mined(self, web3, block_with_txn, mined_txn_hash):
super().test_eth_getTransactionReceipt_mined(web3, block_with_txn, mined_txn_hash)

def test_eth_call_revert_with_msg(self, web3, revert_contract, unlocked_account) -> None:
super().test_eth_call_revert_with_msg(web3, revert_contract, unlocked_account)

def test_eth_estimateGas_revert_with_msg(self, web3, revert_contract, unlocked_account) -> None:
super().test_eth_estimateGas_revert_with_msg(web3, revert_contract, unlocked_account)


class TestEthereumTesterVersionModule(VersionModuleTest):
pass
Expand Down
Binary file removed tests/integration/tester.zip
Binary file not shown.
4 changes: 1 addition & 3 deletions web3/_utils/method_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,11 @@ def get_revert_reason(response: RPCResponse) -> str:
See also https://solidity.readthedocs.io/en/v0.6.3/control-structures.html#revert
"""
assert 'error' in response
if not isinstance(response['error'], dict):
return None

data = response['error'].get('data', '')

# Parity/OpenEthereum case:
data = response['error'].get('data', '')
if data.startswith('Reverted '):
# "Reverted", function selector and offset are always the same for revert errors
prefix = 'Reverted 0x08c379a00000000000000000000000000000000000000000000000000000000000000020' # noqa: 501
Expand Down

0 comments on commit 9204d84

Please sign in to comment.