types

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package types defines the message types for the cert module.

Index

Constants

View Source
const (
	EventTypeCertifyCompilation = "certify_compilation"
	EventTypeCertify            = "certify"
	EventTypeRevokeCertificate  = "revoke_certificate"
)
View Source
const (
	// ModuleName is the name of the cert module
	ModuleName = "cert"

	// StoreKey is the string store representation
	StoreKey = ModuleName

	// QuerierRoute is the querier route for the cert module
	QuerierRoute = ModuleName

	// RouterKey is the msg router key for the cert module
	RouterKey = ModuleName
)
View Source
const (
	Add    AddOrRemove = false
	Remove AddOrRemove = true

	StringAdd    = "add"
	StringRemove = "remove"
)
View Source
const (
	// QueryCertifier is the query endpoint for certifier information.
	QueryCertifier = "certifier"

	// QueryCertifiers is the query endpoint for all certifiers information.
	QueryCertifiers = "certifiers"

	// QueryCertifierByAlias
	QueryCertifierByAlias = "certifieralias"

	// QueryValidator is the query endpoint for validator node certification.
	QueryCertifiedValidator = "validator"

	// QueryValidators is the query endpoint for all certified validator nodes.
	QueryCertifiedValidators = "validators"

	// QueryPlatform is the query endpoint for validator host platform.
	QueryPlatform = "platform"

	// QueryCertificate is the query endpoint for a certificate.
	QueryCertificate = "certificate"

	// QueryCertificate is the query endpoint for a certificate type.
	QueryCertificateType = "certificateType"

	// QueryCertificates is the query endpoint for certificates.
	QueryCertificates = "certificates"
)
View Source
const (
	// ProposalTypeCertifierUpdate defines the type for a CertifierUpdateProposal
	ProposalTypeCertifierUpdate = "CertifierUpdate"
)

Variables

View Source
var (
	ErrUnqualifiedCertifier   = sdkerrors.Register(ModuleName, 101, "certifier not qualified")
	ErrCertifierAlreadyExists = sdkerrors.Register(ModuleName, 102, "certifier already added")
	ErrCertifierNotExists     = sdkerrors.Register(ModuleName, 103, "certifier does not exist")
	ErrRepeatedAlias          = sdkerrors.Register(ModuleName, 104, "the alias has been used by other certifiers")
	ErrUnqualifiedProposer    = sdkerrors.Register(ModuleName, 105, "proposer not qualified")
	ErrEmptyCertifier         = sdkerrors.Register(ModuleName, 106, "certifier address empty")
	ErrAddOrRemove            = sdkerrors.Register(ModuleName, 107, "must be `add` or `remove`")
	ErrInvalidCertifierAlias  = sdkerrors.Register(ModuleName, 108, "invalid certifier alias`")
	ErrOnlyOneCertifier       = sdkerrors.Register(ModuleName, 109, "cannot remove only certifier")
)

[1xx] Certifier

View Source
var (
	ErrRejectedValidator    = sdkerrors.Register(ModuleName, 201, "only certifiers can certify or de-certify validators")
	ErrValidatorCertified   = sdkerrors.Register(ModuleName, 202, "validator has already been certified")
	ErrValidatorUncertified = sdkerrors.Register(ModuleName, 203, "validator has not been certified")
	ErrTombstonedValidator  = sdkerrors.Register(ModuleName, 204, "validator has already been tombstoned")
	ErrMissingValidator     = sdkerrors.Register(ModuleName, 205, "validator missing from staking store")
)

[2xx] Validator

View Source
var (
	ErrCertificateNotExists      = sdkerrors.Register(ModuleName, 301, "certificate id does not exist")
	ErrCertificateGenesis        = sdkerrors.Register(ModuleName, 302, "invalid certificate genesis")
	ErrInvalidCertificateType    = sdkerrors.Register(ModuleName, 303, "invalid certificate type")
	ErrSourceCodeHash            = sdkerrors.Register(ModuleName, 304, "invalid source code hash")
	ErrCompiler                  = sdkerrors.Register(ModuleName, 305, "invalid compiler")
	ErrBytecodeHash              = sdkerrors.Register(ModuleName, 306, "invalid bytecode hash")
	ErrInvalidRequestContentType = sdkerrors.Register(ModuleName, 307, "invalid request content type")
	ErrUnqualifiedRevoker        = sdkerrors.Register(ModuleName, 308, "only certifiers can revoke this certificate")
)

