Changing code related to signature handling

This commit is contained in:
Richard Ramos 2018-10-08 14:24:30 -04:00
parent e197a66384
commit 0b32338e39

View File

@ -32,6 +32,7 @@ class Execute extends Component {
super(props); super(props);
this.state = { this.state = {
topic: '0x534e5443', topic: '0x534e5443',
account: '',
allowedContract: '0x0000000000000000000000000000000000000000', allowedContract: '0x0000000000000000000000000000000000000000',
data: '0x00', data: '0x00',
gasPrice: 0, gasPrice: 0,
@ -62,6 +63,8 @@ class Execute extends Component {
sign = async (event) => { sign = async (event) => {
if(event) event.preventDefault(); if(event) event.preventDefault();
this.setState({account: web3.eth.defaultAccount});
this.setState({ this.setState({
msgSent: false, msgSent: false,
transactionError: '' transactionError: ''
@ -70,7 +73,7 @@ class Execute extends Component {
try { try {
const accounts = await web3.eth.getAccounts(); const accounts = await web3.eth.getAccounts();
const s = new StatusGasRelayer.SNTController(SNTController.options.address, accounts[0]) const s = new StatusGasRelayer.SNTController(SNTController.options.address,web3.eth.defaultAccount)
.execute(this.state.allowedContract, this.state.data) .execute(this.state.allowedContract, this.state.data)
.setGas(this.state.gasPrice, this.state.gasMinimal); .setGas(this.state.gasPrice, this.state.gasMinimal);
@ -105,9 +108,7 @@ class Execute extends Component {
this.props.clearMessages(); this.props.clearMessages();
try { try {
const accounts = await web3.eth.getAccounts(); const s = new StatusGasRelayer.AvailableRelayers(Contracts.SNT, SNTController.options.address, this.state.account)
const s = new StatusGasRelayer.AvailableRelayers(Contracts.SNT, SNTController.options.address, accounts[0])
.setRelayersSymKeyID(skid) .setRelayersSymKeyID(skid)
.setAsymmetricKeyID(kid) .setAsymmetricKeyID(kid)
.setGas(STT.options.address, this.state.gasPrice); .setGas(STT.options.address, this.state.gasPrice);
@ -145,9 +146,7 @@ class Execute extends Component {
this.props.clearMessages(); this.props.clearMessages();
try { try {
const accounts = await web3.eth.getAccounts(); const s = new StatusGasRelayer.SNTController(SNTController.options.address, this.state.account)
const s = new StatusGasRelayer.SNTController(SNTController.options.address, accounts[0])
.execute(this.state.allowedContract, this.state.data) .execute(this.state.allowedContract, this.state.data)
.setGas(this.state.gasPrice, this.state.gasMinimal) .setGas(this.state.gasPrice, this.state.gasMinimal)
.setRelayer(relayer) .setRelayer(relayer)