Skip to content

Commit

Permalink
Make adjustments for EIP1559 (default on web3 > 5.24)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uxio0 committed Mar 22, 2022
1 parent c666ba4 commit 8dd7647
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- 5432:5432
steps:
- name: Setup and run ganache
run: docker run --detach --publish 8545:8545 --network-alias ganache -e DOCKER=true trufflesuite/ganache:latest --defaultBalanceEther 10000 --gasLimit 10000000 -a 30 --chain.chainId 1337 --chain.networkId 1337 -k berlin -d
run: docker run --detach --publish 8545:8545 --network-alias ganache -e DOCKER=true trufflesuite/ganache:latest --defaultBalanceEther 10000 --gasLimit 10000000 -a 30 --chain.chainId 1337 --chain.networkId 1337 -d
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
Expand Down
1 change: 0 additions & 1 deletion gnosis/eth/tests/test_ethereum_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@ def test_send_unsigned_transaction(self):
"to": to,
"value": value,
"gas": 23000,
"gasPrice": 1,
}

with self.assertRaisesMessage(
Expand Down
5 changes: 3 additions & 2 deletions gnosis/eth/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from eth_account.signers.local import LocalAccount
from web3 import Web3
from web3.contract import Contract
from web3.types import TxParams

from ..contracts import get_example_erc20_contract

Expand Down Expand Up @@ -39,14 +40,14 @@ def just_test_if_mainnet_node() -> str:
return mainnet_node_url


def send_tx(w3: Web3, tx, account: LocalAccount) -> bytes:
def send_tx(w3: Web3, tx: TxParams, account: LocalAccount) -> bytes:
tx["from"] = account.address
if "nonce" not in tx:
tx["nonce"] = w3.eth.get_transaction_count(
account.address, block_identifier="pending"
)

if "gasPrice" not in tx:
if "gasPrice" not in tx and "maxFeePerGas" not in tx:
tx["gasPrice"] = w3.eth.gas_price

if "gas" not in tx:
Expand Down
2 changes: 1 addition & 1 deletion gnosis/safe/safe_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def execute(
else:
tx_parameters = {
"from": sender_account.address,
"gasPrice": tx_gas_price or self.gas_price or self.w3.eth.gas_price,
"gasPrice": tx_gas_price or self.w3.eth.gas_price,
}

if tx_gas:
Expand Down
2 changes: 1 addition & 1 deletion gnosis/safe/tests/test_real_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_node_exceptions(self):
"value": 0,
"data": b"",
"gas": 25000,
"gasPrice": 1,
"gasPrice": ethereum_service.w3.eth.gas_price,
},
private_key=random_sender_account.key,
)
Expand Down
2 changes: 1 addition & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ps aux | grep ganache-cli | grep -v grep > /dev/null
if [ $? -eq 1 ]; then
echo 'Running Ganache-Cli'
ganache-cli --defaultBalanceEther 10000 --gasLimit 10000000 -a 30 --chain.chainId 1337 --chain.networkId 1337 -d -k berlin > /dev/null &
ganache-cli --defaultBalanceEther 10000 --gasLimit 10000000 -a 30 --chain.chainId 1337 --chain.networkId 1337 -d > /dev/null &
GANACHE_PID=$!
sleep 3
fi
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

setup(
name="gnosis-py",
version="3.8.3",
version="3.9.0",
packages=find_packages(),
package_data={"gnosis": ["py.typed"]},
install_requires=requirements,
Expand Down

0 comments on commit 8dd7647

Please sign in to comment.