good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
ad420d09
Commit
ad420d09
authored
Mar 24, 2015
by
Taylor Gerring
Browse files
Options
Downloads
Patches
Plain Diff
rename eth to backend
parent
6d41402d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
xeth/state.go
+1
-1
1 addition, 1 deletion
xeth/state.go
xeth/xeth.go
+16
-16
16 additions, 16 deletions
xeth/xeth.go
with
17 additions
and
17 deletions
xeth/state.go
+
1
−
1
View file @
ad420d09
...
...
@@ -29,7 +29,7 @@ func (self *State) SafeGet(addr string) *Object {
func
(
self
*
State
)
safeGet
(
addr
string
)
*
state
.
StateObject
{
object
:=
self
.
state
.
GetStateObject
(
common
.
HexToAddress
(
addr
))
if
object
==
nil
{
object
=
state
.
NewStateObject
(
common
.
HexToAddress
(
addr
),
self
.
xeth
.
eth
.
StateDb
())
object
=
state
.
NewStateObject
(
common
.
HexToAddress
(
addr
),
self
.
xeth
.
backend
.
StateDb
())
}
return
object
...
...
This diff is collapsed.
Click to expand it.
xeth/xeth.go
+
16
−
16
View file @
ad420d09
...
...
@@ -56,7 +56,7 @@ func (dummyFrontend) UnlockAccount([]byte) bool { return false
func
(
dummyFrontend
)
ConfirmTransaction
(
*
types
.
Transaction
)
bool
{
return
true
}
type
XEth
struct
{
eth
*
eth
.
Ethereum
backend
*
eth
.
Ethereum
blockProcessor
*
core
.
BlockProcessor
chainManager
*
core
.
ChainManager
accountManager
*
accounts
.
Manager
...
...
@@ -86,7 +86,7 @@ type XEth struct {
// confirms all transactions will be used.
func
New
(
eth
*
eth
.
Ethereum
,
frontend
Frontend
)
*
XEth
{
xeth
:=
&
XEth
{
eth
:
eth
,
backend
:
eth
,
blockProcessor
:
eth
.
BlockProcessor
(),
chainManager
:
eth
.
ChainManager
(),
accountManager
:
eth
.
AccountManager
(),
...
...
@@ -169,10 +169,10 @@ func (self *XEth) AtStateNum(num int64) *XEth {
return
self
.
WithState
(
st
)
}
func
(
self
*
XEth
)
Backend
()
*
eth
.
Ethereum
{
return
self
.
eth
}
func
(
self
*
XEth
)
Backend
()
*
eth
.
Ethereum
{
return
self
.
backend
}
func
(
self
*
XEth
)
WithState
(
statedb
*
state
.
StateDB
)
*
XEth
{
xeth
:=
&
XEth
{
eth
:
self
.
eth
,
backend
:
self
.
backend
,
blockProcessor
:
self
.
blockProcessor
,
chainManager
:
self
.
chainManager
,
whisper
:
self
.
whisper
,
...
...
@@ -200,7 +200,7 @@ func (self *XEth) EthBlockByHash(strHash string) *types.Block {
}
func
(
self
*
XEth
)
EthTransactionByHash
(
hash
string
)
*
types
.
Transaction
{
data
,
_
:=
self
.
eth
.
ExtraDb
()
.
Get
(
common
.
FromHex
(
hash
))
data
,
_
:=
self
.
backend
.
ExtraDb
()
.
Get
(
common
.
FromHex
(
hash
))
if
len
(
data
)
!=
0
{
return
types
.
NewTransactionFromBytes
(
data
)
}
...
...
@@ -247,7 +247,7 @@ func (self *XEth) Block(v interface{}) *Block {
func
(
self
*
XEth
)
Accounts
()
[]
string
{
// TODO: check err?
accounts
,
_
:=
self
.
eth
.
AccountManager
()
.
Accounts
()
accounts
,
_
:=
self
.
backend
.
AccountManager
()
.
Accounts
()
accountAddresses
:=
make
([]
string
,
len
(
accounts
))
for
i
,
ac
:=
range
accounts
{
accountAddresses
[
i
]
=
common
.
ToHex
(
ac
.
Address
)
...
...
@@ -256,31 +256,31 @@ func (self *XEth) Accounts() []string {
}
func
(
self
*
XEth
)
PeerCount
()
int
{
return
self
.
eth
.
PeerCount
()
return
self
.
backend
.
PeerCount
()
}
func
(
self
*
XEth
)
IsMining
()
bool
{
return
self
.
eth
.
IsMining
()
return
self
.
backend
.
IsMining
()
}
func
(
self
*
XEth
)
SetMining
(
shouldmine
bool
)
bool
{
ismining
:=
self
.
eth
.
IsMining
()
ismining
:=
self
.
backend
.
IsMining
()
if
shouldmine
&&
!
ismining
{
err
:=
self
.
eth
.
StartMining
()
err
:=
self
.
backend
.
StartMining
()
return
err
==
nil
}
if
ismining
&&
!
shouldmine
{
self
.
eth
.
StopMining
()
self
.
backend
.
StopMining
()
}
return
self
.
eth
.
IsMining
()
return
self
.
backend
.
IsMining
()
}
func
(
self
*
XEth
)
IsListening
()
bool
{
return
self
.
eth
.
IsListening
()
return
self
.
backend
.
IsListening
()
}
func
(
self
*
XEth
)
Coinbase
()
string
{
cb
,
_
:=
self
.
eth
.
AccountManager
()
.
Coinbase
()
cb
,
_
:=
self
.
backend
.
AccountManager
()
.
Coinbase
()
return
common
.
ToHex
(
cb
)
}
...
...
@@ -517,7 +517,7 @@ func (self *XEth) FromNumber(str string) string {
func
(
self
*
XEth
)
PushTx
(
encodedTx
string
)
(
string
,
error
)
{
tx
:=
types
.
NewTransactionFromBytes
(
common
.
FromHex
(
encodedTx
))
err
:=
self
.
eth
.
TxPool
()
.
Add
(
tx
)
err
:=
self
.
backend
.
TxPool
()
.
Add
(
tx
)
if
err
!=
nil
{
return
""
,
err
}
...
...
@@ -616,7 +616,7 @@ func (self *XEth) Transact(fromStr, toStr, valueStr, gasStr, gasPriceStr, codeSt
if
err
:=
self
.
sign
(
tx
,
from
,
false
);
err
!=
nil
{
return
""
,
err
}
if
err
:=
self
.
eth
.
TxPool
()
.
Add
(
tx
);
err
!=
nil
{
if
err
:=
self
.
backend
.
TxPool
()
.
Add
(
tx
);
err
!=
nil
{
return
""
,
err
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment