StephenGrider / EthereumCasts

Companion repo to an Ethereum/Solidity course on Udemy
2.13k stars 1.31k forks source link

factory.methods.createCampaign(...).send(...) __this line of codes works fine new campaign is created but next line does not executes. #25

Open muhammadraza77 opened 5 years ago

muhammadraza77 commented 5 years ago

onSubmit = async event => { event.preventDefault();

this.setState({ loading: true, errorMessage: '' });

try {
  const accounts = await web3.eth.getAccounts();
  await factory.methods
    .createCampaign(this.state.minimumContribution)
    .send({
      from: accounts[0]
    });
    **console.log("check execution of next line");**
//   Router.pushRoute('/');
} catch (err) {
  this.setState({ errorMessage: err.message });
}

this.setState({ loading: false });

};

after .send function nothing happens it does not get back to code but new campaign is created.....no line code runs after .send function even after try block also....even after looking on some post to attach callback function in .send(),that callback function also didnot ran. dont know why.....plz any solutions?