在运行测试时,我会得到以下错误:
def test_can_pick_winner():
if network.show_active() in LOCAL_BLOCKCHAIN_ENVIRONMENTS:
pytest.skip()
lottery = deploy_lottery()
account = get_account()
lottery.startLottery({"from": account})
lottery.enter({"from": account, "value": lottery.getEntranceFee()})
lottery.enter({"from": account, "value": lottery.getEntranceFee()})
fund_with_link
> lottery.endLottery({"from": account})
E ValueError: Gas estimation failed: 'execution reverted'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually.
tests/integration/test_lottery_integration.py:17: ValueError
============================================================================================================= short test summary info ==============================================================================================================
FAILED tests/integration/test_lottery_integration.py::test_can_pick_winner - ValueError: Gas estimation failed: 'execution reverted'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually.知道出了什么问题吗?
发布于 2022-03-13 18:53:10
我也遇到了同样的问题,我更改了vrf_coordinator =‘0xb3dCcb4Cf7a26f6cf6Cf6Cf5A73875B7BC655B’,并在brownie-config.yaml文件中验证= false。因为这是vrf合同版本1 https://docs.chain.link/docs/vrf-contracts/v1/的地址.这对我有用!
https://ethereum.stackexchange.com/questions/121974
复制相似问题