diff options
author | obscuren <geffobscura@gmail.com> | 2014-10-07 01:26:51 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-10-07 01:26:51 +0800 |
commit | c95dfec5e47185be79b32871a0c2cf8b59572cce (patch) | |
tree | fd326b6a52771a688c2cae1535178bf36998f717 | |
parent | 3bc238b1cece4fbe27af3bcec4300ed977b090f3 (diff) | |
download | dexon-c95dfec5e47185be79b32871a0c2cf8b59572cce.tar dexon-c95dfec5e47185be79b32871a0c2cf8b59572cce.tar.gz dexon-c95dfec5e47185be79b32871a0c2cf8b59572cce.tar.bz2 dexon-c95dfec5e47185be79b32871a0c2cf8b59572cce.tar.lz dexon-c95dfec5e47185be79b32871a0c2cf8b59572cce.tar.xz dexon-c95dfec5e47185be79b32871a0c2cf8b59572cce.tar.zst dexon-c95dfec5e47185be79b32871a0c2cf8b59572cce.zip |
push data instead of assign
-rw-r--r-- | main.js | 23 |
1 files changed, 3 insertions, 20 deletions
@@ -1,6 +1,6 @@ (function(window) { function isPromise(o) { - return typeof o === "object" && o.then + return o instanceof Promise } var eth = { @@ -111,7 +111,7 @@ return Promise.all(promises).then(function() { return new Promise(function(resolve, reject) { params.data = params.data.join(""); - eth.provider.send({call: "transact", args: [params]}, function(data) { + eth.provider.send({call: "transact", args: ["0x"+params]}, function(data) { if(data[1]) reject(data[0]); else @@ -395,7 +395,7 @@ if(this.provider !== undefined) { this.provider.send(data); } else { - this.queued = data; + this.queued.push(data); } }; @@ -564,20 +564,3 @@ window.eth = eth; })(this); - -/* - function eth.provider.send(data, cb) { - data.seed = g_seed; - if(cb) { - eth._callbacks[data.seed] = cb; - } - - if(data.args === undefined) { - data.args = []; - } - - g_seed++; - - window._messagingAdapter.call(this, data) - } - */ |