aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2015-01-22 20:39:16 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2015-01-22 20:39:32 +0800
commitd6a92b18d4beb48a99582d0806c0b6e9c21b9365 (patch)
tree0b6bea4a4304225d0451373063bae2d409cec392
parent5e623f14f3cbf9f314270e19c5aa2523b6a9d742 (diff)
downloadgo-tangerine-d6a92b18d4beb48a99582d0806c0b6e9c21b9365.tar
go-tangerine-d6a92b18d4beb48a99582d0806c0b6e9c21b9365.tar.gz
go-tangerine-d6a92b18d4beb48a99582d0806c0b6e9c21b9365.tar.bz2
go-tangerine-d6a92b18d4beb48a99582d0806c0b6e9c21b9365.tar.lz
go-tangerine-d6a92b18d4beb48a99582d0806c0b6e9c21b9365.tar.xz
go-tangerine-d6a92b18d4beb48a99582d0806c0b6e9c21b9365.tar.zst
go-tangerine-d6a92b18d4beb48a99582d0806c0b6e9c21b9365.zip
fixed natspec example
-rw-r--r--example/natspec_contract.html17
1 files changed, 8 insertions, 9 deletions
diff --git a/example/natspec_contract.html b/example/natspec_contract.html
index 2cf641910..fd7876239 100644
--- a/example/natspec_contract.html
+++ b/example/natspec_contract.html
@@ -9,7 +9,7 @@
<script type="text/javascript">
var web3 = require('web3');
- web3.setProvider(new web3.providers.AutoProvider());
+ web3.setProvider(new web3.providers.QtSyncProvider());
// solidity source code
var source = "" +
@@ -45,20 +45,19 @@
document.getElementById('source').innerText = source;
// create contract
- web3.eth.transact({code: web3.eth.solidity(source)}).then(function (address) {
- contract = web3.eth.contract(address, desc);
- document.getElementById('call').style.visibility = 'visible';
- });
+ var address = web3.eth.transact({code: web3.eth.solidity(source)});
+ contract = web3.eth.contract(address, desc);
+ document.getElementById('call').style.visibility = 'visible';
}
function callExampleContract() {
// this should be generated by ethereum
var param = parseInt(document.getElementById('value').value);
- // call the contract
- contract.multiply(param).transact().then(function(res) {
- document.getElementById('result').innerText = res[0];
- });
+ // transaction does not return any result, cause it's not synchronous and we don't know,
+ // when it will be processed
+ contract.multiply(param).transact();
+ document.getElementById('result').innerText = 'transaction made';
}
</script>