mirror of https://github.com/ethereum/go-ethereum
commit
b64ad7a2a6
After Width: | Height: | Size: 663 B |
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1 @@ |
||||
var contract = web3.eth.contractFromAbi([{"constant":false,"inputs":[{"name":"_h","type":"hash256"}],"name":"confirm","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":_to","type":"address"},{"name":"_value","type":"uint256"},{"name":"_data","type":"bytes"}],"name":"execute","outputs":[{"name":"_r","type":"hash256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"}],"name":"kill","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"}],"name":"changeOwner","outputs":[],"type":"function"},{"inputs":[{"indexed":false,"name":"value","type":"uint256"}],"name":"CashIn","type":"event"},{"inputs":[{"indexed":true,"name":"out","type":"string32"},{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"to","type":"address"}],"name":"SingleTransact","type":"event"},{"inputs":[{"indexed":true,"name":"out","type":"string32"},{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"operation","type":"hash256"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"to","type":"address"}],"name":"MultiTransact","type":"event"}]); |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,155 @@ |
||||
import QtQuick 2.0 |
||||
import QtQuick.Controls 1.0; |
||||
import QtQuick.Controls.Styles 1.0 |
||||
import QtQuick.Layouts 1.0; |
||||
import QtWebEngine 1.0 |
||||
//import QtWebEngine.experimental 1.0 |
||||
import QtQuick.Window 2.0; |
||||
|
||||
|
||||
Rectangle { |
||||
id: window |
||||
anchors.fill: parent |
||||
color: "#00000000" |
||||
|
||||
property var title: "Catalog" |
||||
property var iconSource: "" |
||||
property var menuItem |
||||
property var hideUrl: true |
||||
|
||||
property alias url: webview.url |
||||
property alias windowTitle: webview.title |
||||
property alias webView: webview |
||||
|
||||
|
||||
|
||||
property var cleanPath: false |
||||
property var open: function(url) { |
||||
if(!window.cleanPath) { |
||||
var uri = url; |
||||
if(!/.*\:\/\/.*/.test(uri)) { |
||||
uri = "http://" + uri; |
||||
} |
||||
|
||||
var reg = /(^https?\:\/\/(?:www\.)?)([a-zA-Z0-9_\-]*\.eth)(.*)/ |
||||
|
||||
if(reg.test(uri)) { |
||||
uri.replace(reg, function(match, pre, domain, path) { |
||||
uri = pre; |
||||
|
||||
var lookup = eth.lookupDomain(domain.substring(0, domain.length - 4)); |
||||
var ip = []; |
||||
for(var i = 0, l = lookup.length; i < l; i++) { |
||||
ip.push(lookup.charCodeAt(i)) |
||||
} |
||||
|
||||
if(ip.length != 0) { |
||||
uri += lookup; |
||||
} else { |
||||
uri += domain; |
||||
} |
||||
|
||||
uri += path; |
||||
}); |
||||
} |
||||
|
||||
window.cleanPath = true; |
||||
|
||||
webview.url = uri; |
||||
|
||||
//uriNav.text = uri.text.replace(/(^https?\:\/\/(?:www\.)?)([a-zA-Z0-9_\-]*\.\w{2,3})(.*)/, "$1$2<span style='color:#CCC'>$3</span>"); |
||||
uriNav.text = uri; |
||||
|
||||
} else { |
||||
// Prevent inf loop. |
||||
window.cleanPath = false; |
||||
} |
||||
} |
||||
|
||||
Component.onCompleted: { |
||||
} |
||||
|
||||
Item { |
||||
objectName: "root" |
||||
id: root |
||||
anchors.fill: parent |
||||
state: "inspectorShown" |
||||
|
||||
WebEngineView { |
||||
objectName: "webView" |
||||
id: webview |
||||
anchors.fill: parent |
||||
|
||||
property var protocol: "http://" |
||||
//property var domain: "localhost:3000" |
||||
property var domain: "ethereum-dapp-catalog.meteor.com" |
||||
url: protocol + domain |
||||
|
||||
//navigationRequest: WebEngineView.IgnoreRequest |
||||
// onLoadingChanged: { |
||||
// if (loadRequest.status == WebEngineView.LoadSucceededStatus) { |
||||
// webview.runJavaScript(eth.readFile("bignumber.min.js")); |
||||
// webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js")); |
||||
// } |
||||
// } |
||||
|
||||
//onNavigationRequested: { |
||||
// detect URL scheme prefix, most likely an external link |
||||
//var schemaRE = /^\w+:/; |
||||
//if (schemaRE.test(request.url)) { |
||||
// request.action = WebView.AcceptRequest; |
||||
//} else { |
||||
//request.action = WebView.IgnoreRequest; |
||||
// delegate request.url here |
||||
//} |
||||
//} |
||||
|
||||
onJavaScriptConsoleMessage: { |
||||
console.log(sourceID + ":" + lineNumber + ":" + JSON.stringify(message)); |
||||
} |
||||
|
||||
onNavigationRequested: { |
||||
var cleanTitle = request.url.toString() |
||||
var matches = cleanTitle.match(/^[a-z]*\:\/\/([^\/?#]+)(?:[\/?#]|$)/i); |
||||
var requestedDomain = matches && matches[1]; |
||||
|
||||
console.debug ("NavigationRequested: " + request.url + " navigationType=" + request.navigationType) |
||||
|
||||
if(request.navigationType==0){ |
||||
|
||||
if (requestedDomain === this.domain){ |
||||
request.action = WebEngineView.AcceptRequest; |
||||
} else { |
||||
request.action = WebEngineView.IgnoreRequest; |
||||
newBrowserTab(request.url); |
||||
} |
||||
|
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
WebEngineView { |
||||
id: inspector |
||||
visible: false |
||||
z:10 |
||||
anchors { |
||||
left: root.left |
||||
right: root.right |
||||
top: sizeGrip.bottom |
||||
bottom: root.bottom |
||||
} |
||||
|
||||
} |
||||
|
||||
states: [ |
||||
State { |
||||
name: "inspectorShown" |
||||
PropertyChanges { |
||||
target: inspector |
||||
} |
||||
} |
||||
] |
||||
} |
||||
} |
@ -0,0 +1,22 @@ |
||||
package core |
||||
|
||||
import ( |
||||
"github.com/ethereum/go-ethereum/crypto" |
||||
"github.com/ethereum/go-ethereum/ethutil" |
||||
"github.com/ethereum/go-ethereum/event" |
||||
"github.com/ethereum/go-ethereum/p2p" |
||||
) |
||||
|
||||
type EthManager interface { |
||||
BlockProcessor() *BlockProcessor |
||||
ChainManager() *ChainManager |
||||
TxPool() *TxPool |
||||
PeerCount() int |
||||
IsMining() bool |
||||
IsListening() bool |
||||
Peers() []*p2p.Peer |
||||
KeyManager() *crypto.KeyManager |
||||
ClientIdentity() p2p.ClientIdentity |
||||
Db() ethutil.Database |
||||
EventMux() *event.TypeMux |
||||
} |
@ -1,61 +0,0 @@ |
||||
package state |
||||
|
||||
import ( |
||||
"fmt" |
||||
"math/big" |
||||
) |
||||
|
||||
// Object manifest
|
||||
//
|
||||
// The object manifest is used to keep changes to the state so we can keep track of the changes
|
||||
// that occurred during a state transitioning phase.
|
||||
type Manifest struct { |
||||
Messages Messages |
||||
} |
||||
|
||||
func NewManifest() *Manifest { |
||||
m := &Manifest{} |
||||
m.Reset() |
||||
|
||||
return m |
||||
} |
||||
|
||||
func (m *Manifest) Reset() { |
||||
m.Messages = nil |
||||
} |
||||
|
||||
func (self *Manifest) AddMessage(msg *Message) *Message { |
||||
self.Messages = append(self.Messages, msg) |
||||
|
||||
return msg |
||||
} |
||||
|
||||
func (self *Manifest) SetHash(hash []byte) { |
||||
for _, message := range self.Messages { |
||||
message.Block = hash |
||||
} |
||||
} |
||||
|
||||
type Messages []*Message |
||||
type Message struct { |
||||
To, From []byte |
||||
Input []byte |
||||
Output []byte |
||||
Path int |
||||
Origin []byte |
||||
Timestamp int64 |
||||
Coinbase []byte |
||||
Block []byte |
||||
Number *big.Int |
||||
Value *big.Int |
||||
|
||||
ChangedAddresses [][]byte |
||||
} |
||||
|
||||
func (self *Message) AddStorageChange(addr []byte) { |
||||
self.ChangedAddresses = append(self.ChangedAddresses, addr) |
||||
} |
||||
|
||||
func (self *Message) String() string { |
||||
return fmt.Sprintf("Message{to: %x from: %x input: %x output: %x origin: %x coinbase: %x block: %x number: %v timestamp: %d path: %d value: %v", self.To, self.From, self.Input, self.Output, self.Origin, self.Coinbase, self.Block, self.Number, self.Timestamp, self.Path, self.Value) |
||||
} |
Loading…
Reference in new issue