Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
TimDaub committed Jun 3, 2019
1 parent c641abc commit 81cee98
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/components/Exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,22 +382,12 @@ export default class Exchange extends React.Component {

let signed = await mainnetweb3.eth.accounts.signTransaction(paramsObject, mainnetMetaAccount.privateKey)

let receipt;
try {
receipt = await mainnetweb3.eth.sendSignedTransaction(signed.rawTransaction)
await mainnetweb3.eth.sendSignedTransaction(signed.rawTransaction)
} catch(err) {
console.log("EEEERRRRRRRROOOOORRRRR ======== >>>>>",err)
changeAlert({type: 'danger',message: err.toString()});
}
console.log(receipt);
changeAlert({type: "success", message: `Sent ${daiSendAmount} DAI to ${daiSendToAddress}...`});
this.setState({
daiToXdaiMode:false,
daiSendAmount:"",
daiSendToAddress:"",
loaderBarColor:"#FFFFFF",
loaderBarStatusText:"",
})
} else {
// NOTE: For some reason it's important that we reinitialize
// the daiContract at this point with this.props.web3.
Expand All @@ -412,6 +402,14 @@ export default class Exchange extends React.Component {
0
)
}
changeAlert({type: "success", message: `Sent ${daiSendAmount} DAI to ${daiSendToAddress}...`});
this.setState({
daiToXdaiMode:false,
daiSendAmount:"",
daiSendToAddress:"",
loaderBarColor:"#FFFFFF",
loaderBarStatusText:"",
})
} else {
// TODO: Propagate this error to the user
console.log("Couldn't get gas price");
Expand Down

0 comments on commit 81cee98

Please sign in to comment.