diff options
author | obscuren <geffobscura@gmail.com> | 2014-09-17 21:58:26 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-09-17 21:58:26 +0800 |
commit | e4cc365e89cfd7a9862aa96a77d56fbd2d41ff4a (patch) | |
tree | 7b1a9ffdd60aca8df0b8cb96a3086a9385776288 /ethereal/assets/ext | |
parent | 15ded0bea9600f489d7f9fb5430c26a84a021bd2 (diff) | |
download | go-tangerine-e4cc365e89cfd7a9862aa96a77d56fbd2d41ff4a.tar go-tangerine-e4cc365e89cfd7a9862aa96a77d56fbd2d41ff4a.tar.gz go-tangerine-e4cc365e89cfd7a9862aa96a77d56fbd2d41ff4a.tar.bz2 go-tangerine-e4cc365e89cfd7a9862aa96a77d56fbd2d41ff4a.tar.lz go-tangerine-e4cc365e89cfd7a9862aa96a77d56fbd2d41ff4a.tar.xz go-tangerine-e4cc365e89cfd7a9862aa96a77d56fbd2d41ff4a.tar.zst go-tangerine-e4cc365e89cfd7a9862aa96a77d56fbd2d41ff4a.zip |
Renamed ethereal
Diffstat (limited to 'ethereal/assets/ext')
-rw-r--r-- | ethereal/assets/ext/big.js | 380 | ||||
-rw-r--r-- | ethereal/assets/ext/ethereum.js | 295 | ||||
-rw-r--r-- | ethereal/assets/ext/filter.js | 49 | ||||
-rw-r--r-- | ethereal/assets/ext/home.html | 22 | ||||
-rw-r--r-- | ethereal/assets/ext/http.js | 13 | ||||
-rw-r--r-- | ethereal/assets/ext/pre.js | 37 | ||||
-rw-r--r-- | ethereal/assets/ext/string.js | 58 | ||||
-rw-r--r-- | ethereal/assets/ext/test.html | 44 |
8 files changed, 0 insertions, 898 deletions
diff --git a/ethereal/assets/ext/big.js b/ethereal/assets/ext/big.js deleted file mode 100644 index db633fd2f..000000000 --- a/ethereal/assets/ext/big.js +++ /dev/null @@ -1,380 +0,0 @@ -var bigInt = (function () { - var base = 10000000, logBase = 7; - var sign = { - positive: false, - negative: true - }; - - var normalize = function (first, second) { - var a = first.value, b = second.value; - var length = a.length > b.length ? a.length : b.length; - for (var i = 0; i < length; i++) { - a[i] = a[i] || 0; - b[i] = b[i] || 0; - } - for (var i = length - 1; i >= 0; i--) { - if (a[i] === 0 && b[i] === 0) { - a.pop(); - b.pop(); - } else break; - } - if (!a.length) a = [0], b = [0]; - first.value = a; - second.value = b; - }; - - var parse = function (text, first) { - if (typeof text === "object") return text; - text += ""; - var s = sign.positive, value = []; - if (text[0] === "-") { - s = sign.negative; - text = text.slice(1); - } - var base = 10; - if (text.slice(0, 2) == "0x") { - base = 16; - text = text.slice(2); - } - else { - var texts = text.split("e"); - if (texts.length > 2) throw new Error("Invalid integer"); - if (texts[1]) { - var exp = texts[1]; - if (exp[0] === "+") exp = exp.slice(1); - exp = parse(exp); - if (exp.lesser(0)) throw new Error("Cannot include negative exponent part for integers"); - while (exp.notEquals(0)) { - texts[0] += "0"; - exp = exp.prev(); - } - } - text = texts[0]; - } - if (text === "-0") text = "0"; - text = text.toUpperCase(); - var isValid = (base == 16 ? /^[0-9A-F]*$/ : /^[0-9]+$/).test(text); - if (!isValid) throw new Error("Invalid integer"); - if (base == 16) { - var val = bigInt(0); - while (text.length) { - v = text.charCodeAt(0) - 48; - if (v > 9) - v -= 7; - text = text.slice(1); - val = val.times(16).plus(v); - } - return val; - } - else { - while (text.length) { - var divider = text.length > logBase ? text.length - logBase : 0; - value.push(+text.slice(divider)); - text = text.slice(0, divider); - } - var val = bigInt(value, s); - if (first) normalize(first, val); - return val; - } - }; - - var goesInto = function (a, b) { - var a = bigInt(a, sign.positive), b = bigInt(b, sign.positive); - if (a.equals(0)) throw new Error("Cannot divide by 0"); - var n = 0; - do { - var inc = 1; - var c = bigInt(a.value, sign.positive), t = c.times(10); - while (t.lesser(b)) { - c = t; - inc *= 10; - t = t.times(10); - } - while (c.lesserOrEquals(b)) { - b = b.minus(c); - n += inc; - } - } while (a.lesserOrEquals(b)); - - return { - remainder: b.value, - result: n - }; - }; - - var bigInt = function (value, s) { - var self = { - value: value, - sign: s - }; - var o = { - value: value, - sign: s, - negate: function (m) { - var first = m || self; - return bigInt(first.value, !first.sign); - }, - abs: function (m) { - var first = m || self; - return bigInt(first.value, sign.positive); - }, - add: function (n, m) { - var s, first = self, second; - if (m) (first = parse(n)) && (second = parse(m)); - else second = parse(n, first); - s = first.sign; - if (first.sign !== second.sign) { - first = bigInt(first.value, sign.positive); - second = bigInt(second.value, sign.positive); - return s === sign.positive ? - o.subtract(first, second) : - o.subtract(second, first); - } - normalize(first, second); - var a = first.value, b = second.value; - var result = [], - carry = 0; - for (var i = 0; i < a.length || carry > 0; i++) { - var sum = (a[i] || 0) + (b[i] || 0) + carry; - carry = sum >= base ? 1 : 0; - sum -= carry * base; - result.push(sum); - } - return bigInt(result, s); - }, - plus: function (n, m) { - return o.add(n, m); - }, - subtract: function (n, m) { - var first = self, second; - if (m) (first = parse(n)) && (second = parse(m)); - else second = parse(n, first); - if (first.sign !== second.sign) return o.add(first, o.negate(second)); - if (first.sign === sign.negative) return o.subtract(o.negate(second), o.negate(first)); - if (o.compare(first, second) === -1) return o.negate(o.subtract(second, first)); - var a = first.value, b = second.value; - var result = [], - borrow = 0; - for (var i = 0; i < a.length; i++) { - var tmp = a[i] - borrow; - borrow = tmp < b[i] ? 1 : 0; - var minuend = (borrow * base) + tmp - b[i]; - result.push(minuend); - } - return bigInt(result, sign.positive); - }, - minus: function (n, m) { - return o.subtract(n, m); - }, - multiply: function (n, m) { - var s, first = self, second; - if (m) (first = parse(n)) && (second = parse(m)); - else second = parse(n, first); - s = first.sign !== second.sign; - var a = first.value, b = second.value; - var resultSum = []; - for (var i = 0; i < a.length; i++) { - resultSum[i] = []; - var j = i; - while (j--) { - resultSum[i].push(0); - } - } - var carry = 0; - for (var i = 0; i < a.length; i++) { - var x = a[i]; - for (var j = 0; j < b.length || carry > 0; j++) { - var y = b[j]; - var product = y ? (x * y) + carry : carry; - carry = product > base ? Math.floor(product / base) : 0; - product -= carry * base; - resultSum[i].push(product); - } - } - var max = -1; - for (var i = 0; i < resultSum.length; i++) { - var len = resultSum[i].length; - if (len > max) max = len; - } - var result = [], carry = 0; - for (var i = 0; i < max || carry > 0; i++) { - var sum = carry; - for (var j = 0; j < resultSum.length; j++) { - sum += resultSum[j][i] || 0; - } - carry = sum > base ? Math.floor(sum / base) : 0; - sum -= carry * base; - result.push(sum); - } - return bigInt(result, s); - }, - times: function (n, m) { - return o.multiply(n, m); - }, - divmod: function (n, m) { - var s, first = self, second; - if (m) (first = parse(n)) && (second = parse(m)); - else second = parse(n, first); - s = first.sign !== second.sign; - if (bigInt(first.value, first.sign).equals(0)) return { - quotient: bigInt([0], sign.positive), - remainder: bigInt([0], sign.positive) - }; - if (second.equals(0)) throw new Error("Cannot divide by zero"); - var a = first.value, b = second.value; - var result = [], remainder = []; - for (var i = a.length - 1; i >= 0; i--) { - var n = [a[i]].concat(remainder); - var quotient = goesInto(b, n); - result.push(quotient.result); - remainder = quotient.remainder; - } - result.reverse(); - return { - quotient: bigInt(result, s), - remainder: bigInt(remainder, first.sign) - }; - }, - divide: function (n, m) { - return o.divmod(n, m).quotient; - }, - over: function (n, m) { - return o.divide(n, m); - }, - mod: function (n, m) { - return o.divmod(n, m).remainder; - }, - pow: function (n, m) { - var first = self, second; - if (m) (first = parse(n)) && (second = parse(m)); - else second = parse(n, first); - var a = first, b = second; - if (b.lesser(0)) return ZERO; - if (b.equals(0)) return ONE; - var result = bigInt(a.value, a.sign); - - if (b.mod(2).equals(0)) { - var c = result.pow(b.over(2)); - return c.times(c); - } else { - return result.times(result.pow(b.minus(1))); - } - }, - next: function (m) { - var first = m || self; - return o.add(first, 1); - }, - prev: function (m) { - var first = m || self; - return o.subtract(first, 1); - }, - compare: function (n, m) { - var first = self, second; - if (m) (first = parse(n)) && (second = parse(m, first)); - else second = parse(n, first); - normalize(first, second); - if (first.value.length === 1 && second.value.length === 1 && first.value[0] === 0 && second.value[0] === 0) return 0; - if (second.sign !== first.sign) return first.sign === sign.positive ? 1 : -1; - var multiplier = first.sign === sign.positive ? 1 : -1; - var a = first.value, b = second.value; - for (var i = a.length - 1; i >= 0; i--) { - if (a[i] > b[i]) return 1 * multiplier; - if (b[i] > a[i]) return -1 * multiplier; - } - return 0; - }, - compareAbs: function (n, m) { - var first = self, second; - if (m) (first = parse(n)) && (second = parse(m, first)); - else second = parse(n, first); - first.sign = second.sign = sign.positive; - return o.compare(first, second); - }, - equals: function (n, m) { - return o.compare(n, m) === 0; - }, - notEquals: function (n, m) { - return !o.equals(n, m); - }, - lesser: function (n, m) { - return o.compare(n, m) < 0; - }, - greater: function (n, m) { - return o.compare(n, m) > 0; - }, - greaterOrEquals: function (n, m) { - return o.compare(n, m) >= 0; - }, - lesserOrEquals: function (n, m) { - return o.compare(n, m) <= 0; - }, - isPositive: function (m) { - var first = m || self; - return first.sign === sign.positive; - }, - isNegative: function (m) { - var first = m || self; - return first.sign === sign.negative; - }, - isEven: function (m) { - var first = m || self; - return first.value[0] % 2 === 0; - }, - isOdd: function (m) { - var first = m || self; - return first.value[0] % 2 === 1; - }, - toString: function (m) { - var first = m || self; - var str = "", len = first.value.length; - while (len--) { - if (first.value[len].toString().length === 8) str += first.value[len]; - else str += (base.toString() + first.value[len]).slice(-logBase); - } - while (str[0] === "0") { - str = str.slice(1); - } - if (!str.length) str = "0"; - var s = (first.sign === sign.positive || str == "0") ? "" : "-"; - return s + str; - }, - toHex: function (m) { - var first = m || self; - var str = ""; - var l = this.abs(); - while (l > 0) { - var qr = l.divmod(256); - var b = qr.remainder.toJSNumber(); - str = (b >> 4).toString(16) + (b & 15).toString(16) + str; - l = qr.quotient; - } - return (this.isNegative() ? "-" : "") + "0x" + str; - }, - toJSNumber: function (m) { - return +o.toString(m); - }, - valueOf: function (m) { - return o.toJSNumber(m); - } - }; - return o; - }; - - var ZERO = bigInt([0], sign.positive); - var ONE = bigInt([1], sign.positive); - var MINUS_ONE = bigInt([1], sign.negative); - - var fnReturn = function (a) { - if (typeof a === "undefined") return ZERO; - return parse(a); - }; - fnReturn.zero = ZERO; - fnReturn.one = ONE; - fnReturn.minusOne = MINUS_ONE; - return fnReturn; -})(); - -if (typeof module !== "undefined") { - module.exports = bigInt; -} - diff --git a/ethereal/assets/ext/ethereum.js b/ethereal/assets/ext/ethereum.js deleted file mode 100644 index 697a404a3..000000000 --- a/ethereal/assets/ext/ethereum.js +++ /dev/null @@ -1,295 +0,0 @@ -// Main Ethereum library -window.eth = { - prototype: Object(), - _callbacks: {}, - _onCallbacks: {}, - - test: function() { - var t = undefined; - postData({call: "test"}) - navigator.qt.onmessage = function(d) {console.log("onmessage called"); t = d; } - for(;;) { - if(t !== undefined) { - return t - } - } - }, - - mutan: function(code, cb) { - postData({call: "mutan", args: [code]}, cb) - }, - - toHex: function(str) { - var hex = ""; - for(var i = 0; i < str.length; i++) { - var n = str.charCodeAt(i).toString(16); - hex += n.length < 2 ? '0' + n : n; - } - - return hex; - }, - - toAscii: function(hex) { - // Find termination - var str = ""; - var i = 0, l = hex.length; - for(; i < l; i+=2) { - var code = hex.charCodeAt(i) - if(code == 0) { - break; - } - - str += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); - } - - return str; - }, - - fromAscii: function(str, pad) { - if(pad === undefined) { - pad = 32 - } - - var hex = this.toHex(str); - - while(hex.length < pad*2) - hex += "00"; - - return hex - }, - - - // Retrieve block - // - // Either supply a number or a string. Type is determent for the lookup method - // string - Retrieves the block by looking up the hash - // number - Retrieves the block by looking up the block number - getBlock: function(numberOrHash, cb) { - var func; - if(typeof numberOrHash == "string") { - func = "getBlockByHash"; - } else { - func = "getBlockByNumber"; - } - postData({call: func, args: [numberOrHash]}, cb); - }, - - // Create transaction - // - // Transact between two state objects - transact: function(params, cb) { - if(params === undefined) { - params = {}; - } - - if(params.endowment !== undefined) - params.value = params.endowment; - if(params.code !== undefined) - params.data = params.code; - - // Make sure everything is string - var fields = ["to", "from", "value", "gas", "gasPrice"]; - for(var i = 0; i < fields.length; i++) { - if(params[fields[i]] === undefined) { - params[fields[i]] = ""; - } - params[fields[i]] = params[fields[i]].toString(); - } - - var data; - if(typeof params.data === "object") { - data = ""; - for(var i = 0; i < params.data.length; i++) { - data += params.data[i] - } - } else { - data = params.data; - } - - postData({call: "transact", args: [params.from, params.to, params.value, params.gas, params.gasPrice, "0x"+data]}, cb); - }, - - getMessages: function(filter, cb) { - postData({call: "messages", args: [filter]}, cb); - }, - - getStorageAt: function(address, storageAddress, cb) { - postData({call: "getStorage", args: [address, storageAddress]}, cb); - }, - - getEachStorageAt: function(address, cb){ - postData({call: "getEachStorage", args: [address]}, cb); - }, - - getKey: function(cb) { - postData({call: "getKey"}, cb); - }, - - getTxCountAt: function(address, cb) { - postData({call: "getTxCountAt", args: [address]}, cb); - }, - getIsMining: function(cb){ - postData({call: "getIsMining"}, cb) - }, - getIsListening: function(cb){ - postData({call: "getIsListening"}, cb) - }, - getCoinBase: function(cb){ - postData({call: "getCoinBase"}, cb); - }, - getPeerCount: function(cb){ - postData({call: "getPeerCount"}, cb); - }, - getBalanceAt: function(address, cb) { - postData({call: "getBalance", args: [address]}, cb); - }, - getTransactionsFor: function(address, cb) { - postData({call: "getTransactionsFor", args: [address]}, cb); - }, - - getSecretToAddress: function(sec, cb) { - postData({call: "getSecretToAddress", args: [sec]}, cb); - }, - - /* - watch: function(address, storageAddrOrCb, cb) { - var ev; - if(cb === undefined) { - cb = storageAddrOrCb; - storageAddrOrCb = ""; - ev = "object:"+address; - } else { - ev = "storage:"+address+":"+storageAddrOrCb; - } - - eth.on(ev, cb) - - postData({call: "watch", args: [address, storageAddrOrCb]}); - }, - - disconnect: function(address, storageAddrOrCb, cb) { - var ev; - if(cb === undefined) { - cb = storageAddrOrCb; - storageAddrOrCb = ""; - ev = "object:"+address; - } else { - ev = "storage:"+address+":"+storageAddrOrCb; - } - - eth.off(ev, cb) - - postData({call: "disconnect", args: [address, storageAddrOrCb]}); - }, - */ - - watch: function(options) { - var filter = new Filter(options); - filter.number = newWatchNum().toString() - - postData({call: "watch", args: [options, filter.number]}) - - return filter; - }, - - set: function(props) { - postData({call: "set", args: props}); - }, - - on: function(event, cb) { - if(eth._onCallbacks[event] === undefined) { - eth._onCallbacks[event] = []; - } - - eth._onCallbacks[event].push(cb); - - return this - }, - - off: function(event, cb) { - if(eth._onCallbacks[event] !== undefined) { - var callbacks = eth._onCallbacks[event]; - for(var i = 0; i < callbacks.length; i++) { - if(callbacks[i] === cb) { - delete callbacks[i]; - } - } - } - - return this - }, - - trigger: function(event, data) { - var callbacks = eth._onCallbacks[event]; - if(callbacks !== undefined) { - for(var i = 0; i < callbacks.length; i++) { - // Figure out whether the returned data was an array - // array means multiple return arguments (multiple params) - if(data instanceof Array) { - callbacks[i].apply(this, data); - } else { - callbacks[i].call(this, data); - } - } - } - }, -} - - -var Filter = function(options) { - this.options = options; -}; -Filter.prototype.changed = function(callback) { - // Register the watched:<number>. Qml will call the appropriate event if anything - // interesting happens in the land of Go. - eth.on("watched:"+this.number, callback) -} -Filter.prototype.getMessages = function(cb) { - return eth.getMessages(this.options, cb) -} - -var watchNum = 0; -function newWatchNum() { - return watchNum++; -} - -function postData(data, cb) { - data._seed = Math.floor(Math.random() * 1000000) - if(cb) { - eth._callbacks[data._seed] = cb; - } - - if(data.args === undefined) { - data.args = []; - } - - navigator.qt.postMessage(JSON.stringify(data)); -} - -navigator.qt.onmessage = function(ev) { - var data = JSON.parse(ev.data) - - if(data._event !== undefined) { - eth.trigger(data._event, data.data); - } else { - if(data._seed) { - var cb = eth._callbacks[data._seed]; - if(cb) { - cb.call(this, data.data) - - // Remove the "trigger" callback - delete eth._callbacks[ev._seed]; - } - } - } -} - -eth.on("chain:changed", function() { -}) - -eth.on("messages", { /* filters */}, function(messages){ -}) - -eth.on("pending:changed", function() { -}) - diff --git a/ethereal/assets/ext/filter.js b/ethereal/assets/ext/filter.js deleted file mode 100644 index bc6a93144..000000000 --- a/ethereal/assets/ext/filter.js +++ /dev/null @@ -1,49 +0,0 @@ -var ethx = { - prototype: Object, - - watch: function(options) { - return new Filter(options); - }, - - note: function() { - var args = Array.prototype.slice.call(arguments, 0); - var o = [] - for(var i = 0; i < args.length; i++) { - o.push(args[i].toString()) - } - - eth.notef(o); - }, -}; - -var Filter = function(options) { - this.callbacks = []; - this.options = options; - - if(options === "chain") { - this.id = eth.newFilterString(options); - } else if(typeof options === "object") { - this.id = eth.newFilter(options); - } -}; - -Filter.prototype.changed = function(callback) { - this.callbacks.push(callback); - - var self = this; - message.connect(function(messages, id) { - if(id == self.id) { - for(var i = 0; i < self.callbacks.length; i++) { - self.callbacks[i].call(self, messages); - } - } - }); -}; - -Filter.prototype.uninstall = function() { - eth.uninstallFilter(this.id) -} - -Filter.prototype.messages = function() { - return eth.messages(this.id) -} diff --git a/ethereal/assets/ext/home.html b/ethereal/assets/ext/home.html deleted file mode 100644 index a524e8403..000000000 --- a/ethereal/assets/ext/home.html +++ /dev/null @@ -1,22 +0,0 @@ -<!doctype> -<html> -<head> -<title>Ethereum</title> - -<style type="text/css"> -h1 { - text-align: center; - font-family: Courier; - font-size: 50pt; -} -</style> -</head> - -<body> -<h1>... Ethereum ...</h1> -<ul> - <li><a href="http://std.eth">std::Service</a></li> -</ul> -</body> -</html> - diff --git a/ethereal/assets/ext/http.js b/ethereal/assets/ext/http.js deleted file mode 100644 index 725ce8e6b..000000000 --- a/ethereal/assets/ext/http.js +++ /dev/null @@ -1,13 +0,0 @@ -// this function is included locally, but you can also include separately via a header definition -function request(url, callback) { - var xhr = new XMLHttpRequest(); - xhr.onreadystatechange = (function(req) { - return function() { - if(req.readyState === 4) { - callback(req); - } - } - })(xhr); - xhr.open('GET', url, true); - xhr.send(''); -} diff --git a/ethereal/assets/ext/pre.js b/ethereal/assets/ext/pre.js deleted file mode 100644 index 3e8a534e9..000000000 --- a/ethereal/assets/ext/pre.js +++ /dev/null @@ -1,37 +0,0 @@ -// Helper function for generating pseudo callbacks and sending data to the QML part of the application -function postData(data, cb) { - data._seed = Math.floor(Math.random() * 1000000) - if(cb) { - eth._callbacks[data._seed] = cb; - } - - if(data.args === undefined) { - data.args = []; - } - - navigator.qt.postMessage(JSON.stringify(data)); -} - -navigator.qt.onmessage = function(ev) { - var data = JSON.parse(ev.data) - - if(data._event !== undefined) { - eth.trigger(data._event, data.data); - } else { - if(data._seed) { - var cb = eth._callbacks[data._seed]; - if(cb) { - // Figure out whether the returned data was an array - // array means multiple return arguments (multiple params) - if(data.data instanceof Array) { - cb.apply(this, data.data) - } else { - cb.call(this, data.data) - } - - // Remove the "trigger" callback - delete eth._callbacks[ev._seed]; - } - } - } -} diff --git a/ethereal/assets/ext/string.js b/ethereal/assets/ext/string.js deleted file mode 100644 index 2473b5c36..000000000 --- a/ethereal/assets/ext/string.js +++ /dev/null @@ -1,58 +0,0 @@ -String.prototype.pad = function(l, r) { - if (r === undefined) { - r = l - if (!(this.substr(0, 2) == "0x" || /^\d+$/.test(this))) - l = 0 - } - var ret = this.bin(); - while (ret.length < l) - ret = "\0" + ret - while (ret.length < r) - ret = ret + "\0" - return ret; -} - -String.prototype.unpad = function() { - var i = this.length; - while (i && this[i - 1] == "\0") - --i - return this.substr(0, i) -} - -String.prototype.bin = function() { - if (this.substr(0, 2) == "0x") { - bytes = [] - var i = 2; - - // Check if it's odd - pad with a zero if so. - if (this.length % 2) - bytes.push(parseInt(this.substr(i++, 1), 16)) - - for (; i < this.length - 1; i += 2) - bytes.push(parseInt(this.substr(i, 2), 16)); - - return String.fromCharCode.apply(String, bytes); - } else if (/^\d+$/.test(this)) - return bigInt(this.substr(0)).toHex().bin() - - // Otherwise we'll return the "String" object instead of an actual string - return this.substr(0, this.length) -} - -String.prototype.unbin = function() { - var i, l, o = ''; - for(i = 0, l = this.length; i < l; i++) { - var n = this.charCodeAt(i).toString(16); - o += n.length < 2 ? '0' + n : n; - } - - return "0x" + o; -} - -String.prototype.dec = function() { - return bigInt(this.substr(0)).toString() -} - -String.prototype.hex = function() { - return bigInt(this.substr(0)).toHex() -} diff --git a/ethereal/assets/ext/test.html b/ethereal/assets/ext/test.html deleted file mode 100644 index 4bac7d36f..000000000 --- a/ethereal/assets/ext/test.html +++ /dev/null @@ -1,44 +0,0 @@ -<!doctype> -<html> -<head> -<title>Tests</title> -</head> - -<body> -<button onclick="test();">Test me</button> - -<script type="text/javascript"> -function test() { - var filter = eth.watch({ - latest: -1, - from: "e6716f9544a56c530d868e4bfbacb172315bdead", - altered: ["aabb", {id: "eeff", "at": "aabb"}], - }); - - filter.changed(function(messages) { - console.log("messages", messages) - }) - - filter.getMessages(function(messages) { - console.log("getMessages", messages) - }); - - eth.getEachStorageAt("9ef0f0d81e040012600b0c1abdef7c48f720f88a", function(entries) { - for(var i = 0; i < entries.length; i++) { - console.log(entries[i].key, " : ", entries[i].value) - } - }) - - eth.getBlock("f70097659f329a09642a27f11338d9269de64f1d4485786e36bfc410832148cd", function(block) { - console.log(block) - }) - - eth.mutan("var a = 10", function(code) { - console.log("code", code) - }); -} -</script> - -</body> - -</html> |