exported

package
v0.35.8 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyIDLengthMin = 4
	KeyIDLengthMax = 256
)

key id length range bounds dictated by tofnd

View Source
const (
	// HashLength is the expected length of the hash
	HashLength = 32
)

Variables

View Source
var KeyState_name = map[int32]string{
	0: "KEY_STATE_UNSPECIFIED",
	1: "KEY_STATE_ASSIGNED",
	2: "KEY_STATE_ACTIVE",
}
View Source
var KeyState_value = map[string]int32{
	"KEY_STATE_UNSPECIFIED": 0,
	"KEY_STATE_ASSIGNED":    1,
	"KEY_STATE_ACTIVE":      2,
}
View Source
var MultisigState_name = map[int32]string{
	0: "MULTISIG_STATE_UNSPECIFIED",
	1: "MULTISIG_STATE_PENDING",
	2: "MULTISIG_STATE_COMPLETED",
}
View Source
var MultisigState_value = map[string]int32{
	"MULTISIG_STATE_UNSPECIFIED": 0,
	"MULTISIG_STATE_PENDING":     1,
	"MULTISIG_STATE_COMPLETED":   2,
}

Functions

This section is empty.

Types

type Hash

type Hash []byte

Hash is an alias for a 32-byte hash

func (Hash) ValidateBasic

func (h Hash) ValidateBasic() error

ValidateBasic returns an error if the hash is not a valid

type Key

type Key interface {
	GetParticipants() []sdk.ValAddress
	GetPubKey(sdk.ValAddress) (PublicKey, bool)
	GetWeight(sdk.ValAddress) sdk.Uint
	GetMinPassingWeight() sdk.Uint
	GetState() KeyState
	GetHeight() int64
	GetTimestamp() time.Time
	GetBondedWeight() sdk.Uint
	GetSnapshot() exported.Snapshot
}

Key provides an interface to work with the key

type KeyID

type KeyID string

KeyID ensures a correctly formatted key ID

func (KeyID) String

func (id KeyID) String() string

func (KeyID) ValidateBasic

func (id KeyID) ValidateBasic() error

ValidateBasic returns an error if the given key ID is invalid; nil otherwise

type KeyState

type KeyState int32
const (
	Inactive KeyState = 0
	Assigned KeyState = 1
	Active   KeyState = 2
)

func (KeyState) EnumDescriptor

func (KeyState) EnumDescriptor() ([]byte, []int)

func (KeyState) String

func (x KeyState) String() string

type MultiSig

type MultiSig interface {
	GetSignature(p sdk.ValAddress) (ec.Signature, bool)
	GetPayloadHash() Hash
	GetKeyID() KeyID
	ValidateBasic() error
}

MultiSig provides an interface to work with the multi sig

type MultisigState

type MultisigState int32
const (
	NonExistent MultisigState = 0
	Pending     MultisigState = 1
	Completed   MultisigState = 2
)

func (MultisigState) EnumDescriptor

func (MultisigState) EnumDescriptor() ([]byte, []int)

func (MultisigState) String

func (x MultisigState) String() string

type PublicKey

type PublicKey []byte

PublicKey is an alias for compressed public key in raw bytes

func (PublicKey) String

func (pk PublicKey) String() string

String returns the hex encoding of the given public key

func (PublicKey) ToECDSAPubKey

func (pk PublicKey) ToECDSAPubKey() ecdsa.PublicKey

ToECDSAPubKey returns the ECDSA public key

func (PublicKey) ValidateBasic

func (pk PublicKey) ValidateBasic() error

ValidateBasic returns an error if the given public key is invalid; nil otherwise

type SigHandler

type SigHandler interface {
	HandleCompleted(ctx sdk.Context, sig utils.ValidatedProtoMarshaler, moduleMetadata codec.ProtoMarshaler) error
	HandleFailed(ctx sdk.Context, moduleMetadata codec.ProtoMarshaler) error
}

SigHandler defines the interface for the requesting module to implement in order to handle the different results of signing session

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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