tests

package
v0.1.8-rc.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

README

Running Tests

To run all SSI related tests:

go test -v -count=1 "./x/ssi/tests" 

If you want to run a single unit test of a particular test file (say TestVerificationMethodRotation()):

go test -v -count=1 -run "^TestVerificationMethodRotation$" "./x/ssi/tests"

To run multiple tests:

go test -v -count=1 -run ^(TestDidResolve|TestDidParam)$ "./x/ssi/tests"

Documentation

Index

Constants

View Source
const ChainNamespace = "devnet"
View Source
const Creator = "hid1kxqk5ejca8nfpw8pg47484rppv359xh7qcasy4"
View Source
const DidMethod = "hid"

Variables

This section is empty.

Functions

func CreateDidTx

func CreateDidTx(msgServer types.MsgServer, ctx context.Context, keyPair ed25519KeyPair) (string, error)

func GenerateEd25519KeyPair added in v0.1.4

func GenerateEd25519KeyPair() ed25519KeyPair

func GenerateSecp256k1KeyPair added in v0.1.5

func GenerateSecp256k1KeyPair() secp256k1KeyPair

func GetPublicKeyAndOptionalID added in v0.1.5

func GetPublicKeyAndOptionalID(keyPair GenericKeyPair) (string, string)

func QueryDid

func QueryDid(k *keeper.Keeper, ctx sdk.Context, Id string) *types.DidDocumentState

func SignGeneric added in v0.1.4

func SignGeneric(keyPair GenericKeyPair, data []byte) []byte

func TestKeeper

func TestKeeper(t testing.TB) (*keeper.Keeper, sdk.Context)

func UpdateDidTx

func UpdateDidTx(msgServer types.MsgServer, ctx context.Context, rpcElements DidRpcElements, versionId string) error

Types

type CredRpcElements

type CredRpcElements struct {
	Status  *types.CredentialStatus
	Proof   *types.CredentialProof
	Creator string
}

func GenerateCredStatusRPCElements

func GenerateCredStatusRPCElements(keyPair GenericKeyPair, issuerId string, verficationMethod *types.VerificationMethod) CredRpcElements

func UpdateCredStatus

func UpdateCredStatus(newStatus string, credRpcElem CredRpcElements, keyPair ed25519KeyPair) CredRpcElements

type DidRpcElements

type DidRpcElements struct {
	DidDocument *types.Did
	Signatures  []*types.SignInfo
	Creator     string
}

func GenerateDidDocumentRPCElements

func GenerateDidDocumentRPCElements(keyPair GenericKeyPair, signingElements []DidSigningElements) DidRpcElements

func GetModifiedDidDocumentSignature

func GetModifiedDidDocumentSignature(modifiedDidDocument *types.Did, keyPair ed25519KeyPair, verificationMethodId string) DidRpcElements

type DidSigningElements added in v0.1.4

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

type GenericKeyPair added in v0.1.4

type GenericKeyPair = interface{}

An interface to support multiple Key Pair Structs

type SchemaRpcElements

type SchemaRpcElements struct {
	SchemaDocument *types.SchemaDocument
	SchemaProof    *types.SchemaProof
	Creator        string
}

func GenerateSchemaDocumentRPCElements

func GenerateSchemaDocumentRPCElements(keyPair GenericKeyPair, authorId string, verficationMethodId string) SchemaRpcElements

Jump to

Keyboard shortcuts

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