Documentation ¶
Overview ¶
Package testrings provides helper functions for constructing real (e.g. localnet) and mock RingCache objects with pre-configured and/or parameterized call arguments, return value(s), and/or expectations thereof. Intended for use in tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRingCacheWithMockDependencies ¶
func NewRingCacheWithMockDependencies( ctx context.Context, t *testing.T, deps depinject.Config, ) crypto.RingCache
NewRingCacheWithMockDependencies creates a new "real" RingCache with the given mock Account and Application queriers supplied as dependencies. A Delegation client is required as a dependency and depending on how it is used will require a different function to generate the delegations client. The queriers are expected to maintain their respective mocked states:
- Account querier: the account addresses and public keys
- Application querier: the application addresses delegatee gateway addresses
See:
testutil/testclient/testqueryclients/accquerier.go testutil/testclient/testqueryclients/appquerier.go testutil/testclient/testdelegation/client.go
for methods to create these queriers and maintain their states.
Types ¶
This section is empty.