【发布时间】:2021-12-25 10:18:47
【问题描述】:
我正在尝试使用 maxPriorityFeePerGas、maxFeePerGas 正确设置 gas 价格(BSC 区块链),但我总是收到错误消息:
ValueError: {'code': -32601, 'message': 'the method eth_maxPriorityFeePerGas does not exist/is not available'}
它仅适用于 gasPrice 设置。我做错了什么还是这些方法还没有在 web3 python 中实现?
contract_tx = contract.functions.check([var1, var2, var3],[int1, int2, int3], sign_buy).buildTransaction(
{'nonce':nonce,
'gas': 250000,
# 'maxPriorityFeePerGas': web3.toWei(20,'gwei'),
# 'maxFeePerGas': web3.toWei(30,'gwei'),
'gasPrice': web3.toWei(8,'gwei')
}
)
signed_tx = web3.eth.account.signTransaction(contract_tx, pkey)
hash = web3.eth.send_raw_transaction(signed_tx.rawTransaction)
web3 - 5.25.0
【问题讨论】: