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
d35380c1
Commit
d35380c1
authored
May 23, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New main script through init return value
parent
5f8911f7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
10 deletions
+17
-10
gui.go
ethereal/ui/gui.go
+2
-3
ui_lib.go
ethereal/ui/ui_lib.go
+1
-1
config.go
ethereum/config.go
+1
-2
repl.go
ethereum/repl.go
+12
-3
repl_darwin.go
ethereum/repl_darwin.go
+1
-1
No files found.
ethereal/ui/gui.go
View file @
d35380c1
...
...
@@ -9,7 +9,6 @@ import (
"github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethutil"
"github.com/go-qml/qml"
"github.com/obscuren/mutan"
"math/big"
"strings"
)
...
...
@@ -262,7 +261,7 @@ func (gui *Gui) Transact(recipient, value, gas, gasPrice, data string) (*ethpub.
func
(
gui
*
Gui
)
Create
(
recipient
,
value
,
gas
,
gasPrice
,
data
string
)
(
*
ethpub
.
PReceipt
,
error
)
{
keyPair
:=
ethutil
.
GetKeyRing
()
.
Get
(
0
)
mainInput
,
initInput
:=
mutan
.
PreParse
(
data
)
//
mainInput, initInput := mutan.PreParse(data)
return
gui
.
pub
.
Create
(
ethutil
.
Hex
(
keyPair
.
PrivateKey
),
value
,
gas
,
gasPrice
,
initInput
,
mainInput
)
return
gui
.
pub
.
Create
(
ethutil
.
Hex
(
keyPair
.
PrivateKey
),
value
,
gas
,
gasPrice
,
data
)
}
ethereal/ui/ui_lib.go
View file @
d35380c1
...
...
@@ -135,7 +135,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
(
gasStr
),
ethutil
.
Big
(
gasPriceStr
),
callerScript
,
nil
)
callerTx
:=
ethchain
.
NewContractCreationTx
(
ethutil
.
Big
(
valueStr
),
ethutil
.
Big
(
gasStr
),
ethutil
.
Big
(
gasPriceStr
),
nil
)
// Contract addr as test address
keyPair
:=
ethutil
.
GetKeyRing
()
.
Get
(
0
)
...
...
ethereum/config.go
View file @
d35380c1
...
...
@@ -31,7 +31,7 @@ func Init() {
flag
.
PrintDefaults
()
}
flag
.
StringVar
(
&
Identifier
,
"i"
,
""
,
"
C
ustom client identifier"
)
flag
.
StringVar
(
&
Identifier
,
"i"
,
""
,
"
c
ustom client identifier"
)
flag
.
BoolVar
(
&
StartMining
,
"m"
,
false
,
"start dagger mining"
)
flag
.
BoolVar
(
&
ShowGenesis
,
"g"
,
false
,
"prints genesis header and exits"
)
flag
.
BoolVar
(
&
StartRpc
,
"r"
,
false
,
"start rpc server"
)
...
...
@@ -47,7 +47,6 @@ func Init() {
flag
.
StringVar
(
&
ImportKey
,
"import"
,
""
,
"imports the given private key (hex)"
)
flag
.
IntVar
(
&
MaxPeer
,
"x"
,
10
,
"maximum desired peers"
)
flag
.
BoolVar
(
&
StartJsConsole
,
"js"
,
false
,
"exp"
)
//flag.StringVar(&InputFile, "e", "", "Run javascript file")
flag
.
Parse
()
...
...
ethereum/repl.go
View file @
d35380c1
...
...
@@ -48,13 +48,22 @@ func (self *JSRepl) parseInput(code string) {
// The JSEthereum object attempts to wrap the PEthereum object and returns
// meaningful javascript objects
type
JSBlock
struct
{
*
ethpub
.
PBlock
eth
*
JSEthereum
}
func
(
self
*
JSBlock
)
GetTransaction
(
hash
string
)
otto
.
Value
{
return
self
.
eth
.
toVal
(
self
.
PBlock
.
GetTransaction
(
hash
))
}
type
JSEthereum
struct
{
*
ethpub
.
PEthereum
vm
*
otto
.
Otto
}
func
(
self
*
JSEthereum
)
GetBlock
(
hash
string
)
otto
.
Value
{
return
self
.
toVal
(
self
.
PEthereum
.
GetBlock
(
hash
)
)
return
self
.
toVal
(
&
JSBlock
{
self
.
PEthereum
.
GetBlock
(
hash
),
self
}
)
}
func
(
self
*
JSEthereum
)
GetKey
()
otto
.
Value
{
...
...
@@ -76,8 +85,8 @@ func (self *JSEthereum) Transact(key, recipient, valueStr, gasStr, gasPriceStr,
return
self
.
toVal
(
r
)
}
func
(
self
*
JSEthereum
)
Create
(
key
,
valueStr
,
gasStr
,
gasPriceStr
,
initStr
,
body
Str
string
)
otto
.
Value
{
r
,
err
:=
self
.
PEthereum
.
Create
(
key
,
valueStr
,
gasStr
,
gasPriceStr
,
initStr
,
body
Str
)
func
(
self
*
JSEthereum
)
Create
(
key
,
valueStr
,
gasStr
,
gasPriceStr
,
script
Str
string
)
otto
.
Value
{
r
,
err
:=
self
.
PEthereum
.
Create
(
key
,
valueStr
,
gasStr
,
gasPriceStr
,
script
Str
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
...
...
ethereum/repl_darwin.go
View file @
d35380c1
...
...
@@ -102,7 +102,7 @@ L:
break
L
}
addHistory
(
str
)
//allow user to recall this line
addHistory
(
str
[
:
len
(
str
)
-
1
]
)
//allow user to recall this line
self
.
parseInput
(
str
)
...
...
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