test

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2021 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockBCClient

func NewMockBCClient(t *testing.T) bcclientgo.BCClient

Types

type MockBCClient

type MockBCClient struct {
	MockRoot                                    string
	MockPeers                                   []string
	MockCache                                   bcgo.Cache
	MockNetwork                                 bcgo.Network
	MockNode                                    bcgo.Node
	MockListener                                bcgo.MiningListener
	MockAlias                                   string
	MockPeer                                    string
	MockSignedIn                                bool
	MockPublicKeyBytes                          []byte
	MockPublicKeyFormat                         cryptogo.PublicKeyFormat
	MockChannel                                 string
	MockHeadHash, MockBlockHash, MockRecordHash []byte
	MockBlockCallback                           func([]byte, *bcgo.Block) error
	MockBlockCallbackResults                    []*MockBlockCallbackResult
	MockBlock                                   *bcgo.Block
	MockRecord                                  *bcgo.Record
	MockWriter                                  io.Writer
	MockAccesses                                []string
	MockReader                                  io.Reader
	MockWriteCount                              int
	MockThreshold                               uint64
	MockPassword                                []byte
	MockAccessCode                              string

	MockRootError, MockCacheError, MockNetworkError, MockNodeError, MockInitError, MockPublicKeyError                                      error
	MockHeadError, MockChainError, MockBlockError, MockRecordError, MockPushError, MockPullError                                           error
	MockPurgeError, MockImportError, MockExportError, MockReadError, MockReadKeyError, MockReadPayloadError, MockWriteError, MockMineError error
}

func (*MockBCClient) Block

func (c *MockBCClient) Block(channel string, hash []byte) (*bcgo.Block, error)

func (*MockBCClient) Cache

func (c *MockBCClient) Cache() (bcgo.Cache, error)

func (*MockBCClient) Chain

func (c *MockBCClient) Chain(channel string, callback func([]byte, *bcgo.Block) error) error

func (*MockBCClient) ExportKeys

func (c *MockBCClient) ExportKeys(peer, alias string, password []byte) (string, error)

func (*MockBCClient) Head

func (c *MockBCClient) Head(channel string) ([]byte, error)

func (*MockBCClient) ImportKeys

func (c *MockBCClient) ImportKeys(peer, alias, accessCode string) error

func (*MockBCClient) Init

func (c *MockBCClient) Init(listener bcgo.MiningListener) (bcgo.Node, error)

func (*MockBCClient) IsSignedIn

func (c *MockBCClient) IsSignedIn() bool

func (*MockBCClient) Mine

func (c *MockBCClient) Mine(channel string, threshold uint64, listener bcgo.MiningListener) ([]byte, error)

func (*MockBCClient) Network

func (c *MockBCClient) Network() (bcgo.Network, error)

func (*MockBCClient) Node

func (c *MockBCClient) Node() (bcgo.Node, error)

func (*MockBCClient) Peers

func (c *MockBCClient) Peers() []string

func (*MockBCClient) PublicKey

func (c *MockBCClient) PublicKey(alias string) ([]byte, cryptogo.PublicKeyFormat, error)

func (*MockBCClient) Pull

func (c *MockBCClient) Pull(channel string) error

func (*MockBCClient) Purge

func (c *MockBCClient) Purge() error

func (*MockBCClient) Push

func (c *MockBCClient) Push(channel string) error

func (*MockBCClient) Read

func (c *MockBCClient) Read(channel string, blockHash []byte, recordHash []byte, output io.Writer) error

func (*MockBCClient) ReadKey

func (c *MockBCClient) ReadKey(channel string, blockHash []byte, recordHash []byte, output io.Writer) error

func (*MockBCClient) ReadPayload

func (c *MockBCClient) ReadPayload(channel string, blockHash []byte, recordHash []byte, output io.Writer) error

func (*MockBCClient) Record

func (c *MockBCClient) Record(channel string, hash []byte) (*bcgo.Record, error)

func (*MockBCClient) Root

func (c *MockBCClient) Root() (string, error)

func (*MockBCClient) SetCache

func (c *MockBCClient) SetCache(cache bcgo.Cache)

func (*MockBCClient) SetNetwork

func (c *MockBCClient) SetNetwork(network bcgo.Network)

func (*MockBCClient) SetNode

func (c *MockBCClient) SetNode(node bcgo.Node)

func (*MockBCClient) SetPeers

func (c *MockBCClient) SetPeers(peers ...string)

func (*MockBCClient) SetRoot

func (c *MockBCClient) SetRoot(root string)

func (*MockBCClient) Write

func (c *MockBCClient) Write(channel string, accesses []string, input io.Reader) (int, error)

type MockBlockCallbackResult

type MockBlockCallbackResult struct {
	Hash  []byte
	Block *bcgo.Block
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL