Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save okstaticzero/a052438cc4e8bdca328cafad86e3315d to your computer and use it in GitHub Desktop.
Save okstaticzero/a052438cc4e8bdca328cafad86e3315d to your computer and use it in GitHub Desktop.
handleSubmit = async (e) => {
e.preventDefault();
this.setState({ loading: true });
const hash = await setJSON({ myData: this.state.myData });
try {
await setContractHash(this.props.specificNetworkAddress, hash);
} catch (error) {
this.setState({ loading: false });
alert("There was an error with the transaction.");
return;
}
this.fetchData();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment