Newer
Older
ep "github.com/eris-ltd/eris-db/erisdb/pipe"
td "github.com/eris-ltd/eris-db/test/testdata/testdata"
"github.com/eris-ltd/eris-db/account"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
"github.com/tendermint/tendermint/types"
accounts ep.Accounts
blockchain ep.Blockchain
consensus ep.Consensus
func NewMockPipe(td *td.TestData) ep.Pipe {
accounts := &accounts{td}
blockchain := &blockchain{td}
consensus := &consensus{td}
events := &events{td}
}
}
// Create a mock pipe with default mock data.
func NewDefaultMockPipe() ep.Pipe {
}
func (this *MockPipe) Accounts() ep.Accounts {
return this.accounts
}
func (this *MockPipe) Blockchain() ep.Blockchain {
return this.blockchain
}
func (this *MockPipe) Consensus() ep.Consensus {
return this.consensus
}
func (this *MockPipe) NameReg() ep.NameReg {
return this.namereg
}
func (this *MockPipe) Transactor() ep.Transactor {
return this.transactor
}
func (this *accounts) GenPrivAccount() (*account.PrivAccount, error) {
}
func (this *accounts) GenPrivAccountFromKey(key []byte) (*account.PrivAccount, error) {
}
func (this *accounts) Accounts([]*ep.FilterData) (*ep.AccountList, error) {
}
func (this *accounts) Account(address []byte) (*account.Account, error) {
}
func (this *accounts) Storage(address []byte) (*ep.Storage, error) {
}
func (this *accounts) StorageAt(address, key []byte) (*ep.StorageItem, error) {
}
func (this *blockchain) Info() (*ep.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() (*types.Block, error) {
}
func (this *blockchain) Blocks([]*ep.FilterData) (*ep.Blocks, error) {
func (this *blockchain) Block(height int) (*types.Block, error) {
}
func (this *consensus) State() (*ep.ConsensusState, error) {
}
func (this *consensus) Validators() (*ep.ValidatorList, error) {
func (this *events) Subscribe(subId, event string, callback func(types.EventData)) (bool, error) {
return true, nil
}
func (this *events) Unsubscribe(subId string) (bool, error) {
// NameReg
type namereg struct {
testData *td.TestData
}
func (this *namereg) Entry(key string) (*types.NameRegEntry, error) {
return this.testData.GetNameRegEntry.Output, nil
}
func (this *namereg) Entries(filters []*ep.FilterData) (*ctypes.ResultListNames, error) {
return this.testData.GetNameRegEntries.Output, nil
}
return this.testData.GetClientVersion.Output.ClientVersion, nil
}
func (this *net) Peer(address string) (*ep.Peer, error) {
func (this *transactor) Call(fromAddress, toAddress, data []byte) (*ep.Call, error) {
func (this *transactor) CallCode(from, code, data []byte) (*ep.Call, error) {
func (this *transactor) BroadcastTx(tx types.Tx) (*ep.Receipt, error) {
func (this *transactor) UnconfirmedTxs() (*ep.UnconfirmedTxs, error) {
func (this *transactor) Transact(privKey, address, data []byte, gasLimit, fee int64) (*ep.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) TransactNameReg(privKey []byte, name, data string, amount, fee int64) (*ep.Receipt, error) {
return this.testData.TransactNameReg.Output, nil
}
func (this *transactor) SignTx(tx types.Tx, privAccounts []*account.PrivAccount) (types.Tx, error) {