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
6d41402d
Commit
6d41402d
authored
Mar 24, 2015
by
Taylor Gerring
Browse files
Options
Downloads
Patches
Plain Diff
Backend no longer needed to resolve import cycle
parent
9de1ad65
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
xeth/xeth.go
+4
-30
4 additions, 30 deletions
xeth/xeth.go
with
4 additions
and
30 deletions
xeth/xeth.go
+
4
−
30
View file @
6d41402d
...
...
@@ -15,12 +15,10 @@ import (
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/e
ven
t"
"github.com/ethereum/go-ethereum/et
h
"
"github.com/ethereum/go-ethereum/event/filter"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/miner"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/whisper"
)
var
(
...
...
@@ -30,30 +28,6 @@ var (
defaultGas
=
big
.
NewInt
(
90000
)
//500000
)
// to resolve the import cycle
type
Backend
interface
{
BlockProcessor
()
*
core
.
BlockProcessor
ChainManager
()
*
core
.
ChainManager
AccountManager
()
*
accounts
.
Manager
TxPool
()
*
core
.
TxPool
PeerCount
()
int
IsListening
()
bool
Peers
()
[]
*
p2p
.
Peer
BlockDb
()
common
.
Database
StateDb
()
common
.
Database
ExtraDb
()
common
.
Database
EventMux
()
*
event
.
TypeMux
Whisper
()
*
whisper
.
Whisper
Miner
()
*
miner
.
Miner
IsMining
()
bool
StartMining
()
error
StopMining
()
Version
()
string
ProtocolVersion
()
int
NetworkId
()
int
}
// Frontend should be implemented by users of XEth. Its methods are
// called whenever XEth makes a decision that requires user input.
type
Frontend
interface
{
...
...
@@ -82,7 +56,7 @@ func (dummyFrontend) UnlockAccount([]byte) bool { return false
func
(
dummyFrontend
)
ConfirmTransaction
(
*
types
.
Transaction
)
bool
{
return
true
}
type
XEth
struct
{
eth
Backend
eth
*
eth
.
Ethereum
blockProcessor
*
core
.
BlockProcessor
chainManager
*
core
.
ChainManager
accountManager
*
accounts
.
Manager
...
...
@@ -110,7 +84,7 @@ type XEth struct {
// New creates an XEth that uses the given frontend.
// If a nil Frontend is provided, a default frontend which
// confirms all transactions will be used.
func
New
(
eth
Backend
,
frontend
Frontend
)
*
XEth
{
func
New
(
eth
*
eth
.
Ethereum
,
frontend
Frontend
)
*
XEth
{
xeth
:=
&
XEth
{
eth
:
eth
,
blockProcessor
:
eth
.
BlockProcessor
(),
...
...
@@ -195,7 +169,7 @@ func (self *XEth) AtStateNum(num int64) *XEth {
return
self
.
WithState
(
st
)
}
func
(
self
*
XEth
)
Backend
()
Backend
{
return
self
.
eth
}
func
(
self
*
XEth
)
Backend
()
*
eth
.
Ethereum
{
return
self
.
eth
}
func
(
self
*
XEth
)
WithState
(
statedb
*
state
.
StateDB
)
*
XEth
{
xeth
:=
&
XEth
{
eth
:
self
.
eth
,
...
...
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