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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
20cdb738
Commit
20cdb738
authored
10 years ago
by
Felix Lange
Browse files
Options
Downloads
Patches
Plain Diff
ethchain: fix tests
parent
36cdab20
No related branches found
No related tags found
Loading
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ethchain/filter_test.go
+1
-1
1 addition, 1 deletion
ethchain/filter_test.go
ethchain/helper_test.go
+11
-7
11 additions, 7 deletions
ethchain/helper_test.go
ethereum.go
+2
-3
2 additions, 3 deletions
ethereum.go
with
14 additions
and
11 deletions
ethchain/filter_test.go
+
1
−
1
View file @
20cdb738
...
...
@@ -3,5 +3,5 @@ package ethchain
import
"testing"
func
TestFilter
(
t
*
testing
.
T
)
{
f
ilter
:=
NewFilt
er
()
NewF
ilter
(
NewTestManag
er
()
)
}
This diff is collapsed.
Click to expand it.
ethchain/helper_test.go
+
11
−
7
View file @
20cdb738
...
...
@@ -6,16 +6,17 @@ import (
"github.com/ethereum/eth-go/ethcrypto"
"github.com/ethereum/eth-go/ethdb"
"github.com/ethereum/eth-go/ethreact"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethwire"
"github.com/ethereum/eth-go/event"
)
// Implement our EthTest Manager
type
TestManager
struct
{
stateManager
*
StateManager
reactor
*
ethreact
.
ReactorEngine
eventMux
*
event
.
TypeMux
db
ethutil
.
Database
txPool
*
TxPool
blockChain
*
BlockChain
Blocks
[]
*
Block
...
...
@@ -49,8 +50,8 @@ func (tm *TestManager) StateManager() *StateManager {
return
tm
.
stateManager
}
func
(
tm
*
TestManager
)
Reactor
()
*
ethreact
.
ReactorEngine
{
return
tm
.
reactor
func
(
tm
*
TestManager
)
EventMux
()
*
event
.
TypeMux
{
return
tm
.
eventMux
}
func
(
tm
*
TestManager
)
Broadcast
(
msgType
ethwire
.
MsgType
,
data
[]
interface
{})
{
fmt
.
Println
(
"Broadcast not implemented"
)
...
...
@@ -63,7 +64,10 @@ func (tm *TestManager) KeyManager() *ethcrypto.KeyManager {
return
nil
}
func
(
tm
*
TestManager
)
Db
()
ethutil
.
Database
{
return
nil
}
func
(
tm
*
TestManager
)
Db
()
ethutil
.
Database
{
return
tm
.
db
}
func
NewTestManager
()
*
TestManager
{
ethutil
.
ReadConfig
(
".ethtest"
,
"/tmp/ethtest"
,
"ETH"
)
...
...
@@ -75,8 +79,8 @@ func NewTestManager() *TestManager {
ethutil
.
Config
.
Db
=
db
testManager
:=
&
TestManager
{}
testManager
.
reactor
=
ethreact
.
New
(
)
testManager
.
eventMux
=
new
(
event
.
TypeMux
)
testManager
.
db
=
db
testManager
.
txPool
=
NewTxPool
(
testManager
)
testManager
.
blockChain
=
NewBlockChain
(
testManager
)
testManager
.
stateManager
=
NewStateManager
(
testManager
)
...
...
This diff is collapsed.
Click to expand it.
ethereum.go
+
2
−
3
View file @
20cdb738
...
...
@@ -59,7 +59,7 @@ type Ethereum struct {
// The block pool
blockPool
*
BlockPool
// Eventer
eventMux
*
event
.
TypeMux
eventMux
event
.
TypeMux
// Peers
peers
*
list
.
List
// Nonce
...
...
@@ -126,7 +126,6 @@ func New(db ethutil.Database, clientIdentity ethwire.ClientIdentity, keyManager
isUpToDate
:
true
,
filters
:
make
(
map
[
int
]
*
ethchain
.
Filter
),
}
ethereum
.
eventMux
=
event
.
NewTypeMux
()
ethereum
.
blockPool
=
NewBlockPool
(
ethereum
)
ethereum
.
txPool
=
ethchain
.
NewTxPool
(
ethereum
)
...
...
@@ -162,7 +161,7 @@ func (s *Ethereum) BlockPool() *BlockPool {
return
s
.
blockPool
}
func
(
s
*
Ethereum
)
EventMux
()
*
event
.
TypeMux
{
return
s
.
eventMux
return
&
s
.
eventMux
}
func
(
self
*
Ethereum
)
Db
()
ethutil
.
Database
{
return
self
.
db
...
...
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