[3xx] Certificate

View Source
var (
	ErrLibraryNotExists     = sdkerrors.Register(ModuleName, 401, "library does not exist")
	ErrLibraryAlreadyExists = sdkerrors.Register(ModuleName, 402, "library already exists")
)

[4xx] Library

CertificateTypes is an array of all certificate types.

View Source
var ModuleCdc *codec.Codec

ModuleCdc defines the cert codec.

RequestContentTypes is an array of all request content types.

Functions

func CertificateStoreContentKey

func CertificateStoreContentKey(certType CertificateType, reqContentType RequestContentType, reqContent string) []byte

CertificateStoreContentKey gets the prefix for certificate key of given certifier, certificate type, content type, and content.

func CertificateStoreKey

func CertificateStoreKey(bz []byte) []byte

CertificateStoreKey returns the kv-store key for accessing a given certificate (ID).

func CertificatesStoreKey

func CertificatesStoreKey() []byte

CertificatesStoreKey returns the kv-store key for accessing all certificates.

func CertifierAliasStoreKey

func CertifierAliasStoreKey(alias string) []byte

CertifierAliasStoreKey returns the kv-store key for the certifier alias.

func CertifierAliasesStoreKey

func CertifierAliasesStoreKey() []byte

CertifierAliasesStoreKey returns the kv-store key for accessing aliases of all current certifiers.

func CertifierStoreKey

func CertifierStoreKey(certifier sdk.AccAddress) []byte

CertifierStoreKey returns the kv-store key for the certifier registration.

func CertifiersStoreKey

func CertifiersStoreKey() []byte

CertifiersStoreKey returns the kv-store key for accessing all current certifiers in the security council.

func LibrariesStoreKey

func LibrariesStoreKey() []byte

LibrariesStoreKey returns the kv-store key for accessing all certificate library addresses.

func LibraryStoreKey

func LibraryStoreKey(library sdk.AccAddress) []byte

LibraryStoreKey returns the kv-store key for accessing certificate library address.

func PlatformStoreKey

func PlatformStoreKey(validator crypto.PubKey) []byte

PlatformStoreKey returns the kv-store key for the validator host platform certificate.

func PlatformsStoreKey

func PlatformsStoreKey() []byte

PlatformsStoreKey returns the kv-store key for accessing all platform certificates.

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

func ValidateGenesis

func ValidateGenesis(bz json.RawMessage) error

ValidateGenesis - validate crisis genesis data

func ValidatorStoreKey

func ValidatorStoreKey(validator crypto.PubKey) []byte

ValidatorStoreKey returns the kv-store key for the validator node certification.

func ValidatorsStoreKey

func ValidatorsStoreKey() []byte

ValidatorsStoreKey returns the kv-store key for accessing all validator node certifications.

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account
}

type AddOrRemove

type AddOrRemove bool

func AddOrRemoveFromString

func AddOrRemoveFromString(str string) (AddOrRemove, error)

func (AddOrRemove) MarshalJSON

func (aor AddOrRemove) MarshalJSON() ([]byte, error)

MarshalJSON marshals to JSON using string

func (AddOrRemove) String

func (aor AddOrRemove) String() string

func (*AddOrRemove) UnmarshalJSON

func (aor *AddOrRemove) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals from JSON assuming Bech32 encoding

type Certificate

type Certificate interface {
	ID() CertificateID
	Type() CertificateType
	Certifier() sdk.AccAddress
	RequestContent() RequestContent
	CertificateContent() string
	FormattedCertificateContent() []KVPair
	Description() string
	TxHash() string

	Bytes(*codec.Codec) []byte
	String() string

	SetCertificateID(CertificateID)
	SetTxHash(string)
}

Certificate is the interface for all kinds of certificate

type CertificateID

type CertificateID string

CertificateID is the type for the ID of a certificate.

