mocks

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultMockSuccessTxResponse

func DefaultMockSuccessTxResponse() sdk.TxResponse

DefaultMockSuccessTxResponse returns the default mock success tx response for transaction testing

Types

type MockClient

type MockClient struct {
	*sdk.MockBaseClient
	// contains filtered or unexported fields
}

MockClient - structure of the mock client for gosdk testing

func NewMockClient

func NewMockClient(t *testing.T, ctrl *gomock.Controller, config sdk.ClientConfig) MockClient

NewMockClient creates a new instance of MockClient

func (*MockClient) Auth

func (mc *MockClient) Auth() exposed.Auth

nolint

func (*MockClient) Backend

func (mc *MockClient) Backend() exposed.Backend

func (*MockClient) BuildAccountBytes

func (mc *MockClient) BuildAccountBytes(accAddrStr, accPubkeyStr, coinsStr string, accNum, seqNum uint64) []byte

BuildAccountBytes generates the account bytes for test

func (*MockClient) BuildAccountTokensInfoBytes

func (mc *MockClient) BuildAccountTokensInfoBytes(addrStr, symbol, available, freeze, locked string) []byte

BuildAccountTokensInfoBytes generates the account tokens info bytes for test

func (*MockClient) BuildBackendCandlesBytes

func (mc *MockClient) BuildBackendCandlesBytes(candles [][]string) []byte

BuildBackendCandlesBytes generates the backend candles bytes for test

func (*MockClient) BuildBackendDealsResultBytes

func (mc *MockClient) BuildBackendDealsResultBytes(timestamp, height int64, orderID, sender, product, side, fee string, price, quantity float64) []byte

BuildBackendDealsResultBytes generates the backend deals result bytes for test

func (*MockClient) BuildBackendMatchResultBytes

func (mc *MockClient) BuildBackendMatchResultBytes(timestamp, height int64, product string, price, quantity float64) []byte

BuildBackendMatchResultBytes generates the backend match result bytes for test

func (*MockClient) BuildBackendOrdersResultBytes

func (mc *MockClient) BuildBackendOrdersResultBytes(txHash, orderID, sender, product, side, price, quantity, filledAvgPrice,
	remainQuantity string, status, timestamp int64) []byte

BuildBackendOrdersResultBytes generates the backend orders result bytes for test

func (*MockClient) BuildBackendTickersBytes

func (mc *MockClient) BuildBackendTickersBytes(symbol, product, timestamp, open, close, high, low, price, volumn,
	change string) []byte

BuildBackendTickersBytes generates the backend tickers bytes for test

func (*MockClient) BuildBackendTransactionsResultBytes

func (mc *MockClient) BuildBackendTransactionsResultBytes(txHash, accAddr, symbol, quantity, fee string, txType, side,
	timestamp int64) []byte

BuildBackendMatchResultBytes generates the backend transactions result bytes for test

func (*MockClient) BuildBookResBytes

func (mc *MockClient) BuildBookResBytes(askPrice, askQuantity, bidPrice, bidQuantity string) []byte

BuildBookResBytes generates the book result bytes for test

func (*MockClient) BuildDelegatorBytes

func (mc *MockClient) BuildDelegatorBytes(delAddr, proxyAddr sdk.AccAddress, valAddrs []sdk.ValAddress, shares, tokens,
	totalDelegatedTokens sdk.Dec, isProxy bool) []byte

BuildDelegatorBytes generates the delegator bytes for test

func (*MockClient) BuildOrderDetailBytes

func (mc *MockClient) BuildOrderDetailBytes(txHash, orderID, extraInfo, product, side string, status, timestamp,
	orderExpireBlocks int64, sender sdk.AccAddress, price, quantity, filledAvgPrice, remainQuantity, remainLocked sdk.Dec,
	feePerBlock sdk.DecCoin) []byte

BuildOrderDetailBytes generates the order detail bytes for test

func (*MockClient) BuildProposalsBytes added in v0.11.0

func (mc *MockClient) BuildProposalsBytes(proposalID uint64, status governance.ProposalStatus,
	mockTime time.Time, totalDeposit sdk.DecCoins, mockPower sdk.Dec) []byte

BuildProposalsBytes generates the proposals bytes for test

func (*MockClient) BuildTokenInfoBytes

func (mc *MockClient) BuildTokenInfoBytes(description, symbol, originalSymbol, wholeName string, originalTotalSupply,
	totalSupply sdk.Dec, owner sdk.AccAddress, mintable, isSlice bool) []byte

BuildTokenInfoBytes generates the token info bytes for test

func (*MockClient) BuildTokenPairsBytes

func (mc *MockClient) BuildTokenPairsBytes(baseAssetSymbol1, baseAssetSymbol2, quoteAssetSymbol string, initPrice,
	minQuantity sdk.Dec, maxPriceDigit, maxQuantityDigit, blockHeight1, blockHeight2 int64, ID1, ID2 uint64, delisting bool,
	owner sdk.AccAddress, deposits sdk.DecCoin) []byte

BuildTokenPairsBytes generates the token pairs bytes for test

func (*MockClient) BuildUndelegationBytes

func (mc *MockClient) BuildUndelegationBytes(delAddr sdk.AccAddress, quantity sdk.Dec, completionTime time.Time) []byte

BuildUndelegationBytes generates the undelegation bytes for test

func (*MockClient) BuildValidatorBytes

func (mc *MockClient) BuildValidatorBytes(valAddr sdk.ValAddress, consPubKey, moniker, identity, website, details string,
	status byte, delegatorShares, minSelfDelegation sdk.Dec, unbondingHeight int64, unbondingCompletionTime time.Time,
	jailed bool) []byte

BuildValidatorsBytes generates the validator bytes for test

func (*MockClient) Dex

func (mc *MockClient) Dex() exposed.Dex

func (*MockClient) Distribution

func (mc *MockClient) Distribution() exposed.Distribution

func (*MockClient) GetCodec

func (mc *MockClient) GetCodec() sdk.SDKCodec

GetCodec returns the client codec

func (*MockClient) GetConfig

func (mc *MockClient) GetConfig() sdk.ClientConfig

GetConfig returns the client config

func (*MockClient) GetRawCommitResultPointer

func (mc *MockClient) GetRawCommitResultPointer(canonicalCommit bool, chainID string, height int64, time time.Time, appHash,
	blockIDHash cmn.HexBytes) *ctypes.ResultCommit

GetRawCommitResultPointer generates the raw tendermint commit result pointer for test

func (*MockClient) GetRawResultBlockPointer

func (mc *MockClient) GetRawResultBlockPointer(chainID string, height int64, time time.Time, appHash,
	blockIDHash cmn.HexBytes) *ctypes.ResultBlock

GetRawResultBlockPointer generates the raw tendermint block result pointer for test

func (*MockClient) GetRawResultBlockResultsPointer

func (mc *MockClient) GetRawResultBlockResultsPointer(power, height int64, pkType, eventType string,
	kvPairKey []byte) *ctypes.ResultBlockResults

GetRawResultBlockResultsPointer generates the raw tendermint result block results pointer for test

func (*MockClient) GetRawResultTxSearchPointer

func (mc *MockClient) GetRawResultTxSearchPointer(totalCount int, hash cmn.HexBytes, height int64, code uint32, log,
	eventType string, tx []byte) *ctypes.ResultTxSearch

GetRawTxResultPointer generates the raw tendermint tx search result pointer for test

func (*MockClient) GetRawTxResultPointer

func (mc *MockClient) GetRawTxResultPointer(hash cmn.HexBytes, height int64, code uint32, log, eventType string,
	tx []byte) *ctypes.ResultTx

GetRawTxResultPointer generates the raw tendermint tx result pointer for test

func (*MockClient) GetRawValidatorsResultPointer

func (mc *MockClient) GetRawValidatorsResultPointer(height, votingPower, proposerPriority int64,
	consPubkey crypto.PubKey) *ctypes.ResultValidators

GetRawValidatorsResultPointer generates the raw tendermint validators result pointer for test

func (*MockClient) Governance added in v0.11.0

func (mc *MockClient) Governance() exposed.Governance

func (*MockClient) Order

func (mc *MockClient) Order() exposed.Order

func (*MockClient) RegisterModule

func (mc *MockClient) RegisterModule(mods ...sdk.Module)

RegisterModule registers the specific module for MockClient

func (*MockClient) Slashing

func (mc *MockClient) Slashing() exposed.Slashing

func (*MockClient) Staking

func (mc *MockClient) Staking() exposed.Staking

func (*MockClient) Tendermint

func (mc *MockClient) Tendermint() exposed.Tendermint

func (*MockClient) Token

func (mc *MockClient) Token() exposed.Token

Jump to

Keyboard shortcuts

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