github.com/ethereumproject/go-ethereum@v5.5.2+incompatible/core/helper_test.go (about)

     1  // Copyright 2014 The go-ethereum Authors
     2  // This file is part of the go-ethereum library.
     3  //
     4  // The go-ethereum library is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Lesser General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // The go-ethereum library is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    12  // GNU Lesser General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Lesser General Public License
    15  // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
    16  
    17  package core
    18  
    19  import (
    20  	"container/list"
    21  
    22  	"github.com/ethereumproject/go-ethereum/core/types"
    23  	"github.com/ethereumproject/go-ethereum/ethdb"
    24  	"github.com/ethereumproject/go-ethereum/event"
    25  )
    26  
    27  // Implement our EthTest Manager
    28  type TestManager struct {
    29  	// stateManager *StateManager
    30  	eventMux *event.TypeMux
    31  
    32  	db         ethdb.Database
    33  	txPool     *TxPool
    34  	blockChain *BlockChain
    35  	Blocks     []*types.Block
    36  }
    37  
    38  func (s *TestManager) IsListening() bool {
    39  	return false
    40  }
    41  
    42  func (s *TestManager) IsMining() bool {
    43  	return false
    44  }
    45  
    46  func (s *TestManager) PeerCount() int {
    47  	return 0
    48  }
    49  
    50  func (s *TestManager) Peers() *list.List {
    51  	return list.New()
    52  }
    53  
    54  func (s *TestManager) BlockChain() *BlockChain {
    55  	return s.blockChain
    56  }
    57  
    58  func (tm *TestManager) TxPool() *TxPool {
    59  	return tm.txPool
    60  }
    61  
    62  // func (tm *TestManager) StateManager() *StateManager {
    63  // 	return tm.stateManager
    64  // }
    65  
    66  func (tm *TestManager) EventMux() *event.TypeMux {
    67  	return tm.eventMux
    68  }
    69  
    70  // func (tm *TestManager) KeyManager() *crypto.KeyManager {
    71  // 	return nil
    72  // }
    73  
    74  func (tm *TestManager) Db() ethdb.Database {
    75  	return tm.db
    76  }