Merge branch 'snt-to-generic'

This commit is contained in:
Richard Ramos 2018-12-05 19:11:20 -04:00
commit 710781c0e5
3 changed files with 16 additions and 13 deletions

View File

@ -57,7 +57,7 @@ class Voting extends PureComponent {
const stHash = this.state.transactionHash; const stHash = this.state.transactionHash;
stHash[idPoll] = transactionHash; stHash[idPoll] = transactionHash;
this.setState({transactionHash: stHash[idPoll]}); this.setState({transactionHash: stHash});
} }
setTransactionPromise = (idPoll, transaction) => { setTransactionPromise = (idPoll, transaction) => {

View File

@ -65,6 +65,7 @@ class Results extends Component {
if(req || !transactionHash[idPoll]) return; if(req || !transactionHash[idPoll]) return;
req = true; req = true;
try {
const receipt = await web3.eth.getTransactionReceipt(transactionHash[idPoll]); const receipt = await web3.eth.getTransactionReceipt(transactionHash[idPoll]);
if(receipt){ if(receipt){
clearInterval(interval); clearInterval(interval);
@ -76,6 +77,8 @@ class Results extends Component {
this.setState({isError: true}); this.setState({isError: true});
} }
} }
} catch(e){
}
req = false; req = false;
}, 100); }, 100);

View File

@ -44,15 +44,15 @@ class App extends React.Component {
web3.eth.defaultAccount = "0x0000000000000000000000000000000000000000"; web3.eth.defaultAccount = "0x0000000000000000000000000000000000000000";
} }
DappToken.methods.symbol().call().then(symbol => { DappToken.methods.symbol().call({from: web3.eth.defaultAccount}).then(symbol => {
this.setState({symbol}); this.setState({symbol});
}); });
DappToken.methods.decimals().call().then(decimals => { DappToken.methods.decimals().call({from: web3.eth.defaultAccount}).then(decimals => {
this.setState({decimals}); this.setState({decimals});
}); });
DappToken.methods.name().call().then(name => { DappToken.methods.name().call({from: web3.eth.defaultAccount}).then(name => {
this.setState({name}); this.setState({name});
}) })