v1_2_0

package
Version: v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

DONTCOVER nolint

DONTCOVER nolint

Index

Constants

View Source
const (
	ModuleName = "docs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	UUID           string                  `json:"uuid"`
	Metadata       DocumentMetadata        `json:"metadata"`
	ContentURI     string                  `json:"content_uri"`     // Optional
	Checksum       *DocumentChecksum       `json:"checksum"`        // Optional
	EncryptionData *DocumentEncryptionData `json:"encryption_data"` // Optional
}

type DocumentChecksum

type DocumentChecksum struct {
	Value     string `json:"value"`
	Algorithm string `json:"algorithm"`
}

type DocumentEncryptionData

type DocumentEncryptionData struct {
	Keys          []DocumentEncryptionKey `json:"keys"`           // contains the keys used to encrypt the data
	EncryptedData []string                `json:"encrypted_data"` // contains the list of data that have been encrypted
}

type DocumentEncryptionKey

type DocumentEncryptionKey struct {
	Recipient sdk.AccAddress `json:"recipient"` // Recipient that should use this data
	Value     string         `json:"value"`     // Value of the key that should be used. This is encrypted with the recipient's public key
}

type DocumentMetadata

type DocumentMetadata struct {
	ContentURI string                  `json:"content_uri"`
	SchemaType string                  `json:"schema_type"` // Optional - Either this or schema must be defined
	Schema     *DocumentMetadataSchema `json:"schema"`      // Optional - Either this or schema_type must be defined
}

type DocumentMetadataSchema

type DocumentMetadataSchema struct {
	URI     string `json:"uri"`
	Version string `json:"version"`
}

type DocumentReceipt

type DocumentReceipt struct {
	Sender       sdk.AccAddress `json:"sender"`
	Recipient    sdk.AccAddress `json:"recipient"`
	TxHash       string         `json:"tx_hash"`
	DocumentUUID string         `json:"document_uuid"`
	Proof        string         `json:"proof"`
}

type GenesisState

type GenesisState struct {
	UsersData                      []UserDocumentsData `json:"users_data"`
	SupportedMetadataSchemes       []MetadataSchema    `json:"supported_metadata_schemes"`
	TrustedMetadataSchemaProposers []sdk.AccAddress    `json:"trusted_metadata_schema_proposers"`
}

v1.2.0 docs genesis state

func Migrate

func Migrate(oldGenState v110docs.GenesisState) GenesisState

Migrate accepts exported genesis state from v1.1.0 and migrates it to v1.2.0 genesis state. This migration changes the data that are saved for each document removing the metadata proof

type MetadataSchema added in v1.3.0

type MetadataSchema struct {
	Type      string `json:"type"`
	SchemaURI string `json:"schema_uri"`
	Version   string `json:"version"`
}

type UserDocumentsData

type UserDocumentsData struct {
	User              sdk.AccAddress    `json:"user"`
	SentDocuments     []Document        `json:"sent_documents"`
	ReceivedDocuments []Document        `json:"received_documents"`
	SentReceipts      []DocumentReceipt `json:"sent_receipts"`
	ReceivedReceipts  []DocumentReceipt `json:"received_receipts"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL