首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >web3py maxPriorityFeePerGas不工作?

web3py maxPriorityFeePerGas不工作?
EN

Stack Overflow用户
提问于 2021-12-25 10:18:47
回答 1查看 1.3K关注 0票数 2

我正在尝试使用maxPriorityFeePerGas,maxFeePerGas正确地设置天然气价格(BSC区块链),但我总是收到一个错误:

代码语言:javascript
复制
ValueError: {'code': -32601, 'message': 'the method eth_maxPriorityFeePerGas does not exist/is not available'}

它只适用于我的gasPrice设置。我是不是做错了什么,或者这些方法还没有在web3 python中实现呢?

代码语言:javascript
复制
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

EN

回答 1

Stack Overflow用户

发布于 2022-01-06 19:43:02

很明显,你在处理遗留事务。文档说:

仅支持遗留交易的天然气价格策略。伦敦分叉引入了maxFeePerGasmaxPriorityFeePerGas事务参数,只要有可能,这些参数就应该在gasPrice上使用。对于Ethereum (遗产)交易来说,天然气价格是一项微妙的财产。因此,Web3包含一个用于配置它的API。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70479320

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档