Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
a0f73c27
Commit
a0f73c27
authored
May 27, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixes and improvements to the ui
parent
2be98230
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
27 deletions
+40
-27
debugger.qml
ethereal/assets/debugger/debugger.qml
+6
-6
heart.png
ethereal/assets/heart.png
+0
-0
wallet.qml
ethereal/assets/qml/wallet.qml
+4
-17
debugger.go
ethereal/ui/debugger.go
+30
-4
No files found.
ethereal/assets/debugger/debugger.qml
View file @
a0f73c27
...
...
@@ -8,7 +8,7 @@ import Ethereum 1.0
ApplicationWindow
{
visible
:
false
title
:
"
Debugger
"
title
:
"
IceCream
"
minimumWidth
:
1280
minimumHeight
:
900
width
:
1290
...
...
@@ -58,9 +58,10 @@ ApplicationWindow {
anchors.bottom
:
parent
.
bottom
Label
{
text
:
"
D
ata"
text
:
"
Arbitrary d
ata"
}
TextArea
{
id
:
rawDataField
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
height
:
150
...
...
@@ -105,7 +106,7 @@ ApplicationWindow {
SplitView
{
orientation
:
Qt
.
Horizontal
height
:
30
0
height
:
25
0
TableView
{
id
:
stackTableView
...
...
@@ -149,16 +150,15 @@ ApplicationWindow {
}
}
}
statusBar
:
Status
Bar
{
toolBar
:
Tool
Bar
{
RowLayout
{
spacing
:
5
anchors.fill
:
parent
Button
{
property
var
enabled
:
true
id
:
debugStart
onClicked
:
{
dbg
.
debug
(
txValue
.
text
,
txGas
.
text
,
txGasPrice
.
text
,
codeEditor
.
text
)
dbg
.
debug
(
txValue
.
text
,
txGas
.
text
,
txGasPrice
.
text
,
codeEditor
.
text
,
rawDataField
.
text
)
}
text
:
"Debug"
}
...
...
ethereal/assets/heart.png
0 → 100644
View file @
a0f73c27
4.18 KB
ethereal/assets/qml/wallet.qml
View file @
a0f73c27
...
...
@@ -123,7 +123,7 @@ ApplicationWindow {
}
Image
{
source
:
ui
.
assetPath
(
"
ne
t.png"
)
source
:
ui
.
assetPath
(
"
hear
t.png"
)
anchors.horizontalCenter
:
parent
.
horizontalCenter
MouseArea
{
anchors.fill
:
parent
...
...
@@ -286,25 +286,12 @@ ApplicationWindow {
//ui.open(openAppDialog.fileUrl.toString())
//ui.openHtml(Qt.resolvedUrl(ui.assetPath("test.html")))
ui
.
openHtml
(
openAppDialog
.
fileUrl
.
toString
())
}
}
statusBar
:
StatusBar
{
RowLayout
{
anchors.fill
:
parent
/*
Button {
property var enabled: true
id: connectButton
onClicked: {
if(this.enabled) {
ui.connect(this)
}
}
text: "Connect"
}
*/
Button
{
property
var
enabled
:
true
...
...
ethereal/ui/debugger.go
View file @
a0f73c27
...
...
@@ -5,6 +5,8 @@ import (
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethutil"
"github.com/go-qml/qml"
"math/big"
"strings"
)
type
DebuggerWindow
struct
{
...
...
@@ -39,11 +41,35 @@ func (self *DebuggerWindow) Show() {
}()
}
func
(
self
*
DebuggerWindow
)
Debug
(
valueStr
,
gasStr
,
gasPriceStr
,
data
string
)
{
func
formatData
(
data
string
)
[]
byte
{
if
len
(
data
)
==
0
{
return
nil
}
// Simple stupid
d
:=
new
(
big
.
Int
)
if
data
[
0
:
1
]
==
"
\"
"
&&
data
[
len
(
data
)
-
1
:
]
==
"
\"
"
{
d
.
SetBytes
([]
byte
(
data
[
1
:
len
(
data
)
-
1
]))
}
else
if
data
[
:
2
]
==
"0x"
{
d
.
SetBytes
(
ethutil
.
FromHex
(
data
[
2
:
]))
}
else
{
d
.
SetString
(
data
,
0
)
}
return
ethutil
.
BigToBytes
(
d
,
256
)
}
func
(
self
*
DebuggerWindow
)
Debug
(
valueStr
,
gasStr
,
gasPriceStr
,
scriptStr
,
dataStr
string
)
{
if
!
self
.
Db
.
done
{
self
.
Db
.
Q
<-
true
}
dataSlice
:=
strings
.
Split
(
dataStr
,
"
\n
"
)
var
data
[]
byte
for
_
,
dataItem
:=
range
dataSlice
{
d
:=
formatData
(
dataItem
)
data
=
append
(
data
,
d
...
)
}
state
:=
self
.
lib
.
eth
.
BlockChain
()
.
CurrentBlock
.
State
()
defer
func
()
{
...
...
@@ -52,7 +78,7 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, data string) {
}
}()
script
,
err
:=
ethutil
.
Compile
(
data
)
script
,
err
:=
ethutil
.
Compile
(
scriptStr
)
if
err
!=
nil
{
ethutil
.
Config
.
Log
.
Debugln
(
err
)
...
...
@@ -72,7 +98,7 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, data string) {
account
:=
self
.
lib
.
eth
.
StateManager
()
.
TransState
()
.
GetAccount
(
keyPair
.
Address
())
contract
:=
ethchain
.
MakeContract
(
callerTx
,
state
)
callerClosure
:=
ethchain
.
NewClosure
(
account
,
contract
,
contract
.
Init
()
,
state
,
ethutil
.
Big
(
gasStr
),
ethutil
.
Big
(
gasPriceStr
))
callerClosure
:=
ethchain
.
NewClosure
(
account
,
contract
,
script
,
state
,
ethutil
.
Big
(
gasStr
),
ethutil
.
Big
(
gasPriceStr
))
block
:=
self
.
lib
.
eth
.
BlockChain
()
.
CurrentBlock
vm
:=
ethchain
.
NewVm
(
state
,
self
.
lib
.
eth
.
StateManager
(),
ethchain
.
RuntimeVars
{
...
...
@@ -86,7 +112,7 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, data string) {
self
.
Db
.
done
=
false
go
func
()
{
callerClosure
.
Call
(
vm
,
contract
.
Init
()
,
self
.
Db
.
halting
)
callerClosure
.
Call
(
vm
,
data
,
self
.
Db
.
halting
)
state
.
Reset
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment