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
b962779a
Commit
b962779a
authored
Apr 23, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor update and fixes to the gui and console
parent
a3c8f835
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
11 deletions
+23
-11
_new_contract.qml
ethereal/assets/qml/newTransaction/_new_contract.qml
+3
-3
_simple_send.qml
ethereal/assets/qml/newTransaction/_simple_send.qml
+3
-3
gui.go
ethereal/ui/gui.go
+1
-0
library.go
ethereal/ui/library.go
+6
-3
ui_lib.go
ethereal/ui/ui_lib.go
+9
-1
dev_console.go
ethereum/dev_console.go
+1
-1
No files found.
ethereal/assets/qml/newTransaction/_new_contract.qml
View file @
b962779a
...
...
@@ -135,18 +135,18 @@ Component {
Button
{
id
:
txButton
/* enabled: false */
states
:
[
State
{
name
:
"READY"
PropertyChanges
{
target
:
txButton
;
enabled
:
true
}
PropertyChanges
{
target
:
txButton
;
/*enabled: true*/
}
},
State
{
name
:
"NOTREADY"
PropertyChanges
{
target
:
txButton
;
enabled
:
false
}
PropertyChanges
{
target
:
txButton
;
/*enabled:false*/
}
}
]
text
:
"Send"
enabled
:
false
onClicked
:
{
//this.enabled = false
var
res
=
eth
.
createTx
(
txFuelRecipient
.
text
,
txValue
.
text
,
txGas
.
text
,
txGasPrice
.
text
,
codeView
.
text
)
...
...
ethereal/assets/qml/newTransaction/_simple_send.qml
View file @
b962779a
...
...
@@ -63,18 +63,18 @@ Component {
}
Button
{
id
:
txSimpleButton
/*enabled: false*/
states
:
[
State
{
name
:
"READY"
PropertyChanges
{
target
:
txSimpleButton
;
enabled
:
true
}
PropertyChanges
{
target
:
txSimpleButton
;
/*enabled: true*/
}
},
State
{
name
:
"NOTREADY"
PropertyChanges
{
target
:
txSimpleButton
;
enabled
:
false
}
PropertyChanges
{
target
:
txSimpleButton
;
/*enabled: false*/
}
}
]
text
:
"Send"
enabled
:
false
onClicked
:
{
//this.enabled = false
var
res
=
eth
.
createTx
(
txSimpleRecipient
.
text
,
txSimpleValue
.
text
,
""
,
""
,
""
)
...
...
ethereal/ui/gui.go
View file @
b962779a
...
...
@@ -113,6 +113,7 @@ func (ui *Gui) Start(assetPath string) {
}
if
err
!=
nil
{
ethutil
.
Config
.
Log
.
Infoln
(
"FATAL: asset not found: you can set an alternative asset path on on the command line using option 'asset_path'"
)
panic
(
err
)
}
...
...
ethereal/ui/library.go
View file @
b962779a
...
...
@@ -44,6 +44,7 @@ func (lib *EthLib) CreateAndSetPrivKey() (string, string, string, string) {
}
func
(
lib
*
EthLib
)
CreateTx
(
recipient
,
valueStr
,
gasStr
,
gasPriceStr
,
data
string
)
(
string
,
error
)
{
fmt
.
Println
(
"Create tx"
)
var
hash
[]
byte
var
contractCreation
bool
if
len
(
recipient
)
==
0
{
...
...
@@ -64,18 +65,21 @@ func (lib *EthLib) CreateTx(recipient, valueStr, gasStr, gasPriceStr, data strin
// Compile and assemble the given data
if
contractCreation
{
mainInput
,
initInput
:=
ethutil
.
PreProcess
(
data
)
fmt
.
Println
(
"Precompile done"
)
fmt
.
Println
(
"main"
,
mainInput
)
mainScript
,
err
:=
utils
.
Compile
(
mainInput
)
if
err
!=
nil
{
return
""
,
err
}
fmt
.
Println
(
"init"
,
initInput
)
initScript
,
err
:=
utils
.
Compile
(
initInput
)
if
err
!=
nil
{
return
""
,
err
}
tx
=
ethchain
.
NewContractCreationTx
(
value
,
gasPrice
,
mainScript
,
initScript
)
tx
=
ethchain
.
NewContractCreationTx
(
value
,
gas
,
gas
Price
,
mainScript
,
initScript
)
}
else
{
tx
=
ethchain
.
NewTransactionMessage
(
hash
,
value
,
gas
Price
,
gas
,
nil
)
tx
=
ethchain
.
NewTransactionMessage
(
hash
,
value
,
gas
,
gasPrice
,
nil
)
}
acc
:=
lib
.
stateManager
.
GetAddrState
(
keyPair
.
Address
())
tx
.
Nonce
=
acc
.
Nonce
...
...
@@ -99,7 +103,6 @@ func (lib *EthLib) GetBlock(hexHash string) *Block {
}
block
:=
lib
.
blockChain
.
GetBlock
(
hash
)
fmt
.
Println
(
block
)
return
&
Block
{
Number
:
int
(
block
.
BlockInfo
()
.
Number
),
Hash
:
ethutil
.
Hex
(
block
.
Hash
())}
}
ethereal/ui/ui_lib.go
View file @
b962779a
...
...
@@ -59,6 +59,14 @@ func (ui *UiLib) OpenHtml(path string) {
return
}
win
:=
component
.
CreateWindow
(
nil
)
if
filepath
.
Ext
(
path
)
==
"eth"
{
fmt
.
Println
(
"Ethereum package not yet supported"
)
return
// TODO
ethutil
.
OpenPackage
(
path
)
}
win
.
Set
(
"url"
,
path
)
go
func
()
{
...
...
@@ -126,7 +134,7 @@ func (ui *UiLib) DebugTx(recipient, valueStr, gasStr, gasPriceStr, data string)
for
_
,
str
:=
range
dis
{
ui
.
win
.
Root
()
.
Call
(
"setAsm"
,
str
)
}
callerTx
:=
ethchain
.
NewContractCreationTx
(
ethutil
.
Big
(
valueStr
),
ethutil
.
Big
(
gasPriceStr
),
callerScript
,
nil
)
callerTx
:=
ethchain
.
NewContractCreationTx
(
ethutil
.
Big
(
valueStr
),
ethutil
.
Big
(
gas
Str
),
ethutil
.
Big
(
gas
PriceStr
),
callerScript
,
nil
)
// Contract addr as test address
keyPair
:=
ethutil
.
Config
.
Db
.
GetKeys
()[
0
]
...
...
ethereum/dev_console.go
View file @
b962779a
...
...
@@ -204,7 +204,7 @@ func (i *Console) ParseInput(input string) bool {
break
}
contract
:=
ethchain
.
NewContractCreationTx
(
ethutil
.
Big
(
tokens
[
0
]),
ethutil
.
Big
(
tokens
[
1
]),
mainScript
,
initScript
)
contract
:=
ethchain
.
NewContractCreationTx
(
ethutil
.
Big
(
tokens
[
0
]),
ethutil
.
Big
(
tokens
[
1
]),
ethutil
.
Big
(
tokens
[
1
]),
mainScript
,
initScript
)
key
:=
ethutil
.
Config
.
Db
.
GetKeys
()[
0
]
contract
.
Sign
(
key
.
PrivateKey
)
...
...
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