func GetCertificateID

func GetCertificateID(certType CertificateType, reqContent RequestContent, i uint8) CertificateID

GetCertificateID constructs CertificateID (hex string) given certificate information. Its binary representation is the certificate store key without prefix.

func (CertificateID) Bytes

func (id CertificateID) Bytes() []byte

Bytes returns the byte array for a certificate ID.

func (CertificateID) String

func (id CertificateID) String() string

type CertificateType

type CertificateType byte

CertificateType is the type for the type of a certificate.

const (
	CertificateTypeNil CertificateType = iota
	CertificateTypeCompilation
	CertificateTypeAuditing
	CertificateTypeProof
	CertificateTypeOracleOperator
	CertificateTypeShieldPoolCreator
	CertificateTypeIdentity
	CertificateTypeGeneral
)

Certificate types

func CertificateTypeFromString

func CertificateTypeFromString(s string) CertificateType

CertificateTypeFromString returns a certificate type by parsing a string.

func (CertificateType) Bytes

func (c CertificateType) Bytes() []byte

Bytes returns the byte array for a certificate type.

func (CertificateType) String

func (c CertificateType) String() string

String returns the string for a certificate type.

type Certifier

type Certifier struct {
	Address     sdk.AccAddress `json:"certifier"`
	Alias       string         `json:"alias"`
	Proposer    sdk.AccAddress `json:"proposer"`
	Description string         `json:"description"`
}

Certifier is a type for certifier.

func NewCertifier

func NewCertifier(
	address sdk.AccAddress,
	alias string,
	proposer sdk.AccAddress,
	description string,
) Certifier

NewCertifier returns a new certifier.

func (Certifier) String

func (c Certifier) String() string

String returns a human readable string representation of a validator.

type CertifierUpdateProposal

type CertifierUpdateProposal struct {
	Title       string         `json:"title" yaml:"title"`
	Proposer    sdk.AccAddress `json:"proposer" yaml:"proposer"`
	Alias       string         `json:"alias" yaml:"alias"`
	Certifier   sdk.AccAddress `json:"certifier" yaml:"certifier"`
	Description string         `json:"description" yaml:"description"`
	AddOrRemove AddOrRemove    `json:"add_or_remove" yaml:"add_or_remove"`
}

CertifierUpdateProposal adds or removes a certifier

func NewCertifierUpdateProposal

func NewCertifierUpdateProposal(title,
	description string,
	certifier sdk.AccAddress,
	alias string,
	proposer sdk.AccAddress,
	addorremove AddOrRemove,
) CertifierUpdateProposal

NewCertifierUpdateProposal creates a new certifier update proposal.

func (CertifierUpdateProposal) GetDescription

func (cup CertifierUpdateProposal) GetDescription() string

GetDescription returns the description of a certifier update proposal.

func (CertifierUpdateProposal) GetTitle

func (cup CertifierUpdateProposal) GetTitle() string

GetTitle returns the title of a certifier update proposal.

func (CertifierUpdateProposal) ProposalRoute

func (cup CertifierUpdateProposal) ProposalRoute() string

GetDescription returns the routing key of a certifier update proposal.

func (CertifierUpdateProposal) ProposalType

func (cup CertifierUpdateProposal) ProposalType() string

ProposalType returns the type of a certifier update proposal.

func (CertifierUpdateProposal) String

func (cup CertifierUpdateProposal) String() string

String implements the Stringer interface.

func (CertifierUpdateProposal) ValidateBasic

func (cup CertifierUpdateProposal) ValidateBasic() error

ValidateBasic runs basic stateless validity checks

type Certifiers

type Certifiers []Certifier

Certifiers is a collection of certifier objects.

func (Certifiers) String

func (c Certifiers) String() (out string)

type CompilationCertificate

type CompilationCertificate struct {
	IssueBlockHeight int64                         `json:"time_issued"`
	CertID           CertificateID                 `json:"certificate_id"`
	CertType         CertificateType               `json:"certificate_type"`
	ReqContent       RequestContent                `json:"request_content"`
	CertContent      CompilationCertificateContent `json:"certificate_content"`
	CertDescription  string                        `json:"description"`
	CertCertifier    sdk.AccAddress                `json:"certifier"`
	CertTxHash       string                        `json:"txhash"`
}

CompilationCertificate defines type for the compilation certificate.

func NewCompilationCertificate

func NewCompilationCertificate(
	certificateType CertificateType,
	sourceCodeHash string,
	compiler string,
	bytecodeHash string,
	description string,
	certifier sdk.AccAddress,
) *CompilationCertificate

NewCompilationCertificate returns a new compilation certificate

func (*CompilationCertificate) Bytes

func (c *CompilationCertificate) Bytes(cdc *codec.Codec) []byte

Bytes returns a byte array for the certificate.

func (*CompilationCertificate) CertificateContent

func (c *CompilationCertificate) CertificateContent() string

CertificateContent returns certificate content of the certificate.

func (*CompilationCertificate) Certifier

func (c *CompilationCertificate) Certifier() sdk.AccAddress

Certifier returns certifier account address of the certificate.

func (*CompilationCertificate) Description

func (c *CompilationCertificate) Description() string

Description returns description of the certificate.

func (*CompilationCertificate) FormattedCertificateContent

func (c *CompilationCertificate) FormattedCertificateContent() []KVPair

FormattedCertificateContent returns formatted certificate content of the certificate.

func (*CompilationCertificate) ID

ID returns ID of the certificate.

func (*CompilationCertificate) RequestContent

func (c *CompilationCertificate) RequestContent() RequestContent

RequestContent returns request content of the certificate.

func (*CompilationCertificate) SetCertificateID

func (c *CompilationCertificate) SetCertificateID(id CertificateID)

SetCertificateID provides a method to set an ID for the certificate.

func (*CompilationCertificate) SetTxHash

func (c *CompilationCertificate) SetTxHash(txhash string)

SetTxHash provides a method to set txhash of the certificate.

func (*CompilationCertificate) String

func (c *CompilationCertificate) String() string

String returns a human readable string representation of the certificate.

func (*CompilationCertificate) TxHash

func (c *CompilationCertificate) TxHash() string

TxHash returns the hash of the tx when the certificate is issued.

func (*CompilationCertificate) Type

Type returns the certificate type.

type CompilationCertificateContent

type CompilationCertificateContent struct {
	Compiler     string `json:"compiler"`
	BytecodeHash string `json:"bytecode_hash"`
}

CompilationCertificateContent defines type for the compilation certificate content.

func NewCompilationCertificateContent

func NewCompilationCertificateContent(compiler, bytecodeHash string) CompilationCertificateContent

NewCompilationCertificateContent returns a new compilation certificate content.

func (CompilationCertificateContent) String

String returns string of the compilation certificate content.

type GeneralCertificate

type GeneralCertificate struct {
	CertID          CertificateID   `json:"certificate_id"`
	CertType        CertificateType `json:"certificate_type"`
	ReqContent      RequestContent  `json:"request_content"`
	CertDescription string          `json:"description"`
	CertCertifier   sdk.AccAddress  `json:"certifier"`
	CertTxHash      string          `json:"txhash"`
}

GeneralCertificate defines the type for general certificate.

func NewGeneralCertificate

func NewGeneralCertificate(
	certTypeStr, reqContTypeStr, reqContStr, description string, certifier sdk.AccAddress,
) (*GeneralCertificate, error)

NewGeneralCertificate returns a new general certificate.

func (*GeneralCertificate) Bytes

func (c *GeneralCertificate) Bytes(cdc *codec.Codec) []byte

Bytes returns a byte array for the certificate.

func (*GeneralCertificate) CertificateContent

func (c *GeneralCertificate) CertificateContent() string

CertificateContent returns certificate content of the certificate.

func (*GeneralCertificate) Certifier

func (c *GeneralCertificate) Certifier() sdk.AccAddress

Certifier returns certifier account address of the certificate.

func (*GeneralCertificate) Description

func (c *GeneralCertificate) Description() string

Description returns description of the certificate.

func (*GeneralCertificate) FormattedCertificateContent

func (c *GeneralCertificate) FormattedCertificateContent() []KVPair

FormattedCertificateContent returns formatted certificate content of the certificate.

func (*GeneralCertificate) ID

ID returns ID of the certificate.

func (*GeneralCertificate) RequestContent

func (c *GeneralCertificate) RequestContent() RequestContent

RequestContent returns request content of the certificate.

func (*GeneralCertificate) SetCertificateID

func (c *GeneralCertificate) SetCertificateID(id CertificateID)

SetCertificateID provides a method to set an ID for the certificate.

func (*GeneralCertificate) SetTxHash

func (c *GeneralCertificate) SetTxHash(txhash string)

SetTxHash provides a method to set txhash of the certificate.

func (*GeneralCertificate) String

func (c *GeneralCertificate) String() string

String returns a human readable string representation of the certificate.

func (*GeneralCertificate) TxHash

func (c *GeneralCertificate) TxHash() string

TxHash returns the hash of the tx when the certificate is issued.

func (*GeneralCertificate) Type

Type returns the certificate type.

type GenesisState

type GenesisState struct {
	Certifiers   []Certifier   `json:"certifiers"`
	Validators   []Validator   `json:"validators"`
	Platforms    []Platform    `json:"platforms"`
	Certificates []Certificate `json:"certificates"`
	Libraries    []Library     `json:"libraries"`
}

GenesisState - crisis genesis state

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState creates a default GenesisState object

func GetGenesisStateFromAppState

func GetGenesisStateFromAppState(cdc *codec.Codec, appState map[string]json.RawMessage) GenesisState

GetGenesisStateFromAppState returns x/auth GenesisState given raw application genesis state.

func NewGenesisState

func NewGenesisState(constantFee sdk.Coin, startingCertificateID CertificateID) GenesisState

NewGenesisState creates a new GenesisState object

type KVPair

type KVPair struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

KVPair defines type for the key-value pair.

func NewKVPair

func NewKVPair(key string, value string) KVPair

NewKVPair returns a new key-value pair.

type Libraries

type Libraries []Library

Libraries is a collection of Library objects.

type Library

type Library struct {
	Address   sdk.AccAddress
	Publisher sdk.AccAddress
}

Library is a type for certified libraries.

type MsgCertifyCompilation

type MsgCertifyCompilation struct {
	SourceCodeHash string         `json:"sourcecodehash" yaml:"sourcecodehash"`
	Compiler       string         `json:"compiler" yaml:"compiler"`
	BytecodeHash   string         `json:"bytecodehash" yaml:"bytecodehash"`
	Description    string         `json:"description" yaml:"description"`
	Certifier      sdk.AccAddress `json:"certifier" yaml:"certifier"`
}

MsgCertifyCompilation is the message for certifying a compilation.

func NewMsgCertifyCompilation

func NewMsgCertifyCompilation(sourceCodeHash, compiler, bytecodeHash, description string, certifier sdk.AccAddress) MsgCertifyCompilation

NewMsgCertifyCompilation returns a compilation certificate message.

func (MsgCertifyCompilation) GetSignBytes

func (m MsgCertifyCompilation) GetSignBytes() []byte

GetSignBytes encodes the message for signing.

func (MsgCertifyCompilation) GetSigners

func (m MsgCertifyCompilation) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required.

func (MsgCertifyCompilation) Route

func (m MsgCertifyCompilation) Route() string

Route returns the module name.

func (MsgCertifyCompilation) Type

func (m MsgCertifyCompilation) Type() string

Type returns the action name.

func (MsgCertifyCompilation) ValidateBasic

func (m MsgCertifyCompilation) ValidateBasic() error

ValidateBasic runs stateless checks on the message.

type MsgCertifyGeneral

type MsgCertifyGeneral struct {
	CertificateType    string         `json:"certificate_type" yaml:"certificate_type"`
	RequestContentType string         `json:"request_content_type" yaml:"request_content_type"`
	RequestContent     string         `json:"request_content" yaml:"request_content"`
	Description        string         `json:"description" yaml:"description"`
	Certifier          sdk.AccAddress `json:"certifier" yaml:"certiifer"`
}

MsgCertifyGeneral is the message for issuing a general certificate.

func NewMsgCertifyGeneral

func NewMsgCertifyGeneral(
	certificateType, requestContentType, requestContent, description string, certifier sdk.AccAddress,
) MsgCertifyGeneral

NewMsgCertifyGeneral returns a new general certification message.

func (MsgCertifyGeneral) GetSignBytes

func (m MsgCertifyGeneral) GetSignBytes() []byte

GetSignBytes encodes the message for signing.

func (MsgCertifyGeneral) GetSigners

func (m MsgCertifyGeneral) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required.

func (MsgCertifyGeneral) Route

func (m MsgCertifyGeneral) Route() string

Route returns the module name.

func (MsgCertifyGeneral) Type

func (m MsgCertifyGeneral) Type() string

Type returns the action name.

func (MsgCertifyGeneral) ValidateBasic

func (m MsgCertifyGeneral) ValidateBasic() error

ValidateBasic runs stateless checks on the message.

type MsgCertifyPlatform

type MsgCertifyPlatform struct {
	Certifier sdk.AccAddress `json:"certifier" yaml:"certifier"`
	Validator crypto.PubKey  `json:"validator" yaml:"validator"`
	Platform  string         `json:"platform" yaml:"platform"`
}

MsgCertifyPlatform is the message for certifying a validator's host platform.

func NewMsgCertifyPlatform

func NewMsgCertifyPlatform(certifier sdk.AccAddress, validator crypto.PubKey, platform string) MsgCertifyPlatform

NewMsgCertifyPlatform returns a new validator host platform certification message.

func (MsgCertifyPlatform) GetSignBytes

func (m MsgCertifyPlatform) GetSignBytes() []byte

GetSignBytes encodes the message for signing.

func (MsgCertifyPlatform) GetSigners

func (m MsgCertifyPlatform) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required.

func (MsgCertifyPlatform) MarshalJSON

func (m MsgCertifyPlatform) MarshalJSON() ([]byte, error)

Custom implementation due to the pubkey.

func (MsgCertifyPlatform) MarshalYAML

func (m MsgCertifyPlatform) MarshalYAML() (interface{}, error)

MarshalYAML implements a custom marshal yaml function due to consensus pubkey.

func (MsgCertifyPlatform) Route

func (m MsgCertifyPlatform) Route() string

Route returns the module name.

func (MsgCertifyPlatform) Type

func (m MsgCertifyPlatform) Type() string

Type returns the action name.

func (*MsgCertifyPlatform) UnmarshalJSON

func (m *MsgCertifyPlatform) UnmarshalJSON(bz []byte) error

Custom implementation due to the pubkey.

func (MsgCertifyPlatform) ValidateBasic

func (m MsgCertifyPlatform) ValidateBasic() error

ValidateBasic runs stateless checks on the message.

type MsgCertifyValidator

type MsgCertifyValidator struct {
	Certifier sdk.AccAddress `json:"certifier" yaml:"certifier"`
	Validator crypto.PubKey  `json:"validator" yaml:"validator"`
}

MsgCertifyValidator is the message for certifying a validator node.

func NewMsgCertifyValidator

func NewMsgCertifyValidator(certifier sdk.AccAddress, validator crypto.PubKey) MsgCertifyValidator

NewMsgCertifyValidator returns a new validator node certification message.

func (MsgCertifyValidator) GetSignBytes

func (m MsgCertifyValidator) GetSignBytes() []byte

GetSignBytes encodes the message for signing.

func (MsgCertifyValidator) GetSigners

func (m MsgCertifyValidator) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required.

func (MsgCertifyValidator) MarshalJSON

func (m MsgCertifyValidator) MarshalJSON() ([]byte, error)

Custom implementation due to the pubkey.

func (MsgCertifyValidator) MarshalYAML

func (m MsgCertifyValidator) MarshalYAML() (interface{}, error)

MarshalYAML implements a custom marshal yaml function due to consensus pubkey.

func (MsgCertifyValidator) Route

func (m MsgCertifyValidator) Route() string

Route returns the module name.

func (MsgCertifyValidator) Type

func (m MsgCertifyValidator) Type() string

Type returns the action name.

