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: 23 Imported by: 0

Documentation

Index

Constants

View Source
const DidNamespace = "testnet"

Variables

This section is empty.

Functions

func GenerateDID

func GenerateDID(idtype IDType) string

func GenerateEd25519VerificationKey2018VerificationMaterial added in v1.1.0

func GenerateEd25519VerificationKey2018VerificationMaterial(publicKey ed25519.PublicKey) string

func GenerateEd25519VerificationKey2020VerificationMaterial added in v1.1.0

func GenerateEd25519VerificationKey2020VerificationMaterial(publicKey ed25519.PublicKey) string

func GenerateJSONWebKey2020VerificationMaterial added in v1.1.0

func GenerateJSONWebKey2020VerificationMaterial(publicKey ed25519.PublicKey) string

func ParseJSONToMap added in v1.2.0

func ParseJSONToMap(jsonStr string) (map[string]any, error)

Types

type CreatedDidDocInfo

type CreatedDidDocInfo struct {
	DidDocInfo
	VersionID string
}

type DidDocInfo

type DidDocInfo struct {
	Msg          *types.MsgCreateDidDocPayload
	Did          string
	CollectionID string
	KeyPair      KeyPair
	KeyID        string
	SignInput    SignInput
}

type IDType

type IDType int
const (
	Base58_16bytes   IDType = iota
	Base58_16symbols IDType = iota
	UUID             IDType = iota
)

type KeyPair

type KeyPair struct {
	Private ed25519.PrivateKey
	Public  ed25519.PublicKey
}

func GenerateKeyPair

func GenerateKeyPair() KeyPair

type SignInput

type SignInput struct {
	VerificationMethodID string
	Key                  ed25519.PrivateKey
}

type TestSetup

type TestSetup struct {
	Cdc codec.Codec

	SdkCtx sdk.Context
	StdCtx context.Context

	Keeper      keeper.Keeper
	MsgServer   types.MsgServer
	QueryServer types.QueryServer
}

func Setup

func Setup() TestSetup

func (*TestSetup) BuildDidDocWithCustomDID

func (s *TestSetup) BuildDidDocWithCustomDID(did string) DidDocInfo

func (*TestSetup) BuildDidDocWithCustomID added in v1.1.0

func (s *TestSetup) BuildDidDocWithCustomID(uuid string) DidDocInfo

func (*TestSetup) BuildSimpleDidDoc

func (s *TestSetup) BuildSimpleDidDoc() DidDocInfo

func (*TestSetup) CreateCustomDidDoc

func (s *TestSetup) CreateCustomDidDoc(info DidDocInfo) CreatedDidDocInfo

func (*TestSetup) CreateDid

func (s *TestSetup) CreateDid(payload *types.MsgCreateDidDocPayload, signInputs []SignInput) (*types.MsgCreateDidDocResponse, error)

func (*TestSetup) CreateDidDocWithExternalControllers

func (s *TestSetup) CreateDidDocWithExternalControllers(controllers []string, signInputs []SignInput) CreatedDidDocInfo

func (*TestSetup) CreateSimpleDid

func (s *TestSetup) CreateSimpleDid() CreatedDidDocInfo

func (*TestSetup) DeactivateDidDoc

func (s *TestSetup) DeactivateDidDoc(payload *types.MsgDeactivateDidDocPayload, signInputs []SignInput) (*types.MsgDeactivateDidDocResponse, error)

func (*TestSetup) QueryAllDidDocVersionsMetadata

func (s *TestSetup) QueryAllDidDocVersionsMetadata(did string) (*types.QueryAllDidDocVersionsMetadataResponse, error)

func (*TestSetup) QueryDidDoc

func (s *TestSetup) QueryDidDoc(did string) (*types.QueryDidDocResponse, error)

func (*TestSetup) QueryDidDocVersion

func (s *TestSetup) QueryDidDocVersion(did, version string) (*types.QueryDidDocVersionResponse, error)

func (*TestSetup) UpdateDidDoc

func (s *TestSetup) UpdateDidDoc(payload *types.MsgUpdateDidDocPayload, signInputs []SignInput) (*types.MsgUpdateDidDocResponse, error)

Jump to

Keyboard shortcuts

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