Documentation ¶
Overview ¶
Package testqueryclients provides helper functions for contstructing mock AccountQueryClient objects parameterized call arguments, return value(s), and/or expectations thereof. Intended for use in tests.
Index ¶
- func AddAddressToApplicationMap(t *testing.T, address string, pubkey cryptotypes.PubKey, ...)
- func AddSuppliersWithServiceEndpoints(t *testing.T, supplierOperatorAddress, service string, ...)
- func AddToExistingServices(t *testing.T, service sharedtypes.Service)
- func AddToExistingSessions(t *testing.T, appAddress string, serviceId string, blockHeight int64, ...)
- func NewTestAccountQueryClient(t *testing.T) *mockclient.MockAccountQueryClient
- func NewTestApplicationQueryClient(t *testing.T) *mockclient.MockApplicationQueryClient
- func NewTestBankQueryClientWithBalance(t *testing.T, balance int64) *mockclient.MockBankQueryClient
- func NewTestProofQueryClient(t *testing.T) *mockclient.MockProofQueryClient
- func NewTestProofQueryClientWithParams(t *testing.T, params client.ProofParams) *mockclient.MockProofQueryClient
- func NewTestServiceQueryClient(t *testing.T) *mockclient.MockServiceQueryClient
- func NewTestSessionQueryClient(t *testing.T) *mockclient.MockSessionQueryClient
- func NewTestSharedQueryClient(t *testing.T) *mockclient.MockSharedQueryClient
- func NewTestSupplierQueryClient(t *testing.T) *mockclient.MockSupplierQueryClient
- func RemoveAddressFromApplicationMap(t *testing.T, address string)
- func SetServiceRelayDifficultyTargetHash(t *testing.T, serviceId string, relayDifficultyTargetHash []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAddressToApplicationMap ¶
func AddAddressToApplicationMap( t *testing.T, address string, pubkey cryptotypes.PubKey, delegateeAccounts map[string]cryptotypes.PubKey, )
AddAddressToApplicationMap adds the given address to the addressApplicationMap with the given delegated gateways addresses. It also adds it to the addressAccountMap so that the account will be deemed to exist on chain.
func AddSuppliersWithServiceEndpoints ¶
func AddSuppliersWithServiceEndpoints( t *testing.T, supplierOperatorAddress, service string, endpoints []*sharedtypes.SupplierEndpoint, )
AddSupplierWithServiceEndpoints adds the given address and ServiceEndpoints to the suppliersProvidedServicesMap to mock it "existing" on chain, it will also remove the address from the map when the test is cleaned up.
func AddToExistingServices ¶ added in v0.0.8
func AddToExistingServices( t *testing.T, service sharedtypes.Service, )
AddToExistingServices adds the given service to the services map to mock it "existing" on chain, it will also remove the services from the map when the test is cleaned up.
func AddToExistingSessions ¶
func AddToExistingSessions( t *testing.T, appAddress string, serviceId string, blockHeight int64, supplierOperatorAddresses []string, )
AddToExistingSessions adds the given session to the sessionsMap to mock it "existing" on chain, it will also remove the sessions from the map when the test is cleaned up.
func NewTestAccountQueryClient ¶
func NewTestAccountQueryClient( t *testing.T, ) *mockclient.MockAccountQueryClient
NewTestAccountQueryClient creates a mock of the AccountQueryClient which allows the caller to call GetApplication any times and will return an application with the given address.
func NewTestApplicationQueryClient ¶
func NewTestApplicationQueryClient( t *testing.T, ) *mockclient.MockApplicationQueryClient
NewTestApplicationQueryClient creates a mock of the ApplicationQueryClient which allows the caller to call GetApplication any times and will return an application with the given address.
func NewTestBankQueryClientWithBalance ¶ added in v0.0.10
func NewTestBankQueryClientWithBalance(t *testing.T, balance int64) *mockclient.MockBankQueryClient
NewTestBankQueryClientWithWithBalance creates a mock of the BankQueryClient that uses the provided balance for its GetBalance() method implementation.
func NewTestProofQueryClient ¶ added in v0.0.3
func NewTestProofQueryClient(t *testing.T) *mockclient.MockProofQueryClient
NewTestProofQueryClient creates a mock of the ProofQueryClient which uses the default proof module params for its GetParams() method implementation.
func NewTestProofQueryClientWithParams ¶ added in v0.0.8
func NewTestProofQueryClientWithParams(t *testing.T, params client.ProofParams) *mockclient.MockProofQueryClient
NewTestProofQueryClientWithParams creates a mock of the ProofQueryClient that uses the provided proof module params for its GetParams() method implementation.
func NewTestServiceQueryClient ¶ added in v0.0.8
func NewTestServiceQueryClient( t *testing.T, ) *mockclient.MockServiceQueryClient
NewTestSessionQueryClient creates a mock of the SessionQueryClient which allows the caller to call GetSession any times and will return the session matching the app address, serviceID and the blockHeight passed.
func NewTestSessionQueryClient ¶
func NewTestSessionQueryClient( t *testing.T, ) *mockclient.MockSessionQueryClient
NewTestSessionQueryClient creates a mock of the SessionQueryClient which allows the caller to call GetSession any times and will return the session matching the app address, serviceID and the blockHeight passed.
func NewTestSharedQueryClient ¶ added in v0.0.3
func NewTestSharedQueryClient( t *testing.T, ) *mockclient.MockSharedQueryClient
NewTestSharedQueryClient creates a mock of the SharedQueryClient which uses the default shared module params for its implementation.
func NewTestSupplierQueryClient ¶
func NewTestSupplierQueryClient( t *testing.T, ) *mockclient.MockSupplierQueryClient
NewTestSupplierQueryClient creates a mock of the SupplierQueryClient which allows the caller to call GetSupplier any times and will return an application with the given address.
func RemoveAddressFromApplicationMap ¶
RemoveAddressFromApplicationMap removes the given address from the addressApplicationMap.
func SetServiceRelayDifficultyTargetHash ¶ added in v0.0.8
func SetServiceRelayDifficultyTargetHash(t *testing.T, serviceId string, relayDifficultyTargetHash []byte, )
AddServiceRelayDifficultyTargetHash sets the relay difficulty target hash for the given service to mock it "existing" on chain. It will also remove the service relay difficulty target hashes from the map when the test is cleaned up.
Types ¶
This section is empty.