forked from cerc-io/plugeth
Updated assets & moved messages
This commit is contained in:
parent
cbf162ca64
commit
9a11a94894
@ -15,7 +15,7 @@
|
|||||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
// MA 02110-1301 USA
|
// MA 02110-1301 USA
|
||||||
|
|
||||||
var bigInt = (function () {
|
var BigNumber = (function () {
|
||||||
var base = 10000000, logBase = 7;
|
var base = 10000000, logBase = 7;
|
||||||
var sign = {
|
var sign = {
|
||||||
positive: false,
|
positive: false,
|
||||||
@ -73,7 +73,7 @@ var bigInt = (function () {
|
|||||||
var isValid = (base == 16 ? /^[0-9A-F]*$/ : /^[0-9]+$/).test(text);
|
var isValid = (base == 16 ? /^[0-9A-F]*$/ : /^[0-9]+$/).test(text);
|
||||||
if (!isValid) throw new Error("Invalid integer");
|
if (!isValid) throw new Error("Invalid integer");
|
||||||
if (base == 16) {
|
if (base == 16) {
|
||||||
var val = bigInt(0);
|
var val = BigNumber(0);
|
||||||
while (text.length) {
|
while (text.length) {
|
||||||
v = text.charCodeAt(0) - 48;
|
v = text.charCodeAt(0) - 48;
|
||||||
if (v > 9)
|
if (v > 9)
|
||||||
@ -89,19 +89,19 @@ var bigInt = (function () {
|
|||||||
value.push(+text.slice(divider));
|
value.push(+text.slice(divider));
|
||||||
text = text.slice(0, divider);
|
text = text.slice(0, divider);
|
||||||
}
|
}
|
||||||
var val = bigInt(value, s);
|
var val = BigNumber(value, s);
|
||||||
if (first) normalize(first, val);
|
if (first) normalize(first, val);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var goesInto = function (a, b) {
|
var goesInto = function (a, b) {
|
||||||
var a = bigInt(a, sign.positive), b = bigInt(b, sign.positive);
|
var a = BigNumber(a, sign.positive), b = BigNumber(b, sign.positive);
|
||||||
if (a.equals(0)) throw new Error("Cannot divide by 0");
|
if (a.equals(0)) throw new Error("Cannot divide by 0");
|
||||||
var n = 0;
|
var n = 0;
|
||||||
do {
|
do {
|
||||||
var inc = 1;
|
var inc = 1;
|
||||||
var c = bigInt(a.value, sign.positive), t = c.times(10);
|
var c = BigNumber(a.value, sign.positive), t = c.times(10);
|
||||||
while (t.lesser(b)) {
|
while (t.lesser(b)) {
|
||||||
c = t;
|
c = t;
|
||||||
inc *= 10;
|
inc *= 10;
|
||||||
@ -119,7 +119,7 @@ var bigInt = (function () {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
var bigInt = function (value, s) {
|
var BigNumber = function (value, s) {
|
||||||
var self = {
|
var self = {
|
||||||
value: value,
|
value: value,
|
||||||
sign: s
|
sign: s
|
||||||
@ -129,11 +129,11 @@ var bigInt = (function () {
|
|||||||
sign: s,
|
sign: s,
|
||||||
negate: function (m) {
|
negate: function (m) {
|
||||||
var first = m || self;
|
var first = m || self;
|
||||||
return bigInt(first.value, !first.sign);
|
return BigNumber(first.value, !first.sign);
|
||||||
},
|
},
|
||||||
abs: function (m) {
|
abs: function (m) {
|
||||||
var first = m || self;
|
var first = m || self;
|
||||||
return bigInt(first.value, sign.positive);
|
return BigNumber(first.value, sign.positive);
|
||||||
},
|
},
|
||||||
add: function (n, m) {
|
add: function (n, m) {
|
||||||
var s, first = self, second;
|
var s, first = self, second;
|
||||||
@ -141,8 +141,8 @@ var bigInt = (function () {
|
|||||||
else second = parse(n, first);
|
else second = parse(n, first);
|
||||||
s = first.sign;
|
s = first.sign;
|
||||||
if (first.sign !== second.sign) {
|
if (first.sign !== second.sign) {
|
||||||
first = bigInt(first.value, sign.positive);
|
first = BigNumber(first.value, sign.positive);
|
||||||
second = bigInt(second.value, sign.positive);
|
second = BigNumber(second.value, sign.positive);
|
||||||
return s === sign.positive ?
|
return s === sign.positive ?
|
||||||
o.subtract(first, second) :
|
o.subtract(first, second) :
|
||||||
o.subtract(second, first);
|
o.subtract(second, first);
|
||||||
@ -157,7 +157,7 @@ var bigInt = (function () {
|
|||||||
sum -= carry * base;
|
sum -= carry * base;
|
||||||
result.push(sum);
|
result.push(sum);
|
||||||
}
|
}
|
||||||
return bigInt(result, s);
|
return BigNumber(result, s);
|
||||||
},
|
},
|
||||||
plus: function (n, m) {
|
plus: function (n, m) {
|
||||||
return o.add(n, m);
|
return o.add(n, m);
|
||||||
@ -178,7 +178,7 @@ var bigInt = (function () {
|
|||||||
var minuend = (borrow * base) + tmp - b[i];
|
var minuend = (borrow * base) + tmp - b[i];
|
||||||
result.push(minuend);
|
result.push(minuend);
|
||||||
}
|
}
|
||||||
return bigInt(result, sign.positive);
|
return BigNumber(result, sign.positive);
|
||||||
},
|
},
|
||||||
minus: function (n, m) {
|
minus: function (n, m) {
|
||||||
return o.subtract(n, m);
|
return o.subtract(n, m);
|
||||||
@ -223,7 +223,7 @@ var bigInt = (function () {
|
|||||||
sum -= carry * base;
|
sum -= carry * base;
|
||||||
result.push(sum);
|
result.push(sum);
|
||||||
}
|
}
|
||||||
return bigInt(result, s);
|
return BigNumber(result, s);
|
||||||
},
|
},
|
||||||
times: function (n, m) {
|
times: function (n, m) {
|
||||||
return o.multiply(n, m);
|
return o.multiply(n, m);
|
||||||
@ -233,9 +233,9 @@ var bigInt = (function () {
|
|||||||
if (m) (first = parse(n)) && (second = parse(m));
|
if (m) (first = parse(n)) && (second = parse(m));
|
||||||
else second = parse(n, first);
|
else second = parse(n, first);
|
||||||
s = first.sign !== second.sign;
|
s = first.sign !== second.sign;
|
||||||
if (bigInt(first.value, first.sign).equals(0)) return {
|
if (BigNumber(first.value, first.sign).equals(0)) return {
|
||||||
quotient: bigInt([0], sign.positive),
|
quotient: BigNumber([0], sign.positive),
|
||||||
remainder: bigInt([0], sign.positive)
|
remainder: BigNumber([0], sign.positive)
|
||||||
};
|
};
|
||||||
if (second.equals(0)) throw new Error("Cannot divide by zero");
|
if (second.equals(0)) throw new Error("Cannot divide by zero");
|
||||||
var a = first.value, b = second.value;
|
var a = first.value, b = second.value;
|
||||||
@ -248,8 +248,8 @@ var bigInt = (function () {
|
|||||||
}
|
}
|
||||||
result.reverse();
|
result.reverse();
|
||||||
return {
|
return {
|
||||||
quotient: bigInt(result, s),
|
quotient: BigNumber(result, s),
|
||||||
remainder: bigInt(remainder, first.sign)
|
remainder: BigNumber(remainder, first.sign)
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
divide: function (n, m) {
|
divide: function (n, m) {
|
||||||
@ -268,7 +268,7 @@ var bigInt = (function () {
|
|||||||
var a = first, b = second;
|
var a = first, b = second;
|
||||||
if (b.lesser(0)) return ZERO;
|
if (b.lesser(0)) return ZERO;
|
||||||
if (b.equals(0)) return ONE;
|
if (b.equals(0)) return ONE;
|
||||||
var result = bigInt(a.value, a.sign);
|
var result = BigNumber(a.value, a.sign);
|
||||||
|
|
||||||
if (b.mod(2).equals(0)) {
|
if (b.mod(2).equals(0)) {
|
||||||
var c = result.pow(b.over(2));
|
var c = result.pow(b.over(2));
|
||||||
@ -377,9 +377,9 @@ var bigInt = (function () {
|
|||||||
return o;
|
return o;
|
||||||
};
|
};
|
||||||
|
|
||||||
var ZERO = bigInt([0], sign.positive);
|
var ZERO = BigNumber([0], sign.positive);
|
||||||
var ONE = bigInt([1], sign.positive);
|
var ONE = BigNumber([1], sign.positive);
|
||||||
var MINUS_ONE = bigInt([1], sign.negative);
|
var MINUS_ONE = BigNumber([1], sign.negative);
|
||||||
|
|
||||||
var fnReturn = function (a) {
|
var fnReturn = function (a) {
|
||||||
if (typeof a === "undefined") return ZERO;
|
if (typeof a === "undefined") return ZERO;
|
||||||
@ -392,6 +392,6 @@ var bigInt = (function () {
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
if (typeof module !== "undefined") {
|
if (typeof module !== "undefined") {
|
||||||
module.exports = bigInt;
|
module.exports = BigNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
cmd/mist/assets/ext/dist/ethereum.js
vendored
2
cmd/mist/assets/ext/dist/ethereum.js
vendored
@ -1195,4 +1195,4 @@ module.exports = web3;
|
|||||||
},{"./lib/abi":1,"./lib/contract":2,"./lib/filter":3,"./lib/httpsync":4,"./lib/providermanager":5,"./lib/qtsync":6,"./lib/web3":7}]},{},["web3"])
|
},{"./lib/abi":1,"./lib/contract":2,"./lib/filter":3,"./lib/httpsync":4,"./lib/providermanager":5,"./lib/qtsync":6,"./lib/web3":7}]},{},["web3"])
|
||||||
|
|
||||||
|
|
||||||
//# sourceMappingURL=ethereum.js.map
|
//# sourceMappingURL=ethereum.js.map
|
||||||
|
@ -2,11 +2,13 @@
|
|||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<script type="text/javascript" src="js/bignumber.js/bignumber.min.js"></script>
|
<script type="text/javascript" src="../bignumber.min.js"></script>
|
||||||
<script type="text/javascript" src="../dist/ethereum.js"></script>
|
<script type="text/javascript" src="../dist/ethereum.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
console.log("hello world");
|
||||||
var web3 = require('web3');
|
var web3 = require('web3');
|
||||||
|
console.log(web3)
|
||||||
web3.setProvider(new web3.providers.HttpSyncProvider('http://localhost:8080'));
|
web3.setProvider(new web3.providers.HttpSyncProvider('http://localhost:8080'));
|
||||||
|
|
||||||
function watchBalance() {
|
function watchBalance() {
|
||||||
@ -25,6 +27,11 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var request = new XMLHttpRequest();
|
||||||
|
request.open('POST', "http://localhost:8080", false);
|
||||||
|
request.send({});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -45,9 +45,9 @@ ApplicationWindow {
|
|||||||
|
|
||||||
mainSplit.setView(wallet.view, wallet.menuItem);
|
mainSplit.setView(wallet.view, wallet.menuItem);
|
||||||
|
|
||||||
try {
|
console.log("starting browser")
|
||||||
newBrowserTab("http://google.com");
|
newBrowserTab("http://etherian.io");
|
||||||
} catch(e) { console.log(e); }
|
console.log("done")
|
||||||
|
|
||||||
// Command setup
|
// Command setup
|
||||||
gui.sendCommand(0)
|
gui.sendCommand(0)
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
import QtWebEngine 1.0
|
|
||||||
//import QtWebEngine.experimental 1.0
|
|
||||||
import QtQuick.Controls 1.0;
|
import QtQuick.Controls 1.0;
|
||||||
import QtQuick.Controls.Styles 1.0
|
import QtQuick.Controls.Styles 1.0
|
||||||
import QtQuick.Layouts 1.0;
|
import QtQuick.Layouts 1.0;
|
||||||
|
import QtWebEngine 1.0
|
||||||
|
//import QtWebEngine.experimental 1.0
|
||||||
import QtQuick.Window 2.0;
|
import QtQuick.Window 2.0;
|
||||||
import Ethereum 1.0
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: window
|
id: window
|
||||||
@ -64,17 +63,6 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
webview.url = "http://etherian.io"
|
|
||||||
}
|
|
||||||
|
|
||||||
function messages(messages, id) {
|
|
||||||
// Bit of a cheat to get proper JSON
|
|
||||||
var m = JSON.parse(JSON.parse(JSON.stringify(messages)))
|
|
||||||
webview.postEvent("eth_changed", id, m);
|
|
||||||
}
|
|
||||||
|
|
||||||
function onShhMessage(message, id) {
|
|
||||||
webview.postEvent("shh_changed", id, message)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
@ -129,6 +117,8 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
iconSource: "../../bug.png"
|
iconSource: "../../bug.png"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
// XXX soon
|
||||||
|
return
|
||||||
if(inspector.visible == true){
|
if(inspector.visible == true){
|
||||||
inspector.visible = false
|
inspector.visible = false
|
||||||
}else{
|
}else{
|
||||||
@ -155,13 +145,23 @@ Rectangle {
|
|||||||
WebEngineView {
|
WebEngineView {
|
||||||
objectName: "webView"
|
objectName: "webView"
|
||||||
id: webview
|
id: webview
|
||||||
// anchors.fill: parent
|
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
top: divider.bottom
|
top: divider.bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onLoadingChanged: {
|
||||||
|
console.log(url)
|
||||||
|
if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
|
||||||
|
webview.runJavaScript(eth.readFile("bignumber.min.js"));
|
||||||
|
webview.runJavaScript(eth.readFile("dist/ethereum.js"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onJavaScriptConsoleMessage: {
|
||||||
|
console.log(sourceID + ":" + lineNumber + ":" + JSON.stringify(message));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@ -193,6 +193,7 @@ Rectangle {
|
|||||||
top: sizeGrip.bottom
|
top: sizeGrip.bottom
|
||||||
bottom: root.bottom
|
bottom: root.bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
states: [
|
states: [
|
||||||
|
@ -21,12 +21,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/core"
|
"github.com/ethereum/go-ethereum/core"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/event"
|
"github.com/ethereum/go-ethereum/event"
|
||||||
"github.com/ethereum/go-ethereum/javascript"
|
|
||||||
"github.com/ethereum/go-ethereum/state"
|
"github.com/ethereum/go-ethereum/state"
|
||||||
"github.com/ethereum/go-ethereum/ui/qt"
|
"github.com/ethereum/go-ethereum/ui/qt"
|
||||||
"github.com/ethereum/go-ethereum/xeth"
|
"github.com/ethereum/go-ethereum/xeth"
|
||||||
@ -113,13 +110,15 @@ func (app *ExtApplication) mainLoop() {
|
|||||||
case core.NewBlockEvent:
|
case core.NewBlockEvent:
|
||||||
app.container.NewBlock(ev.Block)
|
app.container.NewBlock(ev.Block)
|
||||||
|
|
||||||
case state.Messages:
|
/* TODO remove
|
||||||
for id, filter := range app.filters {
|
case state.Messages:
|
||||||
msgs := filter.FilterMessages(ev)
|
for id, filter := range app.filters {
|
||||||
if len(msgs) > 0 {
|
msgs := filter.FilterMessages(ev)
|
||||||
app.container.Messages(msgs, id)
|
if len(msgs) > 0 {
|
||||||
|
app.container.Messages(msgs, id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,6 +128,7 @@ func (self *ExtApplication) Watch(filterOptions map[string]interface{}, identifi
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *ExtApplication) GetMessages(object map[string]interface{}) string {
|
func (self *ExtApplication) GetMessages(object map[string]interface{}) string {
|
||||||
|
/* TODO remove me
|
||||||
filter := qt.NewFilterFromMap(object, self.eth)
|
filter := qt.NewFilterFromMap(object, self.eth)
|
||||||
|
|
||||||
messages := filter.Find()
|
messages := filter.Find()
|
||||||
@ -143,4 +143,6 @@ func (self *ExtApplication) GetMessages(object map[string]interface{}) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return string(b)
|
return string(b)
|
||||||
|
*/
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
|
@ -398,14 +398,6 @@ func (gui *Gui) setup() {
|
|||||||
gui.setPeerInfo()
|
gui.setPeerInfo()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// Inject javascript files each time navigation is requested.
|
|
||||||
// Unfortunately webview.experimental.userScripts injects _after_
|
|
||||||
// the page has loaded which kind of renders it useless...
|
|
||||||
//jsfiles := loadJavascriptAssets(gui)
|
|
||||||
gui.getObjectByName("webView").On("navigationRequested", func() {
|
|
||||||
//gui.getObjectByName("webView").Call("injectJs", jsfiles)
|
|
||||||
})
|
|
||||||
|
|
||||||
gui.whisper.SetView(gui.getObjectByName("whisperView"))
|
gui.whisper.SetView(gui.getObjectByName("whisperView"))
|
||||||
|
|
||||||
gui.SendCommand(update)
|
gui.SendCommand(update)
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
@ -32,7 +31,6 @@ import (
|
|||||||
|
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/ethutil"
|
"github.com/ethereum/go-ethereum/ethutil"
|
||||||
"github.com/ethereum/go-ethereum/javascript"
|
|
||||||
"github.com/ethereum/go-ethereum/state"
|
"github.com/ethereum/go-ethereum/state"
|
||||||
"github.com/ethereum/go-ethereum/xeth"
|
"github.com/ethereum/go-ethereum/xeth"
|
||||||
"github.com/howeyc/fsnotify"
|
"github.com/howeyc/fsnotify"
|
||||||
@ -147,6 +145,7 @@ func (app *HtmlApplication) NewBlock(block *types.Block) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *HtmlApplication) Messages(messages state.Messages, id string) {
|
func (self *HtmlApplication) Messages(messages state.Messages, id string) {
|
||||||
|
/* TODO remove me
|
||||||
var msgs []javascript.JSMessage
|
var msgs []javascript.JSMessage
|
||||||
for _, m := range messages {
|
for _, m := range messages {
|
||||||
msgs = append(msgs, javascript.NewJSMessage(m))
|
msgs = append(msgs, javascript.NewJSMessage(m))
|
||||||
@ -155,6 +154,7 @@ func (self *HtmlApplication) Messages(messages state.Messages, id string) {
|
|||||||
b, _ := json.Marshal(msgs)
|
b, _ := json.Marshal(msgs)
|
||||||
|
|
||||||
self.webView.Call("onWatchedCb", string(b), id)
|
self.webView.Call("onWatchedCb", string(b), id)
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
func (app *HtmlApplication) Destroy() {
|
func (app *HtmlApplication) Destroy() {
|
||||||
|
@ -23,11 +23,11 @@ package main
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
"path"
|
"path"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/core"
|
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
"github.com/ethereum/go-ethereum/eth"
|
"github.com/ethereum/go-ethereum/eth"
|
||||||
@ -35,8 +35,6 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/event/filter"
|
"github.com/ethereum/go-ethereum/event/filter"
|
||||||
"github.com/ethereum/go-ethereum/javascript"
|
"github.com/ethereum/go-ethereum/javascript"
|
||||||
"github.com/ethereum/go-ethereum/miner"
|
"github.com/ethereum/go-ethereum/miner"
|
||||||
"github.com/ethereum/go-ethereum/state"
|
|
||||||
"github.com/ethereum/go-ethereum/ui/qt"
|
|
||||||
"github.com/ethereum/go-ethereum/xeth"
|
"github.com/ethereum/go-ethereum/xeth"
|
||||||
"gopkg.in/qml.v1"
|
"gopkg.in/qml.v1"
|
||||||
)
|
)
|
||||||
@ -313,34 +311,50 @@ func (self *UiLib) ToAscii(data string) string {
|
|||||||
|
|
||||||
/// Ethereum filter methods
|
/// Ethereum filter methods
|
||||||
func (self *UiLib) NewFilter(object map[string]interface{}, view *qml.Common) (id int) {
|
func (self *UiLib) NewFilter(object map[string]interface{}, view *qml.Common) (id int) {
|
||||||
|
/* TODO remove me
|
||||||
filter := qt.NewFilterFromMap(object, self.eth)
|
filter := qt.NewFilterFromMap(object, self.eth)
|
||||||
filter.MessageCallback = func(messages state.Messages) {
|
filter.MessageCallback = func(messages state.Messages) {
|
||||||
view.Call("messages", xeth.ToJSMessages(messages), id)
|
view.Call("messages", xeth.ToJSMessages(messages), id)
|
||||||
}
|
}
|
||||||
id = self.filterManager.InstallFilter(filter)
|
id = self.filterManager.InstallFilter(filter)
|
||||||
return id
|
return id
|
||||||
|
*/
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *UiLib) NewFilterString(typ string, view *qml.Common) (id int) {
|
func (self *UiLib) NewFilterString(typ string, view *qml.Common) (id int) {
|
||||||
|
/* TODO remove me
|
||||||
filter := core.NewFilter(self.eth)
|
filter := core.NewFilter(self.eth)
|
||||||
filter.BlockCallback = func(block *types.Block) {
|
filter.BlockCallback = func(block *types.Block) {
|
||||||
view.Call("messages", "{}", id)
|
view.Call("messages", "{}", id)
|
||||||
}
|
}
|
||||||
id = self.filterManager.InstallFilter(filter)
|
id = self.filterManager.InstallFilter(filter)
|
||||||
return id
|
return id
|
||||||
|
*/
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *UiLib) Messages(id int) *ethutil.List {
|
func (self *UiLib) Messages(id int) *ethutil.List {
|
||||||
|
/* TODO remove me
|
||||||
filter := self.filterManager.GetFilter(id)
|
filter := self.filterManager.GetFilter(id)
|
||||||
if filter != nil {
|
if filter != nil {
|
||||||
messages := xeth.ToJSMessages(filter.Find())
|
messages := xeth.ToJSMessages(filter.Find())
|
||||||
|
|
||||||
return messages
|
return messages
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return ethutil.EmptyList()
|
return ethutil.EmptyList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (self *UiLib) ReadFile(p string) string {
|
||||||
|
content, err := ioutil.ReadFile(self.AssetPath(path.Join("ext", p)))
|
||||||
|
if err != nil {
|
||||||
|
guilogger.Infoln("error reading file", p, ":", err)
|
||||||
|
}
|
||||||
|
return string(content)
|
||||||
|
}
|
||||||
|
|
||||||
func (self *UiLib) UninstallFilter(id int) {
|
func (self *UiLib) UninstallFilter(id int) {
|
||||||
self.filterManager.UninstallFilter(id)
|
self.filterManager.UninstallFilter(id)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user