StephenGrider / EthereumCasts

Companion repo to an Ethereum/Solidity course on Udemy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

muhammadraza77 opened this issue · comments

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?