setup

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GeneratedJSONDir = "generated"
)

Variables

This section is empty.

Functions

func JoinGenerated

func JoinGenerated(path ...string) string

Types

type DidAndMetadata

type DidAndMetadata struct {
	Data     didtypesv1.Did
	Metadata didtypesv1.Metadata
}

type ExistingDataset

type ExistingDataset struct {
	DidDocsV1   []didtypesv1.StateValue
	ResourcesV1 []resourcetypesv1.Resource

	DidDocsV2   []didtypes.DidDocWithMetadata
	ResourcesV2 []resourcetypes.ResourceWithMetadata
	// contains filtered or unexported fields
}

func NewExistingDataset

func NewExistingDataset(setup TestSetup) *ExistingDataset

func (*ExistingDataset) AddDidDocV1

func (d *ExistingDataset) AddDidDocV1(pathToDir, prefix string) error

func (*ExistingDataset) AddDidDocV2

func (d *ExistingDataset) AddDidDocV2(pathToDir, prefix string) error

func (*ExistingDataset) AddResourceV1

func (d *ExistingDataset) AddResourceV1(pathToDir, prefix string) error

func (*ExistingDataset) AddResourceV2

func (d *ExistingDataset) AddResourceV2(pathToDir, prefix string) error

func (*ExistingDataset) FillStore

func (d *ExistingDataset) FillStore() error

func (*ExistingDataset) MustAddDidDocV1

func (d *ExistingDataset) MustAddDidDocV1(pathToDir, prefix string)

func (*ExistingDataset) MustAddDidDocV2

func (d *ExistingDataset) MustAddDidDocV2(pathToDir, prefix string)

func (*ExistingDataset) MustAddResourceV1

func (d *ExistingDataset) MustAddResourceV1(pathToDir, prefix string)

func (*ExistingDataset) MustAddResourceV2

func (d *ExistingDataset) MustAddResourceV2(pathToDir, prefix string)

type ExpectedDataset

type ExpectedDataset struct {
	DidDocs   []didtypes.DidDocWithMetadata
	Resources []resourcetypes.ResourceWithMetadata
	// contains filtered or unexported fields
}

func NewExpectedDataset

func NewExpectedDataset(setup TestSetup) *ExpectedDataset

func (*ExpectedDataset) AddDidDocV2

func (d *ExpectedDataset) AddDidDocV2(pathToDir, prefix string) error

func (*ExpectedDataset) AddResourceV2

func (d *ExpectedDataset) AddResourceV2(pathToDir, prefix string) error

func (*ExpectedDataset) CheckStore

func (d *ExpectedDataset) CheckStore() error

func (*ExpectedDataset) MustAddDidDocV2

func (d *ExpectedDataset) MustAddDidDocV2(pathToDir, prefix string)

func (*ExpectedDataset) MustAddResourceV2

func (d *ExpectedDataset) MustAddResourceV2(pathToDir, prefix string)

type ILoader

type ILoader interface {
	LoadFile(path string, dataChunk any, setup TestSetup) error
	GetListOfFiles(pathToDir, prefix string) ([]string, error)
}

type KeyPairBase64

type KeyPairBase64 struct {
	PublicKey  string `json:"publicKey"`
	PrivateKey string `json:"privateKey"`
}

type Loader

type Loader struct{}

func (Loader) GetListOfFiles

func (l Loader) GetListOfFiles(pathToDir, prefix string) ([]string, error)

func (Loader) LoadFile

func (l Loader) LoadFile(
	path string,
	dataChunk any,
	setup TestSetup,
) error

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

func NewMigrator

func NewMigrator(
	setup TestSetup,
	migrations []appmigrations.Migration,
	existingDataset ExistingDataset,
	expectedDataset ExpectedDataset,
) Migrator

func (Migrator) Run

func (m Migrator) Run() error

type SignInput

type SignInput struct {
	VerificationMethodID string `json:"verificationMethodId"`
	PrivateKey           []byte `json:"privateKey"`
}

type TestSetup

type TestSetup struct {
	Cdc codec.Codec

	SdkCtx sdk.Context
	StdCtx context.Context

	DidKeeperV1      didkeeperv1.Keeper
	ResourceKeeperV1 resourcekeeperv1.Keeper

	DidKeeper      didkeeper.Keeper
	DidMsgServer   didtypes.MsgServer
	DidQueryServer didtypes.QueryServer

	ResourceKeeper      resourcekeeper.Keeper
	ResourceMsgServer   resourcetypes.MsgServer
	ResourceQueryServer resourcetypes.QueryServer

	DidStoreKey      *storetypes.KVStoreKey
	ResourceStoreKey *storetypes.KVStoreKey

	ParamsKeeper paramskeeper.Keeper
}

func Setup

func Setup() TestSetup

Jump to

Keyboard shortcuts

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