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
dc944f75
Commit
dc944f75
authored
Sep 25, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some lookup helper methods for name reg
parent
d5d1e503
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
2 deletions
+36
-2
jeffcoin.qml
mist/assets/qml/views/jeffcoin/jeffcoin.qml
+7
-1
wallet.qml
mist/assets/qml/views/wallet.qml
+3
-1
ui_lib.go
mist/ui_lib.go
+26
-0
No files found.
mist/assets/qml/views/jeffcoin/jeffcoin.qml
View file @
dc944f75
...
...
@@ -22,6 +22,8 @@ Rectangle {
var
me
=
eth
.
key
().
address
;
if
((
to
==
me
||
from
==
me
)
&&
message
.
input
.
length
==
128
)
{
var
to
=
eth
.
lookupName
(
to
)
var
from
=
eth
.
lookupName
(
from
)
txModel
.
insert
(
0
,
{
confirmations
:
blockNumber
-
message
.
number
,
from
:
from
,
to
:
to
,
value
:
value
})
}
}
...
...
@@ -151,7 +153,11 @@ Rectangle {
Button
{
text
:
"Send"
onClicked
:
{
eth
.
transact
({
from
:
eth
.
key
().
privateKey
,
to
:
address
,
gas
:
"9000"
,
gasPrice
:
"10000000000000"
,
data
:
[
"0x"
+
txTo
.
text
,
txValue
.
text
]})
var
lookup
=
eth
.
lookupAddress
(
address
)
if
(
lookup
.
length
==
0
)
lookup
=
address
eth
.
transact
({
from
:
eth
.
key
().
privateKey
,
to
:
lookup
,
gas
:
"9000"
,
gasPrice
:
"10000000000000"
,
data
:
[
"0x"
+
txTo
.
text
,
txValue
.
text
]})
}
}
}
...
...
mist/assets/qml/views/wallet.qml
View file @
dc944f75
...
...
@@ -160,7 +160,9 @@ Rectangle {
function
addTxs
(
messages
)
{
for
(
var
i
=
0
;
i
<
messages
.
length
;
i
++
)
{
var
message
=
messages
.
get
(
i
);
txModel
.
insert
(
0
,
{
num
:
txModel
.
count
,
from
:
message
.
from
,
to
:
message
.
to
,
value
:
eth
.
numberToHuman
(
message
.
value
)})
var
to
=
eth
.
lookupName
(
message
.
to
);
var
from
=
eth
.
lookupName
(
message
.
from
);
txModel
.
insert
(
0
,
{
num
:
txModel
.
count
,
from
:
from
,
to
:
to
,
value
:
eth
.
numberToHuman
(
message
.
value
)})
}
}
}
...
...
mist/ui_lib.go
View file @
dc944f75
...
...
@@ -71,6 +71,32 @@ func (self *UiLib) LookupDomain(domain string) string {
}
}
func
(
self
*
UiLib
)
LookupName
(
addr
string
)
string
{
var
(
nameReg
=
self
.
World
()
.
Config
()
.
Get
(
"NameReg"
)
lookup
=
nameReg
.
Storage
(
ethutil
.
Hex2Bytes
(
addr
))
)
if
lookup
.
Len
()
!=
0
{
return
strings
.
Trim
(
lookup
.
Str
(),
"
\x00
"
)
}
return
addr
}
func
(
self
*
UiLib
)
LookupAddress
(
name
string
)
string
{
var
(
nameReg
=
self
.
World
()
.
Config
()
.
Get
(
"NameReg"
)
lookup
=
nameReg
.
Storage
(
ethutil
.
RightPadBytes
([]
byte
(
name
),
32
))
)
if
lookup
.
Len
()
!=
0
{
return
ethutil
.
Bytes2Hex
(
lookup
.
Bytes
())
}
return
""
}
func
(
self
*
UiLib
)
PastPeers
()
*
ethutil
.
List
{
return
ethutil
.
NewList
(
eth
.
PastPeers
())
}
...
...
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