Skip to content

bug with method buildTransaction in the version 5.25.0 #2307

Closed
@AHTOH2001

Description

@AHTOH2001
  • Version: 5.25.0
  • Python: 3.9.7
  • OS: linux/win

What is wrong?

The buildTransaction method without specifying gasPrice raises ValueError {'code': -32601, 'message': 'the method eth_maxPriorityFeePerGas does not exist/is not available'}

Snippet to reproduce the issue

from web3 import Web3
import json

web3 = Web3(Web3.HTTPProvider("..."))
# Any ERC-20 contract
contract_addr = '...'
from_addr = '...'
to_addr = '...'

with open('abi.json', 'r') as fp:
    abi = json.load(fp)

contract = web3.eth.contract(contract_addr, abi=abi)

nonce = web3.eth.get_transaction_count(from_addr)
transaction = contract.functions.transfer(
    to_addr,
    web3.toWei(0.1, 'ether')
)
transaction = transaction.buildTransaction({
    'from': from_addr,
    'chainId': 56,
    'nonce': nonce,    
    # 'gasPrice': web3.toWei(5, 'gwei')
})

How can it be fixed?

  • Use previous version 5.24.0 in which it was working perfectly
  • Specify explicitly the gas price

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions