testrings

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 7 Imported by: 0

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.

Jump to

Keyboard shortcuts

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