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, address, service string, ...)
- 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 NewTestProofQueryClient(t *testing.T) *mockclient.MockProofQueryClient
- 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)
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, address, 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 AddToExistingSessions ¶
func AddToExistingSessions( t *testing.T, appAddress string, serviceId string, blockHeight int64, suppliersAddress []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 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 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.
Types ¶
This section is empty.