def addCustomerAndFundsub(_subId, _cunsumerContract):
account = get_account()
if network.show_active() in LOCAL_BLOCKCHIAN_ENVIROMENTS:
VRF_contract = VRFCoordinatorV2Mock[-1]
else:
VRF_contract = Contract(
config["networks"][network.show_active()]["vrf_coordinator"]
)
add_tx = VRF_contract.addConsumer(_subId, _cunsumerContract, {"from": account})
add_tx.wait(1)
print("Add customer successful !")
amount = config["networks"][network.show_active()]["amount"]
fund_vrf_txn = VRF_contract.fundSubscription(_subId, amount, {"from": account})
fund_vrf_txn.wait(1)
print("Add and Fund successful")strong text
amount in config : amount : 1000000000000000000
addConsumer() work fine untill fundSubscription() showing error :
File ".\scripts\helpful_scipts.py", line 102, in addCustomerAndFundsub fund_vrf_txn = VRF_contract.fundSubscription(_subId, amount, {"from": account}) File "D:\python3_10\lib\site-packages\brownie\network\contract.py", line 1864, in call return self.transact(*args) File "D:\python3_10\lib\site-packages\brownie\network\contract.py", line 1737, in transact return tx["from"].transfer( File "D:\python3_10\lib\site-packages\brownie\network\account.py", line 644, in transfer receipt, exc = self._make_transaction( File "D:\python3_10\lib\site-packages\brownie\network\account.py", line 727, in _make_transaction raise VirtualMachineError(e) from None File "D:\python3_10\lib\site-packages\brownie\exceptions.py", line 93, in init raise ValueError(str(exc)) from None ValueError: Gas estimation failed: 'execution reverted'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually.
My wallet have 0.7 sepolia ETH and 19 Link