func (*MsgCertifyValidator) UnmarshalJSON

func (m *MsgCertifyValidator) UnmarshalJSON(bz []byte) error

Custom implementation due to the pubkey.

func (MsgCertifyValidator) ValidateBasic

func (m MsgCertifyValidator) ValidateBasic() error

ValidateBasic runs stateless checks on the message.

type MsgDecertifyValidator

type MsgDecertifyValidator struct {
	Decertifier sdk.AccAddress `json:"decertifier" yaml:"decertifier"`
	Validator   crypto.PubKey  `json:"validator" yaml:"validator"`
}

MsgDecertifyValidator is the message for de-certifying a validator node.

func NewMsgDecertifyValidator

func NewMsgDecertifyValidator(decertifier sdk.AccAddress, validator crypto.PubKey) MsgDecertifyValidator

NewMsgDecertifyValidator returns a new validator node de-certification message.

func (MsgDecertifyValidator) GetSignBytes

func (m MsgDecertifyValidator) GetSignBytes() []byte

GetSignBytes encodes the message for signing.

func (MsgDecertifyValidator) GetSigners

func (m MsgDecertifyValidator) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required.

func (MsgDecertifyValidator) MarshalJSON

func (m MsgDecertifyValidator) MarshalJSON() ([]byte, error)

Custom implementation due to the pubkey.

func (MsgDecertifyValidator) MarshalYAML

func (m MsgDecertifyValidator) MarshalYAML() (interface{}, error)

MarshalYAML implements a custom marshal yaml function due to consensus pubkey.

func (MsgDecertifyValidator) Route

func (m MsgDecertifyValidator) Route() string

Route returns the module name.

func (MsgDecertifyValidator) Type

func (m MsgDecertifyValidator) Type() string

Type returns the action name.

func (*MsgDecertifyValidator) UnmarshalJSON

func (m *MsgDecertifyValidator) UnmarshalJSON(bz []byte) error

Custom implementation due to the pubkey.

func (MsgDecertifyValidator) ValidateBasic

func (m MsgDecertifyValidator) ValidateBasic() error

ValidateBasic runs stateless checks on the message.

type MsgProposeCertifier

type MsgProposeCertifier struct {
	Proposer    sdk.AccAddress `json:"proposer" yaml:"proposer"`
	Alias       string         `json:"alias" yaml:"alias"`
	Certifier   sdk.AccAddress `json:"certifier" yaml:"certifier"`
	Description string         `json:"description" yaml:"description"`
}

MsgProposeCertifier is the message for proposing new certifier.

func NewMsgProposeCertifier

func NewMsgProposeCertifier(proposer, certifier sdk.AccAddress, alias string, description string) MsgProposeCertifier

NewMsgProposeCertifier returns a new certifier proposal message.

func (MsgProposeCertifier) GetSignBytes

func (m MsgProposeCertifier) GetSignBytes() []byte

GetSignBytes encodes the message for signing.

func (MsgProposeCertifier) GetSigners

func (m MsgProposeCertifier) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required.

func (MsgProposeCertifier) Route

func (m MsgProposeCertifier) Route() string

Route returns the module name.

func (MsgProposeCertifier) Type

func (m MsgProposeCertifier) Type() string

Type returns the action name.

func (MsgProposeCertifier) ValidateBasic

func (m MsgProposeCertifier) ValidateBasic() error

ValidateBasic runs stateless checks on the message.

type MsgRevokeCertificate

type MsgRevokeCertificate struct {
	Revoker     sdk.AccAddress `json:"revoker" yaml:"revoker"`
	ID          CertificateID  `json:"id" yaml:"id"`
	Description string         `json:"description" yaml:"description"`
}

MsgRevokeCertificate returns a certificate revoking operation.

func NewMsgRevokeCertificate

func NewMsgRevokeCertificate(revoker sdk.AccAddress, id CertificateID, description string) MsgRevokeCertificate

NewMsgRevokeCertificate creates a new instance of MsgRevokeCertificate.

func (MsgRevokeCertificate) GetSignBytes

func (m MsgRevokeCertificate) GetSignBytes() []byte

GetSignBytes encodes the message for signing.

func (MsgRevokeCertificate) GetSigners

func (m MsgRevokeCertificate) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required.

func (MsgRevokeCertificate) Route

func (m MsgRevokeCertificate) Route() string

Route returns the module name.

func (MsgRevokeCertificate) Type

func (m MsgRevokeCertificate) Type() string

Type returns the action name.

func (MsgRevokeCertificate) ValidateBasic

func (m MsgRevokeCertificate) ValidateBasic() error

ValidateBasic runs stateless checks on the message.

type Platform

type Platform struct {
	Validator   crypto.PubKey
	Description string
}

Platform is a genesis type for certified platform of a validator

type QueryCertificatesParams

type QueryCertificatesParams struct {
	Page        int
	Limit       int
	Certifier   sdk.AccAddress
	ContentType string
	Content     string
}

QueryCertificatesParams is the type for parameters of querying certificates.

func NewQueryCertificatesParams

func NewQueryCertificatesParams(page, limit int, certifier sdk.AccAddress, contentType, content string) QueryCertificatesParams

NewQueryCertificatesParams creates a new instance of QueryCertificatesParams.

type QueryResCertifiers

type QueryResCertifiers struct {
	Certifiers Certifiers `json:"certifiers"`
}

QueryResCertifiers is the query result payload for all certifiers.

func (QueryResCertifiers) String

func (q QueryResCertifiers) String() string

String implements fmt.Stringer.

type QueryResPlatform

type QueryResPlatform struct {
	Platform string `json:"platform"`
}

QueryResPlatform is the query result payload for a validator host platform query.

func (QueryResPlatform) String

func (q QueryResPlatform) String() string

String implements fmt.Stringer.

type QueryResValidator

type QueryResValidator struct {
	Certifier sdk.AccAddress `json:"certifier"`
}

QueryResValidator is the query result payload for a certified validator query.

func (QueryResValidator) String

func (q QueryResValidator) String() string

String implements fmt.Stringer.

type QueryResValidators

type QueryResValidators struct {
	Validators []string `json:"validators"`
}

QueryResValidators is the query result payload for all certified validators.

func (QueryResValidators) String

func (q QueryResValidators) String() string

String implements fmt.Stringer.

type RequestContent

type RequestContent struct {
	RequestContentType RequestContentType `json:"request_content_type"`
	RequestContent     string             `json:"request_content"`
}

RequestContent defines type for the request content.

func NewRequestContent

func NewRequestContent(
	requestContentTypeString string,
	requestContent string,
) (RequestContent, error)

NewRequestContent returns a new request content.

type RequestContentType

type RequestContentType byte

RequestContentType is the type for requestContent

const (
	RequestContentTypeNil RequestContentType = iota
	RequestContentTypeSourceCodeHash
	RequestContentTypeAddress
	RequestContentTypeBytecodeHash
	RequestContentTypeGeneral
)

RequestContent types

func RequestContentTypeFromString

func RequestContentTypeFromString(s string) RequestContentType

RequestContentTypeFromString returns the request content type by parsing a string.

func (RequestContentType) Bytes

func (c RequestContentType) Bytes() []byte

Bytes returns the byte array for a request content type.

func (RequestContentType) String

func (c RequestContentType) String() string

String returns string of the request content type.

type SlashingKeeper

type SlashingKeeper interface {
	IsTombstoned(sdk.Context, sdk.ConsAddress) bool
	Tombstone(sdk.Context, sdk.ConsAddress)
	Jail(sdk.Context, sdk.ConsAddress)
	JailUntil(sdk.Context, sdk.ConsAddress, time.Time)
}

type StakingKeeper

type StakingKeeper interface {
	ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingexported.ValidatorI
	GetAllValidators(ctx sdk.Context) []staking.Validator
	GetValidatorDelegations(ctx sdk.Context, valAddr sdk.ValAddress) []staking.Delegation
}

type Validator

type Validator struct {
	PubKey    crypto.PubKey
	Certifier sdk.AccAddress
}

Validator is a type for certified validator.

type Validators

type Validators []Validator

Validators is a collection of Validator objects.

Jump to

Keyboard shortcuts

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