Newer
Older
Benjamin Bollen
committed
"github.com/eris-ltd/eris-db/account"
core_types "github.com/eris-ltd/eris-db/core/types"
td "github.com/eris-ltd/eris-db/test/testdata/testdata"
accounts core_types.Accounts
blockchain core_types.Blockchain
consensus core_types.Consensus
events core_types.EventEmitter
namereg core_types.NameReg
net core_types.Net
transactor core_types.Transactor
func NewMockPipe(td *td.TestData) core_types.Pipe {
accounts := &accounts{td}
blockchain := &blockchain{td}
consensus := &consensus{td}
func (this *MockPipe) Accounts() core_types.Accounts {
func (this *MockPipe) Blockchain() core_types.Blockchain {
func (this *MockPipe) Consensus() core_types.Consensus {
func (this *MockPipe) Events() core_types.EventEmitter {
func (this *MockPipe) NameReg() core_types.NameReg {
func (this *MockPipe) Transactor() core_types.Transactor {
}
func (this *accounts) GenPrivAccount() (*account.PrivAccount, error) {
}
func (this *accounts) GenPrivAccountFromKey(key []byte) (*account.PrivAccount, error) {
func (this *accounts) Accounts([]*core_types.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([]*core_types.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(events.EventData)) (bool, error) {
func (this *eventer) 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 []*core_types.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) (*core_types.Receipt, error) {
func (this *transactor) UnconfirmedTxs() (*core_types.UnconfirmedTxs, error) {
func (this *transactor) Transact(privKey, address, data []byte, gasLimit, fee int64) (*core_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) (*core_types.Receipt, error) {
func (this *transactor) SendAndHold(privKey, toAddress []byte, amount int64) (*core_types.Receipt, error) {
func (this *transactor) TransactNameReg(privKey []byte, name, data string, amount, fee int64) (*core_types.Receipt, error) {
return this.testData.TransactNameReg.Output, nil
}
func (this *transactor) SignTx(tx types.Tx, privAccounts []*account.PrivAccount) (types.Tx, error) {