aura

package
v0.0.2-rc-2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConsensusLogAuthoritiesChange sc.I8 = iota
	ConsensusLogOnDisabled
)

Variables

View Source
var (
	EngineId  = [4]byte{'a', 'u', 'r', 'a'}
	KeyTypeId = [4]byte{'a', 'u', 'r', 'a'}
)

Functions

This section is empty.

Types

type AuraModule

type AuraModule interface {
	primitives.Module

	KeyType() primitives.PublicKeyType
	KeyTypeId() [4]byte
	OnTimestampSet(now sc.U64) error
	SlotDuration() sc.U64
	FindAuthor(digests sc.Sequence[primitives.DigestPreRuntime]) (sc.Option[sc.U32], error)
	StorageAuthorities() (sc.Sequence[primitives.Sr25519PublicKey], error)
	StorageAuthoritiesBytes() (sc.Option[sc.Sequence[sc.U8]], error)
	StorageCurrentSlot() (sc.U64, error)
}

type Config

type Config struct {
	KeyType                    primitives.PublicKeyType
	DbWeight                   primitives.RuntimeDbWeight
	MinimumPeriod              sc.U64
	MaxAuthorities             sc.U32
	AllowMultipleBlocksPerSlot bool
	SystemDigest               func() (primitives.Digest, error)
	LogDepositor               system.LogDepositor
	DisabledValidators         primitives.DisabledValidators
}

func NewConfig

func NewConfig(keyType primitives.PublicKeyType, dbWeight primitives.RuntimeDbWeight, minimumPeriod sc.U64, maxAuthorities sc.U32, allowMultipleBlocksPerSlot bool, systemDigest func() (primitives.Digest, error), logDepositor system.LogDepositor, disabledValidators primitives.DisabledValidators) *Config

type ConsensusLog

type ConsensusLog struct {
	sc.VaryingData
}

func NewConsensusLogAuthoritiesChange

func NewConsensusLogAuthoritiesChange(authorities sc.Sequence[types.Sr25519PublicKey]) ConsensusLog

func NewConsensusLogOnDisabled

func NewConsensusLogOnDisabled(authorityIndex sc.U32) ConsensusLog

type GenesisConfig

type GenesisConfig struct {
	Authorities sc.Sequence[types.Sr25519PublicKey]
}

func (*GenesisConfig) UnmarshalJSON

func (gc *GenesisConfig) UnmarshalJSON(data []byte) error

type Module

type Module struct {
	primitives.DefaultInherentProvider
	hooks.DefaultDispatchModule
	// contains filtered or unexported fields
}

func New

func New(index sc.U8, config *Config, mdGenerator *primitives.MetadataTypeGenerator, logger log.Logger) Module

func (Module) BuildConfig

func (m Module) BuildConfig(config []byte) error

func (Module) CreateDefaultConfig

func (m Module) CreateDefaultConfig() ([]byte, error)

func (Module) DecodeKey

func (m Module) DecodeKey(buffer *bytes.Buffer) (primitives.Sr25519PublicKey, error)

func (Module) FindAuthor

func (m Module) FindAuthor(digests sc.Sequence[primitives.DigestPreRuntime]) (sc.Option[sc.U32], error)

FindAuthor finds the author from the pre-runtime digests.

func (Module) Functions

func (m Module) Functions() map[sc.U8]primitives.Call

func (Module) GetIndex

func (m Module) GetIndex() sc.U8

func (Module) KeyType

func (m Module) KeyType() primitives.PublicKeyType

func (Module) KeyTypeId

func (m Module) KeyTypeId() [4]byte

func (Module) Metadata

func (m Module) Metadata() primitives.MetadataModule

func (Module) OnBeforeSessionEnding

func (m Module) OnBeforeSessionEnding()

func (Module) OnDisabled

func (m Module) OnDisabled(validatorIndex sc.U32)

func (Module) OnGenesisSession

func (m Module) OnGenesisSession(validators sc.Sequence[primitives.Validator]) error

func (Module) OnInitialize

func (m Module) OnInitialize(_ sc.U64) (primitives.Weight, error)

func (Module) OnNewSession

func (m Module) OnNewSession(isChanged bool, validators sc.Sequence[primitives.Validator], _ sc.Sequence[primitives.Validator]) error

func (Module) OnTimestampSet

func (m Module) OnTimestampSet(now sc.U64) error

func (Module) PreDispatch

func (m Module) PreDispatch(_ primitives.Call) (sc.Empty, error)

func (Module) SlotDuration

func (m Module) SlotDuration() sc.U64

func (Module) StorageAuthorities

func (m Module) StorageAuthorities() (sc.Sequence[primitives.Sr25519PublicKey], error)

func (Module) StorageAuthoritiesBytes

func (m Module) StorageAuthoritiesBytes() (sc.Option[sc.Sequence[sc.U8]], error)

func (Module) StorageCurrentSlot

func (m Module) StorageCurrentSlot() (sc.U64, error)

Jump to

Keyboard shortcuts

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