Implement getStateKeyVal for JS bindings.
Gives JS the option to 'loop' over contract key/val storage
This commit is contained in:
@@ -32,6 +32,10 @@ window.eth = {
|
||||
postData({call: "getStorage", args: [address, storageAddress]}, cb);
|
||||
},
|
||||
|
||||
getStateKeyVals: function(address, cb){
|
||||
postData({call: "getStateKeyVals", args: [address]}, cb);
|
||||
},
|
||||
|
||||
getKey: function(cb) {
|
||||
postData({call: "getKey"}, cb);
|
||||
},
|
||||
|
@@ -34,7 +34,6 @@ ApplicationWindow {
|
||||
top: parent.top
|
||||
}
|
||||
*/
|
||||
|
||||
onTitleChanged: { window.title = title }
|
||||
experimental.preferences.javascriptEnabled: true
|
||||
experimental.preferences.navigatorQtObjectEnabled: true
|
||||
@@ -97,6 +96,12 @@ ApplicationWindow {
|
||||
var storage = stateObject.getStorage(data.args[1])
|
||||
postData(data._seed, storage)
|
||||
|
||||
break
|
||||
case "getStateKeyVals":
|
||||
require(1);
|
||||
var stateObject = eth.getStateObject(data.args[0]).stateKeyVal(true)
|
||||
postData(data._seed,stateObject)
|
||||
|
||||
break
|
||||
case "getBalance":
|
||||
require(1);
|
||||
@@ -188,7 +193,7 @@ ApplicationWindow {
|
||||
|
||||
WebView {
|
||||
id: inspector
|
||||
visible: false
|
||||
visible: true
|
||||
url: webview.experimental.remoteInspectorUrl
|
||||
anchors {
|
||||
left: root.left
|
||||
|
@@ -65,6 +65,8 @@ func (gui *Gui) Start(assetPath string) {
|
||||
Init: func(p *ethpub.PBlock, obj qml.Object) { p.Number = 0; p.Hash = "" },
|
||||
}, {
|
||||
Init: func(p *ethpub.PTx, obj qml.Object) { p.Value = ""; p.Hash = ""; p.Address = "" },
|
||||
}, {
|
||||
Init: func(p *ethpub.KeyVal, obj qml.Object) { p.Key = ""; p.Value = "" },
|
||||
}})
|
||||
|
||||
ethutil.Config.SetClientString(fmt.Sprintf("/Ethereal v%s", version))
|
||||
|
Reference in New Issue
Block a user