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
9022f503
Commit
9022f503
authored
Jan 29, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
default values removed
parent
bd992e7b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
16 deletions
+24
-16
coin.html
cmd/mist/assets/examples/coin.html
+19
-11
packages.go
rpc/packages.go
+1
-1
encoding.go
trie/encoding.go
+3
-3
node.go
trie/node.go
+1
-1
No files found.
cmd/mist/assets/examples/coin.html
View file @
9022f503
...
@@ -53,12 +53,17 @@
...
@@ -53,12 +53,17 @@
"outputs"
:
[]
"outputs"
:
[]
}];
}];
var
code
=
"0x60056011565b60ae8060356000396000f35b64174876e800600033600160a060020a031660005260205260406000208190555056006001600060e060020a600035048063d0679d34146022578063e3d670d714603457005b602e6004356024356047565b60006000f35b603d600435608d565b8060005260206000f35b80600083600160a060020a0316600052602052604060002090815401908190555080600033600160a060020a031660005260205260406000209081540390819055505050565b6000600082600160a060020a0316600052602052604060002054905091905056"
;
var
address
=
web3
.
db
.
get
(
"jevcoin"
,
"address"
);
var
address
=
web3
.
eth
.
transact
({
if
(
address
.
length
==
0
)
{
data
:
code
,
var
code
=
"0x60056011565b60ae8060356000396000f35b64174876e800600033600160a060020a031660005260205260406000208190555056006001600060e060020a600035048063d0679d34146022578063e3d670d714603457005b602e6004356024356047565b60006000f35b603d600435608d565b8060005260206000f35b80600083600160a060020a0316600052602052604060002090815401908190555080600033600160a060020a031660005260205260406000209081540390819055505050565b6000600082600160a060020a0316600052602052604060002054905091905056"
;
gasprice
:
"1000000000000000"
,
address
=
web3
.
eth
.
transact
({
gas
:
"10000"
,
data
:
code
,
});
gasprice
:
"1000000000000000"
,
gas
:
"10000"
,
});
web3
.
db
.
put
(
"jevcoin"
,
"address"
,
address
);
}
var
contract
=
web3
.
eth
.
contract
(
address
,
desc
);
var
contract
=
web3
.
eth
.
contract
(
address
,
desc
);
document
.
querySelector
(
"#balance"
).
innerHTML
=
contract
.
call
().
balance
(
eth
.
coinbase
);
document
.
querySelector
(
"#balance"
).
innerHTML
=
contract
.
call
().
balance
(
eth
.
coinbase
);
...
@@ -73,13 +78,16 @@
...
@@ -73,13 +78,16 @@
}
}
function
transact
()
{
function
transact
()
{
//var to = "0x"+document.querySelector("#address").value;
var
to
=
document
.
querySelector
(
"#address"
).
value
;
var
to
=
"0x4205b06c2cfa0e30359edcab94543266cb6fa1d3"
;
if
(
to
.
length
==
0
)
{
console
.
log
(
"to "
+
to
);
to
=
"0x4205b06c2cfa0e30359edcab94543266cb6fa1d3"
;
}
else
{
to
=
"0x"
+
to
;
}
var
value
=
parseInt
(
document
.
querySelector
(
"#amount"
).
value
);
var
value
=
parseInt
(
document
.
querySelector
(
"#amount"
).
value
);
console
.
log
(
"value "
+
value
);
contract
.
transact
({
gas
:
"10000"
,
gas
Price
:
"1000000000000"
}).
send
(
to
,
value
);
contract
.
transact
({
gas
:
"10000"
,
gas
price
:
eth
.
gasPrice
}).
send
(
to
,
value
);
}
}
reflesh
();
reflesh
();
...
...
rpc/packages.go
View file @
9022f503
...
@@ -334,7 +334,7 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
...
@@ -334,7 +334,7 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
}
}
return
p
.
FilterChanged
(
args
,
reply
)
return
p
.
FilterChanged
(
args
,
reply
)
case
"eth_gasPrice"
:
case
"eth_gasPrice"
:
*
reply
=
"10000000000000
00
"
*
reply
=
"10000000000000"
return
nil
return
nil
case
"web3_sha3"
:
case
"web3_sha3"
:
args
,
err
:=
req
.
ToSha3Args
()
args
,
err
:=
req
.
ToSha3Args
()
...
...
trie/encoding.go
View file @
9022f503
...
@@ -49,7 +49,7 @@ func CompactDecode(str string) []byte {
...
@@ -49,7 +49,7 @@ func CompactDecode(str string) []byte {
func
CompactHexDecode
(
str
string
)
[]
byte
{
func
CompactHexDecode
(
str
string
)
[]
byte
{
base
:=
"0123456789abcdef"
base
:=
"0123456789abcdef"
hexSlice
:=
make
([]
byte
,
0
)
var
hexSlice
[]
byte
enc
:=
hex
.
EncodeToString
([]
byte
(
str
))
enc
:=
hex
.
EncodeToString
([]
byte
(
str
))
for
_
,
v
:=
range
enc
{
for
_
,
v
:=
range
enc
{
...
@@ -61,7 +61,7 @@ func CompactHexDecode(str string) []byte {
...
@@ -61,7 +61,7 @@ func CompactHexDecode(str string) []byte {
}
}
func
DecodeCompact
(
key
[]
byte
)
string
{
func
DecodeCompact
(
key
[]
byte
)
string
{
base
:
=
"0123456789abcdef"
const
base
=
"0123456789abcdef"
var
str
string
var
str
string
for
_
,
v
:=
range
key
{
for
_
,
v
:=
range
key
{
...
@@ -70,7 +70,7 @@ func DecodeCompact(key []byte) string {
...
@@ -70,7 +70,7 @@ func DecodeCompact(key []byte) string {
}
}
}
}
res
,
_
:=
hex
.
DecodeString
(
str
)
res
,
err
:=
hex
.
DecodeString
(
str
)
return
string
(
res
)
return
string
(
res
)
}
}
trie/node.go
View file @
9022f503
...
@@ -18,7 +18,7 @@ func (self *ValueNode) String() string { return self.fstring("") }
...
@@ -18,7 +18,7 @@ func (self *ValueNode) String() string { return self.fstring("") }
func
(
self
*
FullNode
)
String
()
string
{
return
self
.
fstring
(
""
)
}
func
(
self
*
FullNode
)
String
()
string
{
return
self
.
fstring
(
""
)
}
func
(
self
*
ShortNode
)
String
()
string
{
return
self
.
fstring
(
""
)
}
func
(
self
*
ShortNode
)
String
()
string
{
return
self
.
fstring
(
""
)
}
func
(
self
*
ValueNode
)
fstring
(
ind
string
)
string
{
return
fmt
.
Sprintf
(
"%x "
,
self
.
data
)
}
func
(
self
*
ValueNode
)
fstring
(
ind
string
)
string
{
return
fmt
.
Sprintf
(
"%x "
,
self
.
data
)
}
func
(
self
*
HashNode
)
fstring
(
ind
string
)
string
{
return
fmt
.
Sprintf
(
"
%x
"
,
self
.
key
)
}
func
(
self
*
HashNode
)
fstring
(
ind
string
)
string
{
return
fmt
.
Sprintf
(
"
< %x >
"
,
self
.
key
)
}
// Full node
// Full node
func
(
self
*
FullNode
)
fstring
(
ind
string
)
string
{
func
(
self
*
FullNode
)
fstring
(
ind
string
)
string
{
...
...
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