Created
March 7, 2018 22:00
-
-
Save kyriediculous/13efccc780a9c180b37f4c27fe696bb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
methods: { | |
clickNumber (event) { | |
console.log(event.target.innerHTML, this.amount) | |
this.winEvent = null | |
this.pending = true | |
this.$store.state.contractInstance().bet(event.target.innerHTML, { | |
gas: 300000, | |
value: this.$store.state.web3.web3Instance().toWei(this.amount, 'ether'), | |
from: this.$store.state.web3.coinbase | |
}, (err, result) => { | |
if (err) { | |
console.log(err) | |
this.pending = false | |
} else { | |
let Won = this.$store.state.contractInstance().Won() | |
Won.watch((err, result) => { | |
if (err) { | |
console.log('could not get event Won()') | |
} else { | |
this.winEvent = result.args | |
this.pending = false | |
} | |
}) | |
} | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment