You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a nodejs script that i execute via node script.js
varWeb3=require('web3');varweb3=newWeb3();varEtherSim=require('ethersim');varsim=newEtherSim.init();web3.setProvider(sim.provider);//getting bytecode and ABI...sim.reset();sim.createAccounts(10,function(){sim.setBalance(web3.eth.accounts[0],123450000,function(){web3.eth.getAccounts(function(err,accs){varTestContract=web3.eth.contract(ABI);TestContract.new({from: web3.eth.accounts[0],gas : 3000000,data: bytecode},function(err,deployedContract){console.log(deployedContract);//sim.mine() //should be required to get address?vartransactionReceipt=web3.eth.getTransactionReceipt(deployedContract.transactionHash);console.log(transactionReceipt.contractAddress);//sim.reset(); never ends});});});});
I get the following error :
/vagrant/node_modules/web3/lib/web3/contract.js:128
filter.stopWatching();
^
TypeError: Cannot read property 'stopWatching' of undefined
at Object.callback (/vagrant/node_modules/web3/lib/web3/contract.js:128:35)
at /vagrant/node_modules/web3/lib/web3/method.js:142:25
at /vagrant/node_modules/web3/lib/web3/requestmanager.js:89:9
at /vagrant/node_modules/ethersim/lib/manager.js:60:7
at Manager.eth_getCode (/vagrant/node_modules/ethersim/lib/manager.js:110:10)
at Manager.request (/vagrant/node_modules/ethersim/lib/manager.js:64:19)
at TestProvider.sendAsync (/vagrant/node_modules/ethersim/lib/provider.js:11:23)
at RequestManager.sendAsync (/vagrant/node_modules/web3/lib/web3/requestmanager.js:80:19)
at Eth.send [as getCode] (/vagrant/node_modules/web3/lib/web3/method.js:141:42)
at Object.callback (/vagrant/node_modules/web3/lib/web3/contract.js:122:39)
if I uncomment the last sim.reset() node hang
any idea?
The text was updated successfully, but these errors were encountered:
Looking at the code it seems a bit wierd that the callback given to Contract creation can be called multiple times (this is web3).
But the problem is not really that. The problem is that after the callback is performed there is this function:
checkForContractAddress
that expect contract._eth.filter to be defined (as a function) but it is undefined
This function is in web3 but maybe ethersim should make sure such filter function is defined?
Here is a nodejs script that i execute via node script.js
I get the following error :
if I uncomment the last sim.reset() node hang
any idea?
The text was updated successfully, but these errors were encountered: