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
203c4b99
Commit
203c4b99
authored
Aug 15, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LookupDomain method to uilib
parent
9f488683
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
3 deletions
+31
-3
webapp.qml
ethereal/assets/qml/webapp.qml
+1
-1
main.go
ethereal/main.go
+1
-1
ui_lib.go
ethereal/ui_lib.go
+28
-0
main.go
ethereum/main.go
+1
-1
No files found.
ethereal/assets/qml/webapp.qml
View file @
203c4b99
...
@@ -103,7 +103,7 @@ ApplicationWindow {
...
@@ -103,7 +103,7 @@ ApplicationWindow {
uri
.
replace
(
reg
,
function
(
match
,
pre
,
domain
,
path
)
{
uri
.
replace
(
reg
,
function
(
match
,
pre
,
domain
,
path
)
{
uri
=
pre
;
uri
=
pre
;
var
lookup
=
eth
.
lookupDomain
(
domain
.
substring
(
0
,
domain
.
length
-
4
));
var
lookup
=
ui
.
lookupDomain
(
domain
.
substring
(
0
,
domain
.
length
-
4
));
var
ip
=
[];
var
ip
=
[];
for
(
var
i
=
0
,
l
=
lookup
.
length
;
i
<
l
;
i
++
)
{
for
(
var
i
=
0
,
l
=
lookup
.
length
;
i
<
l
;
i
++
)
{
ip
.
push
(
lookup
.
charCodeAt
(
i
))
ip
.
push
(
lookup
.
charCodeAt
(
i
))
...
...
ethereal/main.go
View file @
203c4b99
...
@@ -12,7 +12,7 @@ import (
...
@@ -12,7 +12,7 @@ import (
const
(
const
(
ClientIdentifier
=
"Ethereal"
ClientIdentifier
=
"Ethereal"
Version
=
"0.6.
1
"
Version
=
"0.6.
2
"
)
)
var
ethereum
*
eth
.
Ethereum
var
ethereum
*
eth
.
Ethereum
...
...
ethereal/ui_lib.go
View file @
203c4b99
package
main
package
main
import
(
import
(
"bytes"
"fmt"
"fmt"
"path"
"path"
"strconv"
"strings"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethcrypto"
"github.com/ethereum/eth-go/ethpipe"
"github.com/ethereum/eth-go/ethpipe"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/javascript"
...
@@ -36,6 +40,30 @@ func NewUiLib(engine *qml.Engine, eth *eth.Ethereum, assetPath string) *UiLib {
...
@@ -36,6 +40,30 @@ func NewUiLib(engine *qml.Engine, eth *eth.Ethereum, assetPath string) *UiLib {
return
&
UiLib
{
JSPipe
:
ethpipe
.
NewJSPipe
(
eth
),
engine
:
engine
,
eth
:
eth
,
assetPath
:
assetPath
,
jsEngine
:
javascript
.
NewJSRE
(
eth
)}
return
&
UiLib
{
JSPipe
:
ethpipe
.
NewJSPipe
(
eth
),
engine
:
engine
,
eth
:
eth
,
assetPath
:
assetPath
,
jsEngine
:
javascript
.
NewJSRE
(
eth
)}
}
}
func
(
self
*
UiLib
)
LookupDomain
(
domain
string
)
string
{
world
:=
self
.
World
()
if
len
(
domain
)
>
32
{
domain
=
string
(
ethcrypto
.
Sha3Bin
([]
byte
(
domain
)))
}
data
:=
world
.
Config
()
.
Get
(
"DnsReg"
)
.
StorageString
(
domain
)
.
Bytes
()
// Left padded = A record, Right padded = CNAME
if
data
[
0
]
==
0
{
data
=
bytes
.
TrimLeft
(
data
,
"
\x00
"
)
var
ipSlice
[]
string
for
_
,
d
:=
range
data
{
ipSlice
=
append
(
ipSlice
,
strconv
.
Itoa
(
int
(
d
)))
}
return
strings
.
Join
(
ipSlice
,
"."
)
}
else
{
data
=
bytes
.
TrimRight
(
data
,
"
\x00
"
)
return
string
(
data
)
}
}
func
(
self
*
UiLib
)
ImportTx
(
rlpTx
string
)
{
func
(
self
*
UiLib
)
ImportTx
(
rlpTx
string
)
{
tx
:=
ethchain
.
NewTransactionFromBytes
(
ethutil
.
Hex2Bytes
(
rlpTx
))
tx
:=
ethchain
.
NewTransactionFromBytes
(
ethutil
.
Hex2Bytes
(
rlpTx
))
self
.
eth
.
TxPool
()
.
QueueTransaction
(
tx
)
self
.
eth
.
TxPool
()
.
QueueTransaction
(
tx
)
...
...
ethereum/main.go
View file @
203c4b99
...
@@ -13,7 +13,7 @@ import (
...
@@ -13,7 +13,7 @@ import (
const
(
const
(
ClientIdentifier
=
"Ethereum(G)"
ClientIdentifier
=
"Ethereum(G)"
Version
=
"0.6.
1
"
Version
=
"0.6.
2
"
)
)
var
logger
=
ethlog
.
NewLogger
(
"CLI"
)
var
logger
=
ethlog
.
NewLogger
(
"CLI"
)
...
...
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