Last active
November 9, 2018 02:00
-
-
Save apalepu23/15099df1ac25082b4a824342e5ea26b2 to your computer and use it in GitHub Desktop.
Callback
This file contains hidden or 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
// onChange listener to trigger enigma task when poll has ended | |
async handleTimerEnd(pollID) { | |
const { polls } = this.state; | |
await this.enigmaTask(pollID); | |
const pollStatusUpdateEvent = this.props.voting.PollStatusUpdate(); | |
pollStatusUpdateEvent.watch(async (error, result) => { | |
let pollStatus = await this.props.voting.getPollStatus.call(pollID, { | |
from: this.props.enigmaSetup.accounts[this.props.curAccount], | |
gas: GAS | |
}); | |
polls[pollID].status = pollStatus; | |
this.setState({ polls }); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment