Newer
Older
account "github.com/eris-ltd/eris-db/account"
core_types "github.com/eris-ltd/eris-db/core/types"
definitions "github.com/eris-ltd/eris-db/definitions"
event "github.com/eris-ltd/eris-db/event"
manager_types "github.com/eris-ltd/eris-db/manager/types"
td "github.com/eris-ltd/eris-db/test/testdata/testdata"
types "github.com/eris-ltd/eris-db/txs"
accounts definitions.Accounts
blockchain definitions.Blockchain
consensus definitions.Consensus
events event.EventEmitter
namereg definitions.NameReg
net definitions.Net
transactor definitions.Transactor
func NewMockPipe(td *td.TestData) definitions.Pipe {
accounts := &accounts{td}
blockchain := &blockchain{td}
consensus := &consensus{td}
func NewDefaultMockPipe() definitions.Pipe {
func (this *MockPipe) Accounts() definitions.Accounts {
func (this *MockPipe) Blockchain() definitions.Blockchain {
func (this *MockPipe) Consensus() definitions.Consensus {
func (this *MockPipe) Events() event.EventEmitter {
func (this *MockPipe) NameReg() definitions.NameReg {
func (this *MockPipe) Transactor() definitions.Transactor {
func (this *MockPipe) GetApplication() manager_types.Application {
// TODO: [ben] mock application
return nil
}
func (this *MockPipe) SetConsensusEngine(_ definitions.ConsensusEngine) error {
// TODO: [ben] mock consensus engine
return nil
}
func (this *MockPipe) GetConsensusEngine() definitions.ConsensusEngine {
return nil
}
func (this *MockPipe) GetTendermintPipe() (definitions.TendermintPipe, error) {
return nil, fmt.Errorf("Tendermint pipe is not supported by mocked pipe.")
}
}
func (this *accounts) GenPrivAccount() (*account.PrivAccount, error) {
}
func (this *accounts) GenPrivAccountFromKey(key []byte) (*account.PrivAccount, error) {
func (this *accounts) Accounts([]*event.FilterData) (*core_types.AccountList, error) {
}
func (this *accounts) Account(address []byte) (*account.Account, error) {
func (this *accounts) Storage(address []byte) (*core_types.Storage, error) {
func (this *accounts) StorageAt(address, key []byte) (*core_types.StorageItem, error) {
func (this *blockchain) Info() (*core_types.BlockchainInfo, error) {
}
func (this *blockchain) GenesisHash() ([]byte, error) {
func (this *blockchain) LatestBlockHeight() (int, error) {
return this.testData.GetLatestBlockHeight.Output.Height, nil
func (this *blockchain) LatestBlock() (*mintTypes.Block, error) {
func (this *blockchain) Blocks([]*event.FilterData) (*core_types.Blocks, error) {
func (this *blockchain) Block(height int) (*mintTypes.Block, error) {
func (this *consensus) State() (*core_types.ConsensusState, error) {
func (this *consensus) Validators() (*core_types.ValidatorList, error) {
func (this *eventer) Subscribe(subId, event string, callback func(evts.EventData)) error {
return nil
func (this *eventer) Unsubscribe(subId string) error {
return nil
// NameReg
type namereg struct {
testData *td.TestData
}
func (this *namereg) Entry(key string) (*core_types.NameRegEntry, error) {
return this.testData.GetNameRegEntry.Output, nil
}
func (this *namereg) Entries(filters []*event.FilterData) (*core_types.ResultListNames, error) {
return this.testData.GetNameRegEntries.Output, nil
}
func (this *net) Info() (*core_types.NetworkInfo, error) {
return this.testData.GetClientVersion.Output.ClientVersion, nil
func (this *net) Peers() ([]*core_types.Peer, error) {
func (this *net) Peer(address string) (*core_types.Peer, error) {
func (this *transactor) Call(fromAddress, toAddress, data []byte) (*core_types.Call, error) {
func (this *transactor) CallCode(from, code, data []byte) (*core_types.Call, error) {
func (this *transactor) BroadcastTx(tx types.Tx) (*types.Receipt, error) {
func (this *transactor) UnconfirmedTxs() (*types.UnconfirmedTxs, error) {
func (this *transactor) Transact(privKey, address, data []byte, gasLimit, fee int64) (*types.Receipt, error) {
if address == nil || len(address) == 0 {
func (this *transactor) TransactAndHold(privKey, address, data []byte, gasLimit, fee int64) (*types.EventDataCall, error) {
func (this *transactor) Send(privKey, toAddress []byte, amount int64) (*types.Receipt, error) {
func (this *transactor) SendAndHold(privKey, toAddress []byte, amount int64) (*types.Receipt, error) {
func (this *transactor) TransactNameReg(privKey []byte, name, data string, amount, fee int64) (*types.Receipt, error) {
return this.testData.TransactNameReg.Output, nil
}
func (this *transactor) SignTx(tx types.Tx, privAccounts []*account.PrivAccount) (types.Tx, error) {