Fixed tests

pull/244/head
obscuren 10 years ago
parent 3b8725e0f5
commit 564f02aa2b
  1. 4
      core/chain_manager_test.go
  2. 6
      core/transaction_pool_test.go
  3. 4
      xeth/js_types.go

@ -71,7 +71,7 @@ func TestChainInsertions(t *testing.T) {
var eventMux event.TypeMux var eventMux event.TypeMux
chainMan := NewChainManager(&eventMux) chainMan := NewChainManager(&eventMux)
txPool := NewTxPool(&eventMux) txPool := NewTxPool(&eventMux)
blockMan := NewBlockManager(txPool, chainMan, &eventMux) blockMan := NewBlockProcessor(txPool, chainMan, &eventMux)
chainMan.SetProcessor(blockMan) chainMan.SetProcessor(blockMan)
const max = 2 const max = 2
@ -115,7 +115,7 @@ func TestChainMultipleInsertions(t *testing.T) {
var eventMux event.TypeMux var eventMux event.TypeMux
chainMan := NewChainManager(&eventMux) chainMan := NewChainManager(&eventMux)
txPool := NewTxPool(&eventMux) txPool := NewTxPool(&eventMux)
blockMan := NewBlockManager(txPool, chainMan, &eventMux) blockMan := NewBlockProcessor(txPool, chainMan, &eventMux)
chainMan.SetProcessor(blockMan) chainMan.SetProcessor(blockMan)
done := make(chan bool, max) done := make(chan bool, max)
for i, chain := range chains { for i, chain := range chains {

@ -55,7 +55,7 @@ func TestAddInvalidTx(t *testing.T) {
func TestRemoveSet(t *testing.T) { func TestRemoveSet(t *testing.T) {
pool, _ := setup() pool, _ := setup()
tx1 := transaction() tx1 := transaction()
pool.pool.Add(tx1) pool.addTx(tx1)
pool.RemoveSet(types.Transactions{tx1}) pool.RemoveSet(types.Transactions{tx1})
if pool.Size() > 0 { if pool.Size() > 0 {
t.Error("expected pool size to be 0") t.Error("expected pool size to be 0")
@ -65,7 +65,7 @@ func TestRemoveSet(t *testing.T) {
func TestRemoveInvalid(t *testing.T) { func TestRemoveInvalid(t *testing.T) {
pool, key := setup() pool, key := setup()
tx1 := transaction() tx1 := transaction()
pool.pool.Add(tx1) pool.addTx(tx1)
pool.RemoveInvalid(stateQuery{}) pool.RemoveInvalid(stateQuery{})
if pool.Size() > 0 { if pool.Size() > 0 {
t.Error("expected pool size to be 0") t.Error("expected pool size to be 0")
@ -73,7 +73,7 @@ func TestRemoveInvalid(t *testing.T) {
tx1.SetNonce(1) tx1.SetNonce(1)
tx1.SignECDSA(key) tx1.SignECDSA(key)
pool.pool.Add(tx1) pool.addTx(tx1)
pool.RemoveInvalid(stateQuery{}) pool.RemoveInvalid(stateQuery{})
if pool.Size() != 1 { if pool.Size() != 1 {
t.Error("expected pool size to be 1, is", pool.Size()) t.Error("expected pool size to be 1, is", pool.Size())

@ -169,8 +169,8 @@ func NewJSPeer(peer *p2p.Peer) *JSPeer {
return &JSPeer{ return &JSPeer{
ref: peer, ref: peer,
Ip: peer.RemoteAddr().String(), Ip: fmt.Sprintf("%v", peer.RemoteAddr()),
Version: peer.Identity().String(), Version: fmt.Sprintf("%v", peer.Identity()),
Caps: fmt.Sprintf("%v", caps), Caps: fmt.Sprintf("%v", caps),
} }
} }

Loading…
Cancel
Save