Skip to content

Commit

Permalink
Remove sync calls for MetaMask; have to fix tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
ethers committed Jul 16, 2016
1 parent a35f248 commit f0b9035
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions examples/testnetSampleRelayTx.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,18 @@
var feeWei = web3.toWei(gFeeVerifyFinney, 'finney');
var objParam = { from: web3.eth.coinbase, value: feeWei, gas: 1900000 };

var ethTx = gRelayContract.relayTx.sendTransaction(txBytes, txIndex, merkleSibling, txBlockHash, gProcessorAddr, objParam);
document.getElementById('result').innerText = ethTx;
// console.log('@@@ relayTx receipt: ', receipt)
// when the tx is mined, the storage of gProcessorAddr at key0 will have
// the Bitcoin transaction hash
gRelayContract.relayTx.sendTransaction(txBytes, txIndex, merkleSibling,
txBlockHash, gProcessorAddr, objParam, function(err, ethTx) {
if (err) {
console.log('@@@ relayTx error');
return;
}

document.getElementById('result').innerText = ethTx;
// console.log('@@@ relayTx receipt: ', receipt)
// when the tx is mined, the storage of gProcessorAddr at key0 will have
// the Bitcoin transaction hash
});
}

function callContract() {
Expand Down Expand Up @@ -121,8 +128,15 @@
console.log('merkle proof: ', gMerkleProof)
$('#mProof').val(JSON.stringify(gMerkleProof));

gFeeVerifyFinney = web3.fromWei(gRelayContract.getFeeAmount.call('0x'+gBlockHashOfTx), 'finney');
$('#feeVerifyTx').text(gFeeVerifyFinney);
gRelayContract.getFeeAmount.call('0x'+gBlockHashOfTx, function(err, feeWei) {
if (err) {
console.log('@@@ getFeeAmount error');
return;
}

gFeeVerifyFinney = web3.fromWei(feeWei, 'finney');
$('#feeVerifyTx').text(gFeeVerifyFinney);
})
})
})
}
Expand Down

0 comments on commit f0b9035

Please sign in to comment.