Documentation ¶
Index ¶
- Constants
- Variables
- func AttachInput(output [sr25519VRFOutputLength]byte, pub *PubKey, t *merlin.Transcript) (vrfInOut *sr25519.VrfInOut, err error)
- func AuthoritiesFrom(validators sc.Sequence[Validator]) sc.Sequence[Authority]
- func BuildMetadataTypesIdsMap() map[string]int
- func DecodeAuthorityList(buffer *bytes.Buffer) (sc.Sequence[Authority], error)
- func DecodeSequenceAccountId(buffer *bytes.Buffer) (sc.Sequence[AccountId], error)
- func DecodeSequenceSr25519PublicKey(buffer *bytes.Buffer) (sc.Sequence[Sr25519PublicKey], error)
- func EraTypeDefinition() sc.Sequence[MetadataDefinitionVariant]
- func NewTransactionValidityError(value sc.Encodable) error
- type AccountData
- type AccountId
- type AccountIndex
- type AccountInfo
- type AccountRaw
- type AdditionalSigned
- type Address20
- type Address32
- type ApiItem
- type ApiModule
- type ApplyExtrinsicResult
- type ArithmeticError
- type Authority
- type Balance
- type Blake2bHash
- type Block
- type BlockHashCount
- type BlockLength
- type BlockWeights
- type Call
- type Callable
- type CheckInherentsResult
- type CheckedExtrinsic
- type ConsumedWeight
- func (cw *ConsumedWeight) Accrue(weight Weight, class DispatchClass) error
- func (cw ConsumedWeight) Bytes() []byte
- func (cw *ConsumedWeight) CheckedAccrue(weight Weight, class DispatchClass) error
- func (cw ConsumedWeight) Encode(buffer *bytes.Buffer) error
- func (cw *ConsumedWeight) Get(class DispatchClass) (*Weight, error)
- func (cw *ConsumedWeight) Reduce(weight Weight, class DispatchClass) error
- func (cw *ConsumedWeight) SaturatingAdd(weight Weight, class DispatchClass) error
- func (cw ConsumedWeight) Total() (Weight, error)
- type CurrencyAdapter
- type CustomMetadata
- type CustomModuleError
- type CustomValueMetadata
- type DecRefStatus
- type DefaultInherentProvider
- func (dp DefaultInherentProvider) CheckInherent(call Call, data InherentData) error
- func (dp DefaultInherentProvider) CreateInherent(inherent InherentData) (sc.Option[Call], error)
- func (dp DefaultInherentProvider) InherentIdentifier() [8]byte
- func (dp DefaultInherentProvider) IsInherent(call Call) bool
- type Describer
- type Digest
- type DigestItem
- func DecodeDigestItem(buffer *bytes.Buffer) (DigestItem, error)
- func NewDigestItemConsensusMessage(consensusEngineId sc.FixedSequence[sc.U8], message sc.Sequence[sc.U8]) DigestItem
- func NewDigestItemOther(message sc.Sequence[sc.U8]) DigestItem
- func NewDigestItemPreRuntime(consensusEngineId sc.FixedSequence[sc.U8], message sc.Sequence[sc.U8]) DigestItem
- func NewDigestItemRuntimeEnvironmentUpgrade() DigestItem
- func NewDigestItemSeal(consensusEngineId sc.FixedSequence[sc.U8], message sc.Sequence[sc.U8]) DigestItem
- type DigestPreRuntime
- type DigestSeal
- type DisabledValidators
- type DispatchClass
- type DispatchClassType
- type DispatchError
- func DecodeDispatchError(buffer *bytes.Buffer) (DispatchError, error)
- func NewDispatchErrorArithmetic(arithmeticError ArithmeticError) DispatchError
- func NewDispatchErrorBadOrigin() DispatchError
- func NewDispatchErrorCannotLookup() DispatchError
- func NewDispatchErrorConsumerRemaining() DispatchError
- func NewDispatchErrorCorruption() DispatchError
- func NewDispatchErrorExhausted() DispatchError
- func NewDispatchErrorModule(customModuleError CustomModuleError) DispatchError
- func NewDispatchErrorNoProviders() DispatchError
- func NewDispatchErrorOther(str sc.Str) DispatchError
- func NewDispatchErrorToken(tokenError TokenError) DispatchError
- func NewDispatchErrorTooManyConsumers() DispatchError
- func NewDispatchErrorTransactional(transactionalError TransactionalError) DispatchError
- func NewDispatchErrorUnavailable() DispatchError
- type DispatchInfo
- type DispatchModule
- type DispatchOutcome
- type EcdsaPublicKey
- type EcdsaVerifyError
- type Ed25519PublicKey
- type Era
- type Event
- type EventDepositor
- type EventRecord
- type ExistenceRequirement
- type ExistentialDeposit
- type ExtraFlags
- type ExtrinsicPhase
- type ExtrinsicSignature
- type FatalError
- type FindAuthor
- type H256
- type H512
- type Header
- type IdentityFee
- type IncRefStatus
- type InherentData
- type InherentError
- func NewInherentErrorApplication(error sc.Str) InherentError
- func NewInherentErrorDecodingFailed(error sc.Str, inherentIdentifier sc.FixedSequence[sc.U8]) InherentError
- func NewInherentErrorFatalErrorReported() InherentError
- func NewInherentErrorInherentDataExists(inherentIdentifier sc.FixedSequence[sc.U8]) InherentError
- type InherentProvider
- type InvalidTransaction
- func DecodeInvalidTransaction(buffer *bytes.Buffer) (InvalidTransaction, error)
- func NewInvalidTransactionAncientBirthBlock() InvalidTransaction
- func NewInvalidTransactionBadMandatory() InvalidTransaction
- func NewInvalidTransactionBadProof() InvalidTransaction
- func NewInvalidTransactionBadSigner() InvalidTransaction
- func NewInvalidTransactionCall() InvalidTransaction
- func NewInvalidTransactionCustom(customError sc.U8) InvalidTransaction
- func NewInvalidTransactionExhaustsResources() InvalidTransaction
- func NewInvalidTransactionFuture() InvalidTransaction
- func NewInvalidTransactionMandatoryValidation() InvalidTransaction
- func NewInvalidTransactionPayment() InvalidTransaction
- func NewInvalidTransactionStale() InvalidTransaction
- type LastRuntimeUpgradeInfo
- type MaxLocks
- type MaxReserves
- type Metadata
- type Metadata14
- type Metadata15
- type MetadataDefinitionPrimitive
- type MetadataDefinitionVariant
- func DecodeMetadataTypeDefinitionVariant(buffer *bytes.Buffer) (MetadataDefinitionVariant, error)
- func NewMetadataDefinitionVariant(name string, fields sc.Sequence[MetadataTypeDefinitionField], index sc.U8, ...) MetadataDefinitionVariant
- func NewMetadataDefinitionVariantStr(name sc.Str, fields sc.Sequence[MetadataTypeDefinitionField], index sc.U8, ...) MetadataDefinitionVariant
- type MetadataExtrinsicV14
- type MetadataExtrinsicV15
- type MetadataModule
- type MetadataModuleConstant
- type MetadataModuleStorage
- type MetadataModuleStorageEntry
- type MetadataModuleStorageEntryDefinition
- func DecodeMetadataModuleStorageEntryDefinition(buffer *bytes.Buffer) (MetadataModuleStorageEntryDefinition, error)
- func NewMetadataModuleStorageEntryDefinitionMap(storageHashFuncs sc.Sequence[MetadataModuleStorageHashFunc], ...) MetadataModuleStorageEntryDefinition
- func NewMetadataModuleStorageEntryDefinitionPlain(key sc.Compact) MetadataModuleStorageEntryDefinition
- type MetadataModuleStorageEntryModifier
- type MetadataModuleStorageHashFunc
- type MetadataModuleV14
- type MetadataModuleV15
- type MetadataSignedExtension
- type MetadataType
- func DecodeMetadataType(buffer *bytes.Buffer) (MetadataType, error)
- func NewMetadataType(id int, docs string, definition MetadataTypeDefinition) MetadataType
- func NewMetadataTypeWithParam(id int, docs string, path sc.Sequence[sc.Str], ...) MetadataType
- func NewMetadataTypeWithParams(id int, docs string, path sc.Sequence[sc.Str], ...) MetadataType
- func NewMetadataTypeWithPath(id int, docs string, path sc.Sequence[sc.Str], ...) MetadataType
- type MetadataTypeDefinition
- func DecodeMetadataTypeDefinition(buffer *bytes.Buffer) (MetadataTypeDefinition, error)
- func NewMetadataTypeDefinitionBitSequence(storeOrder, orderType sc.Compact) MetadataTypeDefinition
- func NewMetadataTypeDefinitionCompact(compact sc.Compact) MetadataTypeDefinition
- func NewMetadataTypeDefinitionComposite(fields sc.Sequence[MetadataTypeDefinitionField]) MetadataTypeDefinition
- func NewMetadataTypeDefinitionFixedSequence(length sc.U32, typeId sc.Compact) MetadataTypeDefinition
- func NewMetadataTypeDefinitionPrimitive(primitive MetadataDefinitionPrimitive) MetadataTypeDefinition
- func NewMetadataTypeDefinitionSequence(compact sc.Compact) MetadataTypeDefinition
- func NewMetadataTypeDefinitionTuple(compacts sc.Sequence[sc.Compact]) MetadataTypeDefinition
- func NewMetadataTypeDefinitionVariant(variants sc.Sequence[MetadataDefinitionVariant]) MetadataTypeDefinition
- type MetadataTypeDefinitionField
- func DecodeMetadataTypeDefinitionField(buffer *bytes.Buffer) (MetadataTypeDefinitionField, error)
- func NewMetadataTypeDefinitionField(id int) MetadataTypeDefinitionField
- func NewMetadataTypeDefinitionFieldWithName(id int, idName sc.Str) MetadataTypeDefinitionField
- func NewMetadataTypeDefinitionFieldWithNames(id int, name sc.Str, idName sc.Str) MetadataTypeDefinitionField
- type MetadataTypeGenerator
- func (g *MetadataTypeGenerator) AppendMetadataTypes(types sc.Sequence[MetadataType])
- func (g *MetadataTypeGenerator) BuildCallsMetadata(moduleName string, moduleFunctions map[sc.U8]Call, ...) int
- func (g *MetadataTypeGenerator) BuildErrorsMetadata(moduleName string, definition *MetadataTypeDefinition) int
- func (g *MetadataTypeGenerator) BuildExtraMetadata(extraValue reflect.Value, extensions *sc.Sequence[MetadataSignedExtension]) int
- func (g *MetadataTypeGenerator) BuildMetadataTypeRecursively(v reflect.Value, path *sc.Sequence[sc.Str], def *MetadataTypeDefinition, ...) int
- func (g *MetadataTypeGenerator) BuildModuleConstants(config reflect.Value) sc.Sequence[MetadataModuleConstant]
- func (g *MetadataTypeGenerator) ClearMetadata()
- func (g *MetadataTypeGenerator) GetId(typeName string) (int, bool)
- func (g *MetadataTypeGenerator) GetIdsMap() map[string]int
- func (g *MetadataTypeGenerator) GetLastAvailableIndex() int
- func (g *MetadataTypeGenerator) GetMetadataTypes() sc.Sequence[MetadataType]
- type MetadataTypeParameter
- func DecodeMetadataTypeParameter(buffer *bytes.Buffer) (MetadataTypeParameter, error)
- func NewMetadataEmptyTypeParameter(text string) MetadataTypeParameter
- func NewMetadataTypeParameter(id int, text string) MetadataTypeParameter
- func NewMetadataTypeParameterCompactId(id sc.Compact, text string) MetadataTypeParameter
- type Module
- type MultiAddress
- func DecodeMultiAddress(buffer *bytes.Buffer) (MultiAddress, error)
- func NewMultiAddress20(address Address20) MultiAddress
- func NewMultiAddress32(address Address32) MultiAddress
- func NewMultiAddressId(id AccountId) MultiAddress
- func NewMultiAddressIndex(index AccountIndex) MultiAddress
- func NewMultiAddressRaw(accountRaw AccountRaw) MultiAddress
- func (a MultiAddress) AsAccountId() (AccountId, error)
- func (a MultiAddress) AsAccountIndex() (AccountIndex, error)
- func (a MultiAddress) AsAddress20() (Address20, error)
- func (a MultiAddress) AsAddress32() (Address32, error)
- func (a MultiAddress) AsRaw() (AccountRaw, error)
- func (a MultiAddress) IsAccountId() bool
- func (a MultiAddress) IsAccountIndex() bool
- func (a MultiAddress) IsAddress20() bool
- func (a MultiAddress) IsAddress32() bool
- func (a MultiAddress) IsRaw() bool
- type MultiSignature
- func (s MultiSignature) AsEcdsa() (SignatureEcdsa, error)
- func (s MultiSignature) AsEd25519() (SignatureEd25519, error)
- func (s MultiSignature) AsSr25519() (SignatureSr25519, error)
- func (s MultiSignature) IsEcdsa() bool
- func (s MultiSignature) IsEd25519() bool
- func (s MultiSignature) IsSr25519() bool
- type OnInitialize
- type OnRuntimeUpgrade
- type OuterEnums
- type Pays
- type PerDispatchClass
- type PerDispatchClassU32
- type PerDispatchClassWeight
- type PerDispatchClassWeightsPerClass
- type Perbill
- type PostDispatchInfo
- func (pdi PostDispatchInfo) Bytes() []byte
- func (pdi PostDispatchInfo) CalcActualWeight(info *DispatchInfo) Weight
- func (pdi PostDispatchInfo) CalcUnspent(info *DispatchInfo) Weight
- func (pdi PostDispatchInfo) Encode(buffer *bytes.Buffer) error
- func (pdi PostDispatchInfo) Pays(info *DispatchInfo) Pays
- type Pre
- type PubKey
- type PublicKey
- type PublicKeyType
- type RawOrigin
- type Reasons
- type RefCount
- type RuntimeApiMetadata
- type RuntimeApiMethodMetadata
- type RuntimeApiMethodParamMetadata
- type RuntimeApiModule
- type RuntimeDbWeight
- func (dbw RuntimeDbWeight) Bytes() []byte
- func (dbw RuntimeDbWeight) Docs() string
- func (dbw RuntimeDbWeight) Encode(buffer *bytes.Buffer) error
- func (dbw RuntimeDbWeight) Reads(r sc.U64) Weight
- func (dbw RuntimeDbWeight) ReadsWrites(r, w sc.U64) Weight
- func (dbw RuntimeDbWeight) Writes(w sc.U64) Weight
- type RuntimeDispatchInfo
- type RuntimeMetadataV14
- type RuntimeMetadataV15
- type RuntimeOrigin
- type RuntimeVersion
- type Session
- type SessionKey
- type SignatureEcdsa
- type SignatureEd25519
- type SignatureSr25519
- type SignedExtension
- type SignedExtra
- type SignedPayload
- type Sr25519PublicKey
- type StoredMap
- type TimestampError
- type TokenError
- func DecodeTokenError(buffer *bytes.Buffer) (TokenError, error)
- func NewTokenErrorBelowMinimum() TokenError
- func NewTokenErrorBlocked() TokenError
- func NewTokenErrorCannotCreate() TokenError
- func NewTokenErrorCannotCreateHold() TokenError
- func NewTokenErrorFrozen() TokenError
- func NewTokenErrorFundsUnavailable() TokenError
- func NewTokenErrorNotExpendable() TokenError
- func NewTokenErrorOnlyProvider() TokenError
- func NewTokenErrorUnknownAsset() TokenError
- func NewTokenErrorUnsupported() TokenError
- type TransactionLongevity
- type TransactionOutcome
- type TransactionPriority
- type TransactionSource
- type TransactionTag
- type TransactionValidityError
- type TransactionValidityResult
- func (r TransactionValidityResult) AsValidTransaction() (ValidTransaction, error)
- func (r TransactionValidityResult) Bytes() []byte
- func (r TransactionValidityResult) Encode(buffer *bytes.Buffer) error
- func (r TransactionValidityResult) IsValidTransaction() bool
- func (r TransactionValidityResult) MetadataDefinition(typesValidTransactionId int, typesValidityErrorId int) *MetadataTypeDefinition
- type TransactionalError
- type Tuple2U64
- type UncheckedExtrinsic
- type UnknownTransaction
- type UnsignedValidator
- type ValidTransaction
- type Validator
- type VrfSignature
- type Weight
- func (w Weight) Add(rhs Weight) Weight
- func (w Weight) AllGt(rhs Weight) bool
- func (w Weight) AnyGt(otherW Weight) bool
- func (w Weight) Bytes() []byte
- func (w Weight) CheckedAdd(rhs Weight) sc.Option[Weight]
- func (w Weight) Encode(buffer *bytes.Buffer) error
- func (w Weight) Max(rhs Weight) Weight
- func (w Weight) Min(rhs Weight) Weight
- func (w Weight) Mul(b sc.U64) Weight
- func (w *Weight) SaturatingAccrue(amount Weight)
- func (w Weight) SaturatingAdd(rhs Weight) Weight
- func (w Weight) SaturatingMul(b sc.U64) Weight
- func (w *Weight) SaturatingReduce(amount Weight)
- func (w Weight) SaturatingSub(rhs Weight) Weight
- func (w Weight) Sub(rhs Weight) Weight
- type WeightToFee
- type WeightsPerClass
Constants ¶
const ( ArithmeticErrorUnderflow sc.U8 = iota ArithmeticErrorOverflow ArithmeticErrorDivisionByZero )
const ( InherentErrorInherentDataExists sc.U8 = iota InherentErrorDecodingFailed InherentErrorFatalErrorReported InherentErrorApplication )
const ( DigestItemOther sc.U8 = 0 DigestItemConsensusMessage sc.U8 = 4 DigestItemSeal sc.U8 = 5 DigestItemPreRuntime sc.U8 = 6 DigestItemRuntimeEnvironmentUpgraded sc.U8 = 8 )
const ( DispatchErrorOther sc.U8 = iota DispatchErrorCannotLookup DispatchErrorBadOrigin DispatchErrorModule DispatchErrorConsumerRemaining DispatchErrorNoProviders DispatchErrorTooManyConsumers DispatchErrorToken DispatchErrorArithmetic DispatchErrorTransactional DispatchErrorExhausted DispatchErrorCorruption )
const ( EcdsaVerifyErrorBadRS sc.U8 = iota EcdsaVerifyErrorBadV EcdsaVerifyErrorBadSignature )
const ( // PhaseApplyExtrinsic Applying an extrinsic. PhaseApplyExtrinsic sc.U8 = iota // PhaseFinalization Finalizing the block. PhaseFinalization // PhaseInitialization Initializing the block. PhaseInitialization )
const ( // The call of the transaction is not expected. Reject InvalidTransactionCall sc.U8 = iota // General error to do with the inability to pay some fees (e.g. account balance too low). Reject InvalidTransactionPayment // General error to do with the transaction not yet being valid (e.g. nonce too high). Don't Reject InvalidTransactionFuture // General error to do with the transaction being outdated (e.g. nonce too low). Reject InvalidTransactionStale // General error to do with the transaction's proofs (e.g. signature). Reject // // # Possible causes // // When using a signed extension that provides additional data for signing, it is required // that the signing and the verifying side use the same additional data. Additional // data will only be used to generate the signature, but will not be part of the transaction // itself. As the verifying side does not know which additional data was used while signing // it will only be able to assume a bad signature and cannot express a more meaningful error. InvalidTransactionBadProof // The transaction birth block is ancient. Reject // // # Possible causes // // For `FRAME`-based runtimes this would be caused by `current block number // - Era::birth block number > BlockHashCount`. (e.g. in Polkadot `BlockHashCount` = 2400, so // a // transaction with birth block number 1337 would be valid up until block number 1337 + 2400, // after which point the transaction would be considered to have an ancient birth block.) InvalidTransactionAncientBirthBlock // The transaction would exhaust the resources of the current block. Don't Reject // // The transaction might be valid, but there are not enough resources // left in the current block. InvalidTransactionExhaustsResources // Any other custom invalid validity that is not covered by this enum. Reject InvalidTransactionCustom // + sc.U8 // An extrinsic with mandatory dispatch resulted in an error. Reject // This is indicative of either a malicious validator or a buggy `provide_inherent`. // In any case, it can result in dangerously overweight blocks and therefore if // found, invalidates the block. InvalidTransactionBadMandatory // An extrinsic with a mandatory dispatch tried to be validated. // This is invalid; only inherent extrinsics are allowed to have mandatory dispatches. InvalidTransactionMandatoryValidation // The sending address is disabled or known to be invalid. InvalidTransactionBadSigner )
const ( MetadataReserved sc.U32 = 0x6174656d // "meta" MetadataVersion14 sc.U8 = 14 MetadataVersion15 sc.U8 = 15 )
const ( ModuleVersion14 sc.U8 = 14 ModuleVersion15 sc.U8 = 15 )
const ( MetadataModuleStorageEntryDefinitionPlain sc.U8 = iota MetadataModuleStorageEntryDefinitionMap )
const ( MetadataTypeDefinitionComposite sc.U8 = iota MetadataTypeDefinitionVariant MetadataTypeDefinitionSequence MetadataTypeDefinitionFixedSequence MetadataTypeDefinitionTuple MetadataTypeDefinitionPrimitive MetadataTypeDefinitionCompact MetadataTypeDefinitionBitSequence )
const ( MultiAddressId sc.U8 = iota MultiAddressIndex MultiAddressRaw MultiAddress32 MultiAddress20 )
const ( MultiSignatureEd25519 sc.U8 = iota MultiSignatureSr25519 MultiSignatureEcdsa )
const ( RawOriginRoot sc.U8 = iota RawOriginSigned RawOriginNone )
const ( TimestampErrorTooEarly sc.U8 = iota TimestampErrorTooFarInFuture TimestampErrorInvalid )
const ( TokenErrorOnlyProvider TokenErrorBelowMinimum TokenErrorCannotCreate TokenErrorUnknownAsset TokenErrorFrozen TokenErrorUnsupported TokenErrorCannotCreateHold TokenErrorNotExpendable TokenErrorBlocked )
const ( // Commit the transaction. TransactionOutcomeCommit sc.U8 = iota // Rollback the transaction. TransactionOutcomeRollback )
const ( // Transaction is already included in block. // // This means that we can't really tell where the transaction is coming from, // since it's already in the received block. Note that the custom validation logic // using either `Local` or `External` should most likely just allow `InBlock` // transactions as well. TransactionSourceInBlock sc.U8 = iota // Transaction is coming from a local source. // // This means that the transaction was produced internally by the node // (for instance an Off-Chain Worker, or an Off-Chain Call), as opposed // to being received over the network. TransactionSourceLocal // Transaction has been received externally. // // This means the transaction has been received from (usually) "untrusted" source, // for instance received over the network or RPC. TransactionSourceExternal )
The source of the transaction.
Depending on the source we might apply different validation schemes. For instance, we can disallow specific kinds of transactions if they were not produced by our local node (for instance off-chain workers).
const ( TransactionValidityErrorInvalidTransaction sc.U8 = iota TransactionValidityErrorUnknownTransaction )
const ( TransactionValidityResultValid sc.U8 = iota TransactionValidityResultError )
const ( // Too many transactional layers have been spawned. TransactionalErrorLimitReached sc.U8 = iota // A transactional layer was expected, but does not exist. TransactionalErrorNoLayer )
const ( // Could not lookup some information that is required to validate the transaction. Reject UnknownTransactionCannotLookup sc.U8 = iota // No validator found for the given unsigned transaction. Reject UnknownTransactionNoUnsignedValidator // Any other custom unknown validity that is not covered by this type. Reject UnknownTransactionCustomUnknownTransaction // + sc.U8 )
const ( WithdrawReasonsTransactionPayment = iota WithdrawReasonsTransfer WithdrawReasonsReserve WithdrawReasonsFee WithdrawReasonsTip )
Variables ¶
var (
FlagsNewLogic, _ = new(big.Int).SetString("80000000000000000000000000000000", 16)
DefaultExtraFlags = ExtraFlags{sc.NewU128(FlagsNewLogic)}
)
Functions ¶
func AttachInput ¶
func AuthoritiesFrom ¶
func DecodeAuthorityList ¶
func DecodeSequenceAccountId ¶
func EraTypeDefinition ¶
func EraTypeDefinition() sc.Sequence[MetadataDefinitionVariant]
Types ¶
type AccountData ¶
type AccountData struct { Free Balance Reserved Balance Frozen Balance Flags ExtraFlags }
func DecodeAccountData ¶
func DecodeAccountData(buffer *bytes.Buffer) (AccountData, error)
func DefaultAccountData ¶
func DefaultAccountData() AccountData
func (AccountData) Bytes ¶
func (ad AccountData) Bytes() []byte
func (AccountData) Total ¶
func (ad AccountData) Total() sc.U128
type AccountId ¶
type AccountId Address32
func Lookup ¶
func Lookup(a MultiAddress) (AccountId, error)
type AccountInfo ¶
type AccountInfo struct { Nonce AccountIndex Consumers RefCount Providers RefCount Sufficients RefCount Data AccountData }
func DecodeAccountInfo ¶
func DecodeAccountInfo(buffer *bytes.Buffer) (AccountInfo, error)
func DefaultAccountInfo ¶
func DefaultAccountInfo() AccountInfo
func (AccountInfo) Bytes ¶
func (ai AccountInfo) Bytes() []byte
type AccountRaw ¶
AccountRaw It's some arbitrary raw bytes.
func DecodeAccountRaw ¶
func DecodeAccountRaw(buffer *bytes.Buffer) (AccountRaw, error)
type AdditionalSigned ¶
type AdditionalSigned = sc.VaryingData
type Address20 ¶
type Address20 struct { sc.FixedSequence[sc.U8] // size 20 }
Address20 It's a 20 byte representation.
type Address32 ¶
type Address32 struct { sc.FixedSequence[sc.U8] // size 32 }
Address32 It's a 32 byte representation.
type ApplyExtrinsicResult ¶
type ApplyExtrinsicResult sc.VaryingData // = sc.Result[DispatchOutcome, TransactionValidityError]
ApplyExtrinsicResult The result of applying of an extrinsic.
This type is typically used in the context of `BlockBuilder` to signal that the extrinsic in question cannot be included.
A block containing extrinsics that have a negative inclusion outcome is invalid. A negative result can only occur during the block production, where such extrinsics are detected and removed from the block that is being created and the transaction pool.
To rehash: every extrinsic in a valid block must return a positive `ApplyExtrinsicResult`.
Examples of reasons preventing inclusion in a block:
- More block weight is required to process the extrinsic than is left in the block being built. This doesn't necessarily mean that the extrinsic is invalid, since it can still be included in the next block if it has enough spare weight available.
- The sender doesn't have enough funds to pay the transaction inclusion fee. Including such a transaction in the block doesn't make sense.
- The extrinsic supplied a bad signature. This transaction won't become valid ever.
func DecodeApplyExtrinsicResult ¶
func DecodeApplyExtrinsicResult(buffer *bytes.Buffer) (ApplyExtrinsicResult, error)
func NewApplyExtrinsicResult ¶
func NewApplyExtrinsicResult(value sc.Encodable) (ApplyExtrinsicResult, error)
func (ApplyExtrinsicResult) Bytes ¶
func (r ApplyExtrinsicResult) Bytes() []byte
type ArithmeticError ¶
type ArithmeticError sc.VaryingData
func DecodeArithmeticError ¶
func DecodeArithmeticError(buffer *bytes.Buffer) (ArithmeticError, error)
func NewArithmeticErrorDivisionByZero ¶
func NewArithmeticErrorDivisionByZero() ArithmeticError
func NewArithmeticErrorOverflow ¶
func NewArithmeticErrorOverflow() ArithmeticError
func NewArithmeticErrorUnderflow ¶
func NewArithmeticErrorUnderflow() ArithmeticError
func (ArithmeticError) Bytes ¶
func (err ArithmeticError) Bytes() []byte
func (ArithmeticError) Error ¶
func (err ArithmeticError) Error() string
type Blake2bHash ¶
type Blake2bHash struct { sc.FixedSequence[sc.U8] // size 32 }
func Blake2bHash69 ¶
func Blake2bHash69() Blake2bHash
func DecodeBlake2bHash ¶
func DecodeBlake2bHash(buffer *bytes.Buffer) (Blake2bHash, error)
func NewBlake2bHash ¶
func NewBlake2bHash(values ...sc.U8) (Blake2bHash, error)
func (Blake2bHash) Bytes ¶
func (h Blake2bHash) Bytes() []byte
type BlockHashCount ¶
func (BlockHashCount) Docs ¶
func (rv BlockHashCount) Docs() string
type BlockLength ¶
type BlockLength struct { // Maximal total length in bytes for each extrinsic class. // // In the worst case, the total block length is going to be: // `MAX(max)` Max PerDispatchClassU32 }
func (BlockLength) Bytes ¶
func (bl BlockLength) Bytes() []byte
func (BlockLength) Docs ¶
func (bl BlockLength) Docs() string
type BlockWeights ¶
type BlockWeights struct { // Base weight of block execution. BaseBlock Weight // Maximal total weight consumed by all kinds of extrinsics (without `reserved` space). MaxBlock Weight // Weight limits for extrinsics of given dispatch class. PerClass PerDispatchClassWeightsPerClass }
func (BlockWeights) Bytes ¶
func (bw BlockWeights) Bytes() []byte
func (BlockWeights) Docs ¶
func (bw BlockWeights) Docs() string
func (BlockWeights) Get ¶
func (bw BlockWeights) Get(class DispatchClass) (*WeightsPerClass, error)
Get per-class weight settings.
type Call ¶
type Call interface { sc.Encodable ModuleIndex() sc.U8 FunctionIndex() sc.U8 Args() sc.VaryingData Dispatch(origin RuntimeOrigin, args sc.VaryingData) (PostDispatchInfo, error) BaseWeight() Weight ClassifyDispatch(baseWeight Weight) DispatchClass PaysFee(baseWeight Weight) Pays WeighData(baseWeight Weight) Weight DecodeArgs(buffer *bytes.Buffer) (Call, error) Docs() string }
type Callable ¶
func (Callable) Args ¶
func (c Callable) Args() sc.VaryingData
func (Callable) FunctionIndex ¶
func (Callable) ModuleIndex ¶
type CheckInherentsResult ¶
type CheckInherentsResult struct { Okay sc.Bool FatalError sc.Bool Errors InherentData }
func DecodeCheckInherentsResult ¶
func DecodeCheckInherentsResult(buffer *bytes.Buffer) (CheckInherentsResult, error)
func NewCheckInherentsResult ¶
func NewCheckInherentsResult() CheckInherentsResult
func (CheckInherentsResult) Bytes ¶
func (cir CheckInherentsResult) Bytes() []byte
func (CheckInherentsResult) Encode ¶
func (cir CheckInherentsResult) Encode(buffer *bytes.Buffer) error
func (*CheckInherentsResult) PutError ¶
func (cir *CheckInherentsResult) PutError(inherentIdentifier [8]byte, fatalError FatalError) error
type CheckedExtrinsic ¶
type CheckedExtrinsic interface { Apply(validator UnsignedValidator, info *DispatchInfo, length sc.Compact) (PostDispatchInfo, error) Function() Call Validate(validator UnsignedValidator, source TransactionSource, info *DispatchInfo, length sc.Compact) (ValidTransaction, error) }
type ConsumedWeight ¶
type ConsumedWeight PerDispatchClassWeight
An object to track the currently used extrinsic weight in a block.
func DecodeConsumedWeight ¶
func DecodeConsumedWeight(buffer *bytes.Buffer) (ConsumedWeight, error)
func (*ConsumedWeight) Accrue ¶
func (cw *ConsumedWeight) Accrue(weight Weight, class DispatchClass) error
Accrue Increase the weight of the given class. Saturates at the numeric bounds.
func (ConsumedWeight) Bytes ¶
func (cw ConsumedWeight) Bytes() []byte
func (*ConsumedWeight) CheckedAccrue ¶
func (cw *ConsumedWeight) CheckedAccrue(weight Weight, class DispatchClass) error
CheckedAccrue Try to increase the weight of the given class. Saturates at the numeric bounds.
func (*ConsumedWeight) Get ¶
func (cw *ConsumedWeight) Get(class DispatchClass) (*Weight, error)
Get current value for given class.
func (*ConsumedWeight) Reduce ¶
func (cw *ConsumedWeight) Reduce(weight Weight, class DispatchClass) error
Reduce the weight of the given class. Saturates at the numeric bounds.
func (*ConsumedWeight) SaturatingAdd ¶
func (cw *ConsumedWeight) SaturatingAdd(weight Weight, class DispatchClass) error
SaturatingAdd Increase the weight of the given class. Saturates at the numeric bounds.
func (ConsumedWeight) Total ¶
func (cw ConsumedWeight) Total() (Weight, error)
Returns the total weight consumed by all extrinsics in the block.
Saturates on overflow.
type CurrencyAdapter ¶
type CurrencyAdapter interface { // DepositIntoExisting adds free balance to `who`. // Returns an error if `who` is a new account. // Deposits an event and returns `value`. DepositIntoExisting(who AccountId, value sc.U128) (Balance, error) // Withdraw removes free balance from `who` based on `reasons`. // If `liveness` is ExistenceRequirementKeepAlive, the remaining value must not be less than the existential deposit. // Checks `who` for liquidity restrictions and returns an error if they are not met. // Deposits a withdrawal event and returns `value`. Withdraw(who AccountId, value sc.U128, reasons sc.U8, liveness ExistenceRequirement) (Balance, error) }
CurrencyAdapter provides an abstraction over accounts balances manipulation.
type CustomMetadata ¶
type CustomMetadata struct {
Map sc.Dictionary[sc.Str, CustomValueMetadata]
}
func DecodeCustomMetadata ¶
func DecodeCustomMetadata(buffer *bytes.Buffer) (CustomMetadata, error)
func (CustomMetadata) Bytes ¶
func (cm CustomMetadata) Bytes() []byte
type CustomModuleError ¶
type CustomModuleError struct { Index sc.U8 // Module index matching the metadata module index. Err sc.U32 // Module specific error value. Message sc.Option[sc.Str] // Varying data type Option (Definition 190). The optional value is a SCALE encoded byte array containing a valid UTF-8 sequence. }
CustomModuleError A custom error in a module.
func DecodeCustomModuleError ¶
func DecodeCustomModuleError(buffer *bytes.Buffer) (CustomModuleError, error)
func (CustomModuleError) Bytes ¶
func (err CustomModuleError) Bytes() []byte
func (CustomModuleError) Error ¶
func (err CustomModuleError) Error() string
type CustomValueMetadata ¶
func (CustomValueMetadata) Bytes ¶
func (cvm CustomValueMetadata) Bytes() []byte
type DecRefStatus ¶
const ( DecRefStatusReaped DecRefStatus = iota DecRefStatusExists )
func (DecRefStatus) Bytes ¶
func (drs DecRefStatus) Bytes() []byte
type DefaultInherentProvider ¶
type DefaultInherentProvider struct { }
DefaultProvideInherent is an implementation of ProvideInherent and is used by modules, which do not have an implementation of ProvideInherent.
func NewDefaultProvideInherent ¶
func NewDefaultProvideInherent() DefaultInherentProvider
func (DefaultInherentProvider) CheckInherent ¶
func (dp DefaultInherentProvider) CheckInherent(call Call, data InherentData) error
func (DefaultInherentProvider) CreateInherent ¶
func (dp DefaultInherentProvider) CreateInherent(inherent InherentData) (sc.Option[Call], error)
func (DefaultInherentProvider) InherentIdentifier ¶
func (dp DefaultInherentProvider) InherentIdentifier() [8]byte
func (DefaultInherentProvider) IsInherent ¶
func (dp DefaultInherentProvider) IsInherent(call Call) bool
type Digest ¶
type Digest struct { sc.Sequence[DigestItem] }
func (Digest) OnlyPreRuntimes ¶
OnlyPreRuntimes returns a new Digest, containing only PreRuntime digest items
func (Digest) PreRuntimes ¶
func (d Digest) PreRuntimes() (sc.Sequence[DigestPreRuntime], error)
PreRuntimes returns a sequence of DigestPreRuntime, containing only DigestItemPreRuntime items
type DigestItem ¶
type DigestItem struct {
sc.VaryingData
}
func DecodeDigestItem ¶
func DecodeDigestItem(buffer *bytes.Buffer) (DigestItem, error)
func NewDigestItemConsensusMessage ¶
func NewDigestItemConsensusMessage(consensusEngineId sc.FixedSequence[sc.U8], message sc.Sequence[sc.U8]) DigestItem
func NewDigestItemOther ¶
func NewDigestItemOther(message sc.Sequence[sc.U8]) DigestItem
func NewDigestItemPreRuntime ¶
func NewDigestItemPreRuntime(consensusEngineId sc.FixedSequence[sc.U8], message sc.Sequence[sc.U8]) DigestItem
func NewDigestItemRuntimeEnvironmentUpgrade ¶
func NewDigestItemRuntimeEnvironmentUpgrade() DigestItem
func NewDigestItemSeal ¶
func NewDigestItemSeal(consensusEngineId sc.FixedSequence[sc.U8], message sc.Sequence[sc.U8]) DigestItem
func (DigestItem) AsPreRuntime ¶
func (di DigestItem) AsPreRuntime() (DigestPreRuntime, error)
func (DigestItem) AsSeal ¶
func (di DigestItem) AsSeal() (DigestSeal, error)
TODO: has the same fields as DigestPreRuntime, merge at some point
func (DigestItem) IsPreRuntime ¶
func (di DigestItem) IsPreRuntime() bool
func (DigestItem) IsSeal ¶
func (di DigestItem) IsSeal() bool
type DigestPreRuntime ¶
type DigestPreRuntime struct { ConsensusEngineId sc.FixedSequence[sc.U8] Message sc.Sequence[sc.U8] }
func NewDigestPreRuntime ¶
func NewDigestPreRuntime(consensusEngineId sc.FixedSequence[sc.U8], message sc.Sequence[sc.U8]) DigestPreRuntime
func (DigestPreRuntime) Bytes ¶
func (dpr DigestPreRuntime) Bytes() []byte
type DigestSeal ¶
func NewDigestSeal ¶
func NewDigestSeal(consensusEngineId sc.FixedSequence[sc.U8], message sc.Sequence[sc.U8]) DigestSeal
func (DigestSeal) Bytes ¶
func (ds DigestSeal) Bytes() []byte
type DisabledValidators ¶
type DispatchClass ¶
type DispatchClass struct {
sc.VaryingData
}
A generalized group of dispatch types.
func DecodeDispatchClass ¶
func DecodeDispatchClass(buffer *bytes.Buffer) (DispatchClass, error)
func DispatchClassAll ¶
func DispatchClassAll() []DispatchClass
DispatchClassAll Returns a slice, containing all dispatch classes.
func NewDispatchClassMandatory ¶
func NewDispatchClassMandatory() DispatchClass
func NewDispatchClassNormal ¶
func NewDispatchClassNormal() DispatchClass
func NewDispatchClassOperational ¶
func NewDispatchClassOperational() DispatchClass
func (DispatchClass) Is ¶
func (dc DispatchClass) Is(value DispatchClassType) (sc.Bool, error)
type DispatchClassType ¶
const ( // DispatchClassNormal A normal dispatch. DispatchClassNormal DispatchClassType = iota // DispatchClassOperational An operational dispatch. DispatchClassOperational // DispatchClassMandatory A mandatory dispatch. These kinds of dispatch are always included regardless of their // weight, therefore it is critical that they are separately validated to ensure that a // malicious validator cannot craft a valid but impossibly heavy block. Usually this just // means ensuring that the extrinsic can only be included once and that it is always very // light. // // Do *NOT* use it for extrinsics that can be heavy. // // The only real use case for this is inherent extrinsics that are required to execute in a // block for the block to be valid, and it solves the issue in the case that the block // initialization is sufficiently heavy to mean that those inherents do not fit into the // block. Essentially, we assume that in these exceptional circumstances, it is better to // allow an overweight block to be created than to not allow any block at all to be created. DispatchClassMandatory )
func (DispatchClassType) Bytes ¶
func (dct DispatchClassType) Bytes() []byte
type DispatchError ¶
type DispatchError sc.VaryingData
func DecodeDispatchError ¶
func DecodeDispatchError(buffer *bytes.Buffer) (DispatchError, error)
func NewDispatchErrorArithmetic ¶
func NewDispatchErrorArithmetic(arithmeticError ArithmeticError) DispatchError
func NewDispatchErrorBadOrigin ¶
func NewDispatchErrorBadOrigin() DispatchError
func NewDispatchErrorCannotLookup ¶
func NewDispatchErrorCannotLookup() DispatchError
func NewDispatchErrorConsumerRemaining ¶
func NewDispatchErrorConsumerRemaining() DispatchError
func NewDispatchErrorCorruption ¶
func NewDispatchErrorCorruption() DispatchError
func NewDispatchErrorExhausted ¶
func NewDispatchErrorExhausted() DispatchError
func NewDispatchErrorModule ¶
func NewDispatchErrorModule(customModuleError CustomModuleError) DispatchError
func NewDispatchErrorNoProviders ¶
func NewDispatchErrorNoProviders() DispatchError
func NewDispatchErrorOther ¶
func NewDispatchErrorOther(str sc.Str) DispatchError
func NewDispatchErrorToken ¶
func NewDispatchErrorToken(tokenError TokenError) DispatchError
func NewDispatchErrorTooManyConsumers ¶
func NewDispatchErrorTooManyConsumers() DispatchError
func NewDispatchErrorTransactional ¶
func NewDispatchErrorTransactional(transactionalError TransactionalError) DispatchError
func NewDispatchErrorUnavailable ¶
func NewDispatchErrorUnavailable() DispatchError
func (DispatchError) Bytes ¶
func (err DispatchError) Bytes() []byte
func (DispatchError) Error ¶
func (err DispatchError) Error() string
type DispatchInfo ¶
type DispatchInfo struct { // Weight of this transaction. Weight Weight // Class of this transaction. Class DispatchClass // Does this transaction pay fees. PaysFee Pays }
DispatchInfo A bundle of static information collected from the `#[pallet::weight]` attributes.
func DecodeDispatchInfo ¶
func DecodeDispatchInfo(buffer *bytes.Buffer) (DispatchInfo, error)
func GetDispatchInfo ¶
func GetDispatchInfo(call Call) DispatchInfo
GetDispatchInfo returns the DispatchInfo of the given call. Uses call's BaseWeight to calculate all the information in DispatchInfo
func (DispatchInfo) Bytes ¶
func (di DispatchInfo) Bytes() []byte
func (DispatchInfo) IsMandatory ¶
func (di DispatchInfo) IsMandatory() (sc.Bool, error)
type DispatchModule ¶
type DispatchOutcome ¶
type DispatchOutcome sc.VaryingData // = sc.Result[sc.Empty, DispatchError]
DispatchOutcome This type specifies the outcome of dispatching a call to a module.
In case of failure an error specific to the module is returned.
Failure of the module call dispatching doesn't invalidate the extrinsic and it is still included in the block, therefore all state changes performed by the dispatched call are still persisted.
For example, if the dispatching of an extrinsic involves inclusion fee payment then these changes are going to be preserved even if the call dispatched failed.
func DecodeDispatchOutcome ¶
func DecodeDispatchOutcome(buffer *bytes.Buffer) (DispatchOutcome, error)
func NewDispatchOutcome ¶
func NewDispatchOutcome(value sc.Encodable) (DispatchOutcome, error)
func (DispatchOutcome) Bytes ¶
func (o DispatchOutcome) Bytes() []byte
type EcdsaPublicKey ¶
type EcdsaPublicKey struct { sc.FixedSequence[sc.U8] // size 33 }
func DecodeEcdsaPublicKey ¶
func DecodeEcdsaPublicKey(buffer *bytes.Buffer) (EcdsaPublicKey, error)
func NewEcdsaPublicKey ¶
func NewEcdsaPublicKey(values ...sc.U8) (EcdsaPublicKey, error)
func (EcdsaPublicKey) Bytes ¶
func (s EcdsaPublicKey) Bytes() []byte
func (EcdsaPublicKey) SignatureType ¶
func (s EcdsaPublicKey) SignatureType() sc.U8
type EcdsaVerifyError ¶
type EcdsaVerifyError sc.VaryingData
func DecodeEcdsaVerifyError ¶
func DecodeEcdsaVerifyError(buffer *bytes.Buffer) (EcdsaVerifyError, error)
func NewEcdsaVerifyErrorBadRS ¶
func NewEcdsaVerifyErrorBadRS() EcdsaVerifyError
func NewEcdsaVerifyErrorBadSignature ¶
func NewEcdsaVerifyErrorBadSignature() EcdsaVerifyError
func NewEcdsaVerifyErrorBadV ¶
func NewEcdsaVerifyErrorBadV() EcdsaVerifyError
func (EcdsaVerifyError) Bytes ¶
func (err EcdsaVerifyError) Bytes() []byte
func (EcdsaVerifyError) Error ¶
func (err EcdsaVerifyError) Error() string
type Ed25519PublicKey ¶
type Ed25519PublicKey struct { sc.FixedSequence[sc.U8] // size 32 }
func DecodeEd25519PublicKey ¶
func DecodeEd25519PublicKey(buffer *bytes.Buffer) (Ed25519PublicKey, error)
func NewEd25519PublicKey ¶
func NewEd25519PublicKey(values ...sc.U8) (Ed25519PublicKey, error)
func (Ed25519PublicKey) Bytes ¶
func (s Ed25519PublicKey) Bytes() []byte
func (Ed25519PublicKey) SignatureType ¶
func (s Ed25519PublicKey) SignatureType() sc.U8
type Era ¶
Era An era to describe the longevity of a transaction.
func NewImmortalEra ¶
func NewImmortalEra() Era
The transaction is valid forever. The genesis hash must be present in the signed content.
func NewMortalEra ¶
NewMortalEra Create a new era based on a period (which should be a power of two between 4 and 65536 inclusive) and a block number on which it should start (or, for long periods, be shortly after the start).
If using `Era` in the context of `FRAME` runtime, make sure that `period` does not exceed `BlockHashCount` parameter passed to `system` module, since that prunes old blocks and renders transactions immediately invalid.
func (Era) Birth ¶
Get the block number of the start of the era whose properties this object describes that `current` belongs to.
type Event ¶
type Event struct {
sc.VaryingData
}
type EventDepositor ¶
type EventDepositor interface {
DepositEvent(event Event)
}
type EventRecord ¶
type EventRecord struct { Phase ExtrinsicPhase Event Event Topics sc.Sequence[H256] }
func DecodeEventRecord ¶
func (EventRecord) Bytes ¶
func (er EventRecord) Bytes() []byte
type ExistenceRequirement ¶
const ( ExistenceRequirementKeepAlive ExistenceRequirement = iota ExistenceRequirementAllowDeath )
type ExistentialDeposit ¶
func (ExistentialDeposit) Docs ¶
func (ed ExistentialDeposit) Docs() string
type ExtraFlags ¶
func (ExtraFlags) Bytes ¶
func (ef ExtraFlags) Bytes() []byte
func (ExtraFlags) IsNewLogic ¶
func (ef ExtraFlags) IsNewLogic() bool
func (ExtraFlags) OldLogic ¶
func (ef ExtraFlags) OldLogic() ExtraFlags
func (ExtraFlags) SetNewLogic ¶
func (ef ExtraFlags) SetNewLogic() ExtraFlags
type ExtrinsicPhase ¶
type ExtrinsicPhase struct {
sc.VaryingData
}
func DecodeExtrinsicPhase ¶
func DecodeExtrinsicPhase(buffer *bytes.Buffer) (ExtrinsicPhase, error)
func NewExtrinsicPhaseApply ¶
func NewExtrinsicPhaseApply(index sc.U32) ExtrinsicPhase
func NewExtrinsicPhaseFinalization ¶
func NewExtrinsicPhaseFinalization() ExtrinsicPhase
func NewExtrinsicPhaseInitialization ¶
func NewExtrinsicPhaseInitialization() ExtrinsicPhase
func (*ExtrinsicPhase) MetadataDefinition ¶
func (p *ExtrinsicPhase) MetadataDefinition() *MetadataTypeDefinition
type ExtrinsicSignature ¶
type ExtrinsicSignature struct { // is the 32-byte address of the sender of the extrinsic // as described in https://docs.substrate.io/reference/address-formats/ Signer MultiAddress Signature MultiSignature Extra SignedExtra }
ExtrinsicSignature The signature is a varying data type indicating the used signature type, followed by the signature created by the extrinsic author (the sender).
func DecodeExtrinsicSignature ¶
func DecodeExtrinsicSignature(extra SignedExtra, buffer *bytes.Buffer) (ExtrinsicSignature, error)
func (ExtrinsicSignature) Bytes ¶
func (s ExtrinsicSignature) Bytes() []byte
type FindAuthor ¶
type Header ¶
type IdentityFee ¶
type IdentityFee struct { }
IdentityFee implements WeightToFee and maps one unit of weight to one unit of fee.
func (IdentityFee) WeightToFee ¶
func (i IdentityFee) WeightToFee(weight Weight) Balance
type IncRefStatus ¶
const ( IncRefStatusCreated IncRefStatus = iota IncRefStatusExisted )
func (IncRefStatus) Bytes ¶
func (irs IncRefStatus) Bytes() []byte
type InherentData ¶
type InherentData struct {
// contains filtered or unexported fields
}
func DecodeInherentData ¶
func DecodeInherentData(buffer *bytes.Buffer) (*InherentData, error)
func NewInherentData ¶
func NewInherentData() *InherentData
func (*InherentData) Bytes ¶
func (id *InherentData) Bytes() []byte
func (*InherentData) Clear ¶
func (id *InherentData) Clear()
type InherentError ¶
type InherentError struct {
sc.VaryingData
}
func NewInherentErrorApplication ¶
func NewInherentErrorApplication(error sc.Str) InherentError
func NewInherentErrorDecodingFailed ¶
func NewInherentErrorDecodingFailed(error sc.Str, inherentIdentifier sc.FixedSequence[sc.U8]) InherentError
func NewInherentErrorFatalErrorReported ¶
func NewInherentErrorFatalErrorReported() InherentError
func NewInherentErrorInherentDataExists ¶
func NewInherentErrorInherentDataExists(inherentIdentifier sc.FixedSequence[sc.U8]) InherentError
func (InherentError) Error ¶
func (ie InherentError) Error() string
func (InherentError) IsFatal ¶
func (ie InherentError) IsFatal() sc.Bool
type InherentProvider ¶
type InherentProvider interface { // CreateInherent creates an inherent call based on InherentData. CreateInherent(inherent InherentData) (sc.Option[Call], error) // CheckInherent validates if the provided call is valid and exists in InherentData. CheckInherent(call Call, data InherentData) error // InherentIdentifier returns the identifier for the specific inherent call. Must be included in InherentData. InherentIdentifier() [8]byte // IsInherent checks if the call is from the given module. IsInherent(call Call) bool }
ProvideInherent is an interface, implemented by modules in order to create and validate inherent calls/extrinsics.
type InvalidTransaction ¶
type InvalidTransaction struct {
sc.VaryingData
}
func DecodeInvalidTransaction ¶
func DecodeInvalidTransaction(buffer *bytes.Buffer) (InvalidTransaction, error)
func NewInvalidTransactionAncientBirthBlock ¶
func NewInvalidTransactionAncientBirthBlock() InvalidTransaction
func NewInvalidTransactionBadMandatory ¶
func NewInvalidTransactionBadMandatory() InvalidTransaction
func NewInvalidTransactionBadProof ¶
func NewInvalidTransactionBadProof() InvalidTransaction
func NewInvalidTransactionBadSigner ¶
func NewInvalidTransactionBadSigner() InvalidTransaction
func NewInvalidTransactionCall ¶
func NewInvalidTransactionCall() InvalidTransaction
func NewInvalidTransactionCustom ¶
func NewInvalidTransactionCustom(customError sc.U8) InvalidTransaction
func NewInvalidTransactionExhaustsResources ¶
func NewInvalidTransactionExhaustsResources() InvalidTransaction
func NewInvalidTransactionFuture ¶
func NewInvalidTransactionFuture() InvalidTransaction
func NewInvalidTransactionMandatoryValidation ¶
func NewInvalidTransactionMandatoryValidation() InvalidTransaction
func NewInvalidTransactionPayment ¶
func NewInvalidTransactionPayment() InvalidTransaction
func NewInvalidTransactionStale ¶
func NewInvalidTransactionStale() InvalidTransaction
func (InvalidTransaction) Error ¶
func (err InvalidTransaction) Error() string
func (InvalidTransaction) MetadataDefinition ¶
func (err InvalidTransaction) MetadataDefinition() *MetadataTypeDefinition
type LastRuntimeUpgradeInfo ¶
func DecodeLastRuntimeUpgradeInfo ¶
func DecodeLastRuntimeUpgradeInfo(buffer *bytes.Buffer) (LastRuntimeUpgradeInfo, error)
func (LastRuntimeUpgradeInfo) Bytes ¶
func (lrui LastRuntimeUpgradeInfo) Bytes() []byte
type MaxReserves ¶
func (MaxReserves) Docs ¶
func (mr MaxReserves) Docs() string
type Metadata ¶
type Metadata struct { Version sc.U8 DataV14 RuntimeMetadataV14 DataV15 RuntimeMetadataV15 }
type Metadata14 ¶
type Metadata14 struct {
Data RuntimeMetadataV14
}
func NewMetadataV14 ¶
func NewMetadataV14(data RuntimeMetadataV14) Metadata14
func (Metadata14) Bytes ¶
func (m Metadata14) Bytes() []byte
type Metadata15 ¶
type Metadata15 struct {
Data RuntimeMetadataV15
}
func NewMetadataV15 ¶
func NewMetadataV15(data RuntimeMetadataV15) Metadata15
func (Metadata15) Bytes ¶
func (m Metadata15) Bytes() []byte
type MetadataDefinitionPrimitive ¶
const ( MetadataDefinitionPrimitiveBoolean MetadataDefinitionPrimitive = iota MetadataDefinitionPrimitiveChar MetadataDefinitionPrimitiveString MetadataDefinitionPrimitiveU8 MetadataDefinitionPrimitiveU16 MetadataDefinitionPrimitiveU32 MetadataDefinitionPrimitiveU64 MetadataDefinitionPrimitiveU128 MetadataDefinitionPrimitiveU256 MetadataDefinitionPrimitiveI8 MetadataDefinitionPrimitiveI16 MetadataDefinitionPrimitiveI32 MetadataDefinitionPrimitiveI64 MetadataDefinitionPrimitiveI128 MetadataDefinitionPrimitiveI256 )
func DecodeMetadataDefinitionPrimitive ¶
func DecodeMetadataDefinitionPrimitive(buffer *bytes.Buffer) (MetadataDefinitionPrimitive, error)
func (MetadataDefinitionPrimitive) Bytes ¶
func (mdp MetadataDefinitionPrimitive) Bytes() []byte
type MetadataDefinitionVariant ¶
type MetadataDefinitionVariant struct { Name sc.Str Fields sc.Sequence[MetadataTypeDefinitionField] Index sc.U8 Docs sc.Sequence[sc.Str] }
func DecodeMetadataTypeDefinitionVariant ¶
func DecodeMetadataTypeDefinitionVariant(buffer *bytes.Buffer) (MetadataDefinitionVariant, error)
func NewMetadataDefinitionVariant ¶
func NewMetadataDefinitionVariant(name string, fields sc.Sequence[MetadataTypeDefinitionField], index sc.U8, docs string) MetadataDefinitionVariant
func NewMetadataDefinitionVariantStr ¶
func NewMetadataDefinitionVariantStr(name sc.Str, fields sc.Sequence[MetadataTypeDefinitionField], index sc.U8, docs string) MetadataDefinitionVariant
func (MetadataDefinitionVariant) Bytes ¶
func (mdv MetadataDefinitionVariant) Bytes() []byte
type MetadataExtrinsicV14 ¶
type MetadataExtrinsicV14 struct { Type sc.Compact Version sc.U8 SignedExtensions sc.Sequence[MetadataSignedExtension] }
func DecodeMetadataExtrinsicV14 ¶
func DecodeMetadataExtrinsicV14(buffer *bytes.Buffer) (MetadataExtrinsicV14, error)
func (MetadataExtrinsicV14) Bytes ¶
func (me MetadataExtrinsicV14) Bytes() []byte
type MetadataExtrinsicV15 ¶
type MetadataExtrinsicV15 struct { Version sc.U8 Address sc.Compact Call sc.Compact Signature sc.Compact Extra sc.Compact SignedExtensions sc.Sequence[MetadataSignedExtension] }
func DecodeMetadataExtrinsicV15 ¶
func DecodeMetadataExtrinsicV15(buffer *bytes.Buffer) (MetadataExtrinsicV15, error)
func (MetadataExtrinsicV15) Bytes ¶
func (me MetadataExtrinsicV15) Bytes() []byte
type MetadataModule ¶
type MetadataModule struct { Version sc.U8 ModuleV14 MetadataModuleV14 ModuleV15 MetadataModuleV15 }
func (MetadataModule) Bytes ¶
func (mm MetadataModule) Bytes() []byte
type MetadataModuleConstant ¶
type MetadataModuleConstant struct { Name sc.Str Type sc.Compact Value sc.Sequence[sc.U8] Docs sc.Sequence[sc.Str] }
func DecodeMetadataModuleConstant ¶
func DecodeMetadataModuleConstant(buffer *bytes.Buffer) (MetadataModuleConstant, error)
func (MetadataModuleConstant) Bytes ¶
func (mmc MetadataModuleConstant) Bytes() []byte
type MetadataModuleStorage ¶
type MetadataModuleStorage struct { Prefix sc.Str Items sc.Sequence[MetadataModuleStorageEntry] }
func DecodeMetadataModuleStorage ¶
func DecodeMetadataModuleStorage(buffer *bytes.Buffer) (MetadataModuleStorage, error)
func (MetadataModuleStorage) Bytes ¶
func (mms MetadataModuleStorage) Bytes() []byte
type MetadataModuleStorageEntry ¶
type MetadataModuleStorageEntry struct { Name sc.Str Modifier MetadataModuleStorageEntryModifier Definition MetadataModuleStorageEntryDefinition Fallback sc.Sequence[sc.U8] Docs sc.Sequence[sc.Str] }
func DecodeMetadataModuleStorageEntry ¶
func DecodeMetadataModuleStorageEntry(buffer *bytes.Buffer) (MetadataModuleStorageEntry, error)
func NewMetadataModuleStorageEntry ¶
func NewMetadataModuleStorageEntry(name string, modifier MetadataModuleStorageEntryModifier, definition MetadataModuleStorageEntryDefinition, docs string) MetadataModuleStorageEntry
func (MetadataModuleStorageEntry) Bytes ¶
func (mmse MetadataModuleStorageEntry) Bytes() []byte
type MetadataModuleStorageEntryDefinition ¶
type MetadataModuleStorageEntryDefinition struct {
sc.VaryingData
}
func DecodeMetadataModuleStorageEntryDefinition ¶
func DecodeMetadataModuleStorageEntryDefinition(buffer *bytes.Buffer) (MetadataModuleStorageEntryDefinition, error)
func NewMetadataModuleStorageEntryDefinitionMap ¶
func NewMetadataModuleStorageEntryDefinitionMap(storageHashFuncs sc.Sequence[MetadataModuleStorageHashFunc], key, value sc.Compact) MetadataModuleStorageEntryDefinition
func NewMetadataModuleStorageEntryDefinitionPlain ¶
func NewMetadataModuleStorageEntryDefinitionPlain(key sc.Compact) MetadataModuleStorageEntryDefinition
type MetadataModuleStorageEntryModifier ¶
const ( MetadataModuleStorageEntryModifierOptional MetadataModuleStorageEntryModifier = iota MetadataModuleStorageEntryModifierDefault = 1 )
func DecodeMetadataModuleStorageEntryModifier ¶
func DecodeMetadataModuleStorageEntryModifier(buffer *bytes.Buffer) (MetadataModuleStorageEntryModifier, error)
func (MetadataModuleStorageEntryModifier) Bytes ¶
func (mmsem MetadataModuleStorageEntryModifier) Bytes() []byte
type MetadataModuleStorageHashFunc ¶
const ( MetadataModuleStorageHashFuncBlake128 MetadataModuleStorageHashFunc = iota MetadataModuleStorageHashFuncBlake256 MetadataModuleStorageHashFuncMultiBlake128Concat MetadataModuleStorageHashFuncXX128 MetadataModuleStorageHashFuncXX256 MetadataModuleStorageHashFuncMultiXX64 MetadataModuleStorageHashFuncIdentity )
func DecodeMetadataModuleStorageHashFunc ¶
func DecodeMetadataModuleStorageHashFunc(buffer *bytes.Buffer) (MetadataModuleStorageHashFunc, error)
func (MetadataModuleStorageHashFunc) Bytes ¶
func (mmshf MetadataModuleStorageHashFunc) Bytes() []byte
type MetadataModuleV14 ¶
type MetadataModuleV14 struct { Name sc.Str Storage sc.Option[MetadataModuleStorage] Call sc.Option[sc.Compact] CallDef sc.Option[MetadataDefinitionVariant] // not encoded Event sc.Option[sc.Compact] EventDef sc.Option[MetadataDefinitionVariant] // not encoded Constants sc.Sequence[MetadataModuleConstant] Error sc.Option[sc.Compact] ErrorDef sc.Option[MetadataDefinitionVariant] // not encoded Index sc.U8 }
func DecodeMetadataModuleV14 ¶
func DecodeMetadataModuleV14(buffer *bytes.Buffer) (MetadataModuleV14, error)
func (MetadataModuleV14) Bytes ¶
func (mm MetadataModuleV14) Bytes() []byte
type MetadataModuleV15 ¶
type MetadataModuleV15 struct { Name sc.Str Storage sc.Option[MetadataModuleStorage] Call sc.Option[sc.Compact] CallDef sc.Option[MetadataDefinitionVariant] // not encoded Event sc.Option[sc.Compact] EventDef sc.Option[MetadataDefinitionVariant] // not encoded Constants sc.Sequence[MetadataModuleConstant] Error sc.Option[sc.Compact] ErrorDef sc.Option[MetadataDefinitionVariant] // not encoded Index sc.U8 Docs sc.Sequence[sc.Str] }
func DecodeMetadataModuleV15 ¶
func DecodeMetadataModuleV15(buffer *bytes.Buffer) (MetadataModuleV15, error)
func (MetadataModuleV15) Bytes ¶
func (mm MetadataModuleV15) Bytes() []byte
type MetadataSignedExtension ¶
type MetadataSignedExtension struct { Identifier sc.Str Type sc.Compact AdditionalSigned sc.Compact }
func DecodeMetadataSignedExtension ¶
func DecodeMetadataSignedExtension(buffer *bytes.Buffer) (MetadataSignedExtension, error)
func NewMetadataSignedExtension ¶
func NewMetadataSignedExtension(identifier sc.Str, typeIndex, additionalSigned int) MetadataSignedExtension
func (MetadataSignedExtension) Bytes ¶
func (mse MetadataSignedExtension) Bytes() []byte
type MetadataType ¶
type MetadataType struct { Id sc.Compact Path sc.Sequence[sc.Str] Params sc.Sequence[MetadataTypeParameter] Definition MetadataTypeDefinition Docs sc.Sequence[sc.Str] }
func DecodeMetadataType ¶
func DecodeMetadataType(buffer *bytes.Buffer) (MetadataType, error)
func NewMetadataType ¶
func NewMetadataType(id int, docs string, definition MetadataTypeDefinition) MetadataType
func NewMetadataTypeWithParam ¶
func NewMetadataTypeWithParam(id int, docs string, path sc.Sequence[sc.Str], definition MetadataTypeDefinition, param MetadataTypeParameter) MetadataType
func NewMetadataTypeWithParams ¶
func NewMetadataTypeWithParams(id int, docs string, path sc.Sequence[sc.Str], definition MetadataTypeDefinition, params sc.Sequence[MetadataTypeParameter]) MetadataType
func NewMetadataTypeWithPath ¶
func NewMetadataTypeWithPath(id int, docs string, path sc.Sequence[sc.Str], definition MetadataTypeDefinition) MetadataType
func (MetadataType) Bytes ¶
func (mt MetadataType) Bytes() []byte
type MetadataTypeDefinition ¶
type MetadataTypeDefinition struct {
sc.VaryingData
}
func DecodeMetadataTypeDefinition ¶
func DecodeMetadataTypeDefinition(buffer *bytes.Buffer) (MetadataTypeDefinition, error)
func NewMetadataTypeDefinitionBitSequence ¶
func NewMetadataTypeDefinitionBitSequence(storeOrder, orderType sc.Compact) MetadataTypeDefinition
func NewMetadataTypeDefinitionCompact ¶
func NewMetadataTypeDefinitionCompact(compact sc.Compact) MetadataTypeDefinition
func NewMetadataTypeDefinitionComposite ¶
func NewMetadataTypeDefinitionComposite(fields sc.Sequence[MetadataTypeDefinitionField]) MetadataTypeDefinition
func NewMetadataTypeDefinitionFixedSequence ¶
func NewMetadataTypeDefinitionFixedSequence(length sc.U32, typeId sc.Compact) MetadataTypeDefinition
func NewMetadataTypeDefinitionPrimitive ¶
func NewMetadataTypeDefinitionPrimitive(primitive MetadataDefinitionPrimitive) MetadataTypeDefinition
func NewMetadataTypeDefinitionSequence ¶
func NewMetadataTypeDefinitionSequence(compact sc.Compact) MetadataTypeDefinition
func NewMetadataTypeDefinitionTuple ¶
func NewMetadataTypeDefinitionTuple(compacts sc.Sequence[sc.Compact]) MetadataTypeDefinition
func NewMetadataTypeDefinitionVariant ¶
func NewMetadataTypeDefinitionVariant(variants sc.Sequence[MetadataDefinitionVariant]) MetadataTypeDefinition
type MetadataTypeDefinitionField ¶
type MetadataTypeDefinitionField struct { Name sc.Option[sc.Str] Type sc.Compact TypeName sc.Option[sc.Str] Docs sc.Sequence[sc.Str] }
func DecodeMetadataTypeDefinitionField ¶
func DecodeMetadataTypeDefinitionField(buffer *bytes.Buffer) (MetadataTypeDefinitionField, error)
func NewMetadataTypeDefinitionField ¶
func NewMetadataTypeDefinitionField(id int) MetadataTypeDefinitionField
func NewMetadataTypeDefinitionFieldWithName ¶
func NewMetadataTypeDefinitionFieldWithName(id int, idName sc.Str) MetadataTypeDefinitionField
func (MetadataTypeDefinitionField) Bytes ¶
func (mtdf MetadataTypeDefinitionField) Bytes() []byte
type MetadataTypeGenerator ¶
type MetadataTypeGenerator struct {
// contains filtered or unexported fields
}
func NewMetadataTypeGenerator ¶
func NewMetadataTypeGenerator() *MetadataTypeGenerator
func (*MetadataTypeGenerator) AppendMetadataTypes ¶
func (g *MetadataTypeGenerator) AppendMetadataTypes(types sc.Sequence[MetadataType])
func (*MetadataTypeGenerator) BuildCallsMetadata ¶
func (g *MetadataTypeGenerator) BuildCallsMetadata(moduleName string, moduleFunctions map[sc.U8]Call, params *sc.Sequence[MetadataTypeParameter]) int
BuildCallsMetadata returns metadata calls type of a module
func (*MetadataTypeGenerator) BuildErrorsMetadata ¶
func (g *MetadataTypeGenerator) BuildErrorsMetadata(moduleName string, definition *MetadataTypeDefinition) int
BuildErrorsMetadata returns metadata errors type of a module
func (*MetadataTypeGenerator) BuildExtraMetadata ¶
func (g *MetadataTypeGenerator) BuildExtraMetadata(extraValue reflect.Value, extensions *sc.Sequence[MetadataSignedExtension]) int
BuildExtraMetadata generates the metadata for a signed extension. Returns the metadata id for the extra
func (*MetadataTypeGenerator) BuildMetadataTypeRecursively ¶
func (g *MetadataTypeGenerator) BuildMetadataTypeRecursively(v reflect.Value, path *sc.Sequence[sc.Str], def *MetadataTypeDefinition, params *sc.Sequence[MetadataTypeParameter]) int
BuildMetadataTypeRecursively Builds the metadata type (recursively) if it does not exist
func (*MetadataTypeGenerator) BuildModuleConstants ¶
func (g *MetadataTypeGenerator) BuildModuleConstants(config reflect.Value) sc.Sequence[MetadataModuleConstant]
func (*MetadataTypeGenerator) ClearMetadata ¶
func (g *MetadataTypeGenerator) ClearMetadata()
func (*MetadataTypeGenerator) GetId ¶
func (g *MetadataTypeGenerator) GetId(typeName string) (int, bool)
func (*MetadataTypeGenerator) GetIdsMap ¶
func (g *MetadataTypeGenerator) GetIdsMap() map[string]int
func (*MetadataTypeGenerator) GetLastAvailableIndex ¶
func (g *MetadataTypeGenerator) GetLastAvailableIndex() int
func (*MetadataTypeGenerator) GetMetadataTypes ¶
func (g *MetadataTypeGenerator) GetMetadataTypes() sc.Sequence[MetadataType]
type MetadataTypeParameter ¶
func DecodeMetadataTypeParameter ¶
func DecodeMetadataTypeParameter(buffer *bytes.Buffer) (MetadataTypeParameter, error)
func NewMetadataEmptyTypeParameter ¶
func NewMetadataEmptyTypeParameter(text string) MetadataTypeParameter
func NewMetadataTypeParameter ¶
func NewMetadataTypeParameter(id int, text string) MetadataTypeParameter
func NewMetadataTypeParameterCompactId ¶
func NewMetadataTypeParameterCompactId(id sc.Compact, text string) MetadataTypeParameter
func (MetadataTypeParameter) Bytes ¶
func (mtp MetadataTypeParameter) Bytes() []byte
type Module ¶
type Module interface { InherentProvider DispatchModule GetIndex() sc.U8 Functions() map[sc.U8]Call PreDispatch(call Call) (sc.Empty, error) ValidateUnsigned(source TransactionSource, call Call) (ValidTransaction, error) Metadata() MetadataModule }
type MultiAddress ¶
type MultiAddress struct {
sc.VaryingData
}
func DecodeMultiAddress ¶
func DecodeMultiAddress(buffer *bytes.Buffer) (MultiAddress, error)
func NewMultiAddress20 ¶
func NewMultiAddress20(address Address20) MultiAddress
func NewMultiAddress32 ¶
func NewMultiAddress32(address Address32) MultiAddress
func NewMultiAddressId ¶
func NewMultiAddressId(id AccountId) MultiAddress
func NewMultiAddressIndex ¶
func NewMultiAddressIndex(index AccountIndex) MultiAddress
func NewMultiAddressRaw ¶
func NewMultiAddressRaw(accountRaw AccountRaw) MultiAddress
func (MultiAddress) AsAccountId ¶
func (a MultiAddress) AsAccountId() (AccountId, error)
func (MultiAddress) AsAccountIndex ¶
func (a MultiAddress) AsAccountIndex() (AccountIndex, error)
func (MultiAddress) AsAddress20 ¶
func (a MultiAddress) AsAddress20() (Address20, error)
func (MultiAddress) AsAddress32 ¶
func (a MultiAddress) AsAddress32() (Address32, error)
func (MultiAddress) AsRaw ¶
func (a MultiAddress) AsRaw() (AccountRaw, error)
func (MultiAddress) IsAccountId ¶
func (a MultiAddress) IsAccountId() bool
func (MultiAddress) IsAccountIndex ¶
func (a MultiAddress) IsAccountIndex() bool
func (MultiAddress) IsAddress20 ¶
func (a MultiAddress) IsAddress20() bool
func (MultiAddress) IsAddress32 ¶
func (a MultiAddress) IsAddress32() bool
func (MultiAddress) IsRaw ¶
func (a MultiAddress) IsRaw() bool
type MultiSignature ¶
type MultiSignature struct {
sc.VaryingData
}
func DecodeMultiSignature ¶
func DecodeMultiSignature(buffer *bytes.Buffer) (MultiSignature, error)
func NewMultiSignatureEcdsa ¶
func NewMultiSignatureEcdsa(signature SignatureEcdsa) MultiSignature
func NewMultiSignatureEd25519 ¶
func NewMultiSignatureEd25519(signature SignatureEd25519) MultiSignature
func NewMultiSignatureSr25519 ¶
func NewMultiSignatureSr25519(signature SignatureSr25519) MultiSignature
func (MultiSignature) AsEcdsa ¶
func (s MultiSignature) AsEcdsa() (SignatureEcdsa, error)
func (MultiSignature) AsEd25519 ¶
func (s MultiSignature) AsEd25519() (SignatureEd25519, error)
func (MultiSignature) AsSr25519 ¶
func (s MultiSignature) AsSr25519() (SignatureSr25519, error)
func (MultiSignature) IsEcdsa ¶
func (s MultiSignature) IsEcdsa() bool
func (MultiSignature) IsEd25519 ¶
func (s MultiSignature) IsEd25519() bool
func (MultiSignature) IsSr25519 ¶
func (s MultiSignature) IsSr25519() bool
type OnRuntimeUpgrade ¶
type OnRuntimeUpgrade interface {
OnRuntimeUpgrade() Weight
}
type OuterEnums ¶
type OuterEnums struct { CallEnumType sc.Compact EventEnumType sc.Compact ErrorEnumType sc.Compact }
func DecodeOuterEnums ¶
func DecodeOuterEnums(buffer *bytes.Buffer) (OuterEnums, error)
func (OuterEnums) Bytes ¶
func (oe OuterEnums) Bytes() []byte
type PerDispatchClass ¶
type PerDispatchClass[T sc.Encodable] struct { // Value for `Normal` extrinsics. Normal T // Value for `Operational` extrinsics. Operational T // Value for `Mandatory` extrinsics. Mandatory T }
A struct holding value for each `DispatchClass`.
func DecodePerDispatchClass ¶
func (PerDispatchClass[T]) Bytes ¶
func (pdc PerDispatchClass[T]) Bytes() []byte
func (PerDispatchClass[T]) Encode ¶
func (pdc PerDispatchClass[T]) Encode(buffer *bytes.Buffer) error
func (*PerDispatchClass[T]) Get ¶
func (pdc *PerDispatchClass[T]) Get(class DispatchClass) (*T, error)
Get current value for given class.
type PerDispatchClassU32 ¶
type PerDispatchClassU32 struct { // Value for `Normal` extrinsics. Normal sc.U32 // Value for `Operational` extrinsics. Operational sc.U32 // Value for `Mandatory` extrinsics. Mandatory sc.U32 }
func (PerDispatchClassU32) Bytes ¶
func (pdc PerDispatchClassU32) Bytes() []byte
func (PerDispatchClassU32) Encode ¶
func (pdc PerDispatchClassU32) Encode(buffer *bytes.Buffer) error
func (*PerDispatchClassU32) Get ¶
func (pdc *PerDispatchClassU32) Get(class DispatchClass) (*sc.U32, error)
Get current value for given class.
type PerDispatchClassWeight ¶
type PerDispatchClassWeight struct { // Value for `Normal` extrinsics. Normal Weight // Value for `Operational` extrinsics. Operational Weight // Value for `Mandatory` extrinsics. Mandatory Weight }
func (PerDispatchClassWeight) Bytes ¶
func (pdcw PerDispatchClassWeight) Bytes() []byte
func (PerDispatchClassWeight) Encode ¶
func (pdcw PerDispatchClassWeight) Encode(buffer *bytes.Buffer) error
func (*PerDispatchClassWeight) Get ¶
func (pdcw *PerDispatchClassWeight) Get(class DispatchClass) (*Weight, error)
Get current value for given class.
type PerDispatchClassWeightsPerClass ¶
type PerDispatchClassWeightsPerClass struct { // Value for `Normal` extrinsics. Normal WeightsPerClass // Value for `Operational` extrinsics. Operational WeightsPerClass // Value for `Mandatory` extrinsics. Mandatory WeightsPerClass }
func DecodePerDispatchClassWeightPerClass ¶
func DecodePerDispatchClassWeightPerClass(buffer *bytes.Buffer, decodeWeightPerClass func(buffer *bytes.Buffer) (WeightsPerClass, error)) (PerDispatchClassWeightsPerClass, error)
func (PerDispatchClassWeightsPerClass) Bytes ¶
func (pdc PerDispatchClassWeightsPerClass) Bytes() []byte
func (PerDispatchClassWeightsPerClass) Encode ¶
func (pdc PerDispatchClassWeightsPerClass) Encode(buffer *bytes.Buffer) error
func (*PerDispatchClassWeightsPerClass) Get ¶
func (pdc *PerDispatchClassWeightsPerClass) Get(class DispatchClass) (*WeightsPerClass, error)
Get current value for given class.
type PostDispatchInfo ¶
type PostDispatchInfo struct { // Actual weight consumed by a call or `None` which stands for the worst case static weight. ActualWeight sc.Option[Weight] // Whether this transaction should pay fees when all is said and done. PaysFee Pays }
PostDispatchInfo Weight information that is only available post dispatch. NOTE: This can only be used to reduce the weight or fee, not increase it.
func DecodePostDispatchInfo ¶
func DecodePostDispatchInfo(buffer *bytes.Buffer) (PostDispatchInfo, error)
func (PostDispatchInfo) Bytes ¶
func (pdi PostDispatchInfo) Bytes() []byte
func (PostDispatchInfo) CalcActualWeight ¶
func (pdi PostDispatchInfo) CalcActualWeight(info *DispatchInfo) Weight
CalcActualWeight Calculate how much weight was actually spent by the `Dispatchable`.
func (PostDispatchInfo) CalcUnspent ¶
func (pdi PostDispatchInfo) CalcUnspent(info *DispatchInfo) Weight
CalcUnspent Calculate how much (if any) weight was not used by the `Dispatchable`.
func (PostDispatchInfo) Pays ¶
func (pdi PostDispatchInfo) Pays(info *DispatchInfo) Pays
Pays Determine if user should actually pay fees at the end of the dispatch.
type Pre ¶
type Pre = sc.VaryingData
Pre is the type that encodes information that can be passed from pre_dispatch to post-dispatch.
type PublicKeyType ¶
const ( PublicKeyEd25519 PublicKeyType = iota PublicKeySr25519 PublicKeyEcdsa )
type RawOrigin ¶
type RawOrigin struct {
sc.VaryingData
}
func NewRawOriginNone ¶
func NewRawOriginNone() RawOrigin
func NewRawOriginRoot ¶
func NewRawOriginRoot() RawOrigin
func NewRawOriginSigned ¶
func (RawOrigin) IsNoneOrigin ¶
func (RawOrigin) IsRootOrigin ¶
func (RawOrigin) IsSignedOrigin ¶
type RuntimeApiMetadata ¶
type RuntimeApiMetadata struct { Name sc.Str Methods sc.Sequence[RuntimeApiMethodMetadata] Docs sc.Sequence[sc.Str] }
func DecodeRuntimeApiMetadata ¶
func DecodeRuntimeApiMetadata(buffer *bytes.Buffer) (RuntimeApiMetadata, error)
func (RuntimeApiMetadata) Bytes ¶
func (ram RuntimeApiMetadata) Bytes() []byte
type RuntimeApiMethodMetadata ¶
type RuntimeApiMethodMetadata struct { Name sc.Str Inputs sc.Sequence[RuntimeApiMethodParamMetadata] Output sc.Compact Docs sc.Sequence[sc.Str] }
func DecodeRuntimeApiMethodMetadata ¶
func DecodeRuntimeApiMethodMetadata(buffer *bytes.Buffer) (RuntimeApiMethodMetadata, error)
func (RuntimeApiMethodMetadata) Bytes ¶
func (ramm RuntimeApiMethodMetadata) Bytes() []byte
type RuntimeApiMethodParamMetadata ¶
func DecodeRuntimeApiMethodParamMetadata ¶
func DecodeRuntimeApiMethodParamMetadata(buffer *bytes.Buffer) (RuntimeApiMethodParamMetadata, error)
func (RuntimeApiMethodParamMetadata) Bytes ¶
func (rampm RuntimeApiMethodParamMetadata) Bytes() []byte
type RuntimeApiModule ¶
type RuntimeApiModule interface {
Metadata() RuntimeApiMetadata
}
type RuntimeDbWeight ¶
RuntimeDbWeight is the weight of database operations that the runtime can invoke.
NOTE: This is currently only measured in computational time, and will probably be updated all together once proof size is accounted for.
func (RuntimeDbWeight) Bytes ¶
func (dbw RuntimeDbWeight) Bytes() []byte
func (RuntimeDbWeight) Docs ¶
func (dbw RuntimeDbWeight) Docs() string
func (RuntimeDbWeight) ReadsWrites ¶
func (dbw RuntimeDbWeight) ReadsWrites(r, w sc.U64) Weight
type RuntimeDispatchInfo ¶
type RuntimeDispatchInfo struct { Weight Weight Class DispatchClass PartialFee Balance }
func DecodeRuntimeDispatchInfo ¶
func DecodeRuntimeDispatchInfo(buffer *bytes.Buffer) (RuntimeDispatchInfo, error)
func (RuntimeDispatchInfo) Bytes ¶
func (rdi RuntimeDispatchInfo) Bytes() []byte
type RuntimeMetadataV14 ¶
type RuntimeMetadataV14 struct { Types sc.Sequence[MetadataType] Modules sc.Sequence[MetadataModuleV14] Extrinsic MetadataExtrinsicV14 Type sc.Compact }
func DecodeRuntimeMetadataV14 ¶
func DecodeRuntimeMetadataV14(buffer *bytes.Buffer) (RuntimeMetadataV14, error)
func (RuntimeMetadataV14) Bytes ¶
func (rm RuntimeMetadataV14) Bytes() []byte
type RuntimeMetadataV15 ¶
type RuntimeMetadataV15 struct { Types sc.Sequence[MetadataType] Modules sc.Sequence[MetadataModuleV15] Extrinsic MetadataExtrinsicV15 Type sc.Compact Apis sc.Sequence[RuntimeApiMetadata] OuterEnums OuterEnums Custom CustomMetadata }
func DecodeRuntimeMetadataV15 ¶
func DecodeRuntimeMetadataV15(buffer *bytes.Buffer) (RuntimeMetadataV15, error)
func (RuntimeMetadataV15) Bytes ¶
func (rm RuntimeMetadataV15) Bytes() []byte
type RuntimeOrigin ¶
type RuntimeOrigin = RawOrigin
type RuntimeVersion ¶
type RuntimeVersion struct { SpecName sc.Str ImplName sc.Str AuthoringVersion sc.U32 SpecVersion sc.U32 ImplVersion sc.U32 Apis sc.Sequence[ApiItem] TransactionVersion sc.U32 StateVersion sc.U8 }
func DecodeRuntimeVersion ¶
func DecodeRuntimeVersion(buffer *bytes.Buffer) (RuntimeVersion, error)
func (RuntimeVersion) Bytes ¶
func (rv RuntimeVersion) Bytes() []byte
func (RuntimeVersion) Docs ¶
func (rv RuntimeVersion) Docs() string
type Session ¶
type Session interface { KeyType() PublicKeyType KeyTypeId() [4]byte }
Session provides the key type and id of a module, which has a session.
type SessionKey ¶
func DecodeSessionKey ¶
func DecodeSessionKey(buffer *bytes.Buffer) (SessionKey, error)
func NewSessionKey ¶
func NewSessionKey(key []byte, typeId [4]byte) SessionKey
func NewSessionKeyFromBytes ¶
func NewSessionKeyFromBytes(key []byte, typeId sc.FixedSequence[sc.U8]) SessionKey
func (SessionKey) Bytes ¶
func (sk SessionKey) Bytes() []byte
type SignatureEcdsa ¶
type SignatureEcdsa struct { sc.FixedSequence[sc.U8] // size 65 }
func DecodeSignatureEcdsa ¶
func DecodeSignatureEcdsa(buffer *bytes.Buffer) (SignatureEcdsa, error)
func NewSignatureEcdsa ¶
func NewSignatureEcdsa(values ...sc.U8) SignatureEcdsa
func (SignatureEcdsa) Bytes ¶
func (s SignatureEcdsa) Bytes() []byte
type SignatureEd25519 ¶
type SignatureEd25519 struct { sc.FixedSequence[sc.U8] // size 64 }
func DecodeSignatureEd25519 ¶
func DecodeSignatureEd25519(buffer *bytes.Buffer) (SignatureEd25519, error)
func NewSignatureEd25519 ¶
func NewSignatureEd25519(values ...sc.U8) SignatureEd25519
func (SignatureEd25519) Bytes ¶
func (s SignatureEd25519) Bytes() []byte
type SignatureSr25519 ¶
type SignatureSr25519 struct { sc.FixedSequence[sc.U8] // size 64 }
func DecodeSignatureSr25519 ¶
func DecodeSignatureSr25519(buffer *bytes.Buffer) (SignatureSr25519, error)
func NewSignatureSr25519 ¶
func NewSignatureSr25519(values ...sc.U8) SignatureSr25519
func (SignatureSr25519) Bytes ¶
func (s SignatureSr25519) Bytes() []byte
type SignedExtension ¶
type SignedExtension interface { sc.Encodable Decode(buffer *bytes.Buffer) error DeepCopy() SignedExtension // Construct any additional data that should be in the signed payload of the transaction. Can // also perform any pre-signature-verification checks and return an error if needed. AdditionalSigned() (AdditionalSigned, error) // Validate a signed transaction for the transaction queue. // // This function can be called frequently by the transaction queue, // to obtain transaction validity against current state. // It should perform all checks that determine a valid transaction, // that can pay for its execution and quickly eliminate ones // that are stale or incorrect. // // Make sure to perform the same checks in `pre_dispatch` function. Validate(who AccountId, call Call, info *DispatchInfo, length sc.Compact) (ValidTransaction, error) // Do any pre-flight stuff for a signed transaction. // // Make sure to perform the same checks as in [`Self::validate`]. PreDispatch(who AccountId, call Call, info *DispatchInfo, length sc.Compact) (Pre, error) // Validate an unsigned transaction for the transaction queue. // // This function can be called frequently by the transaction queue // to obtain transaction validity against current state. // It should perform all checks that determine a valid unsigned transaction, // and quickly eliminate ones that are stale or incorrect. // // Make sure to perform the same checks in `pre_dispatch_unsigned` function. ValidateUnsigned(call Call, info *DispatchInfo, length sc.Compact) (ValidTransaction, error) // Do any pre-flight stuff for a unsigned transaction. // // Note this function by default delegates to `validate_unsigned`, so that // all checks performed for the transaction queue are also performed during // the dispatch phase (applying the extrinsic). // // If you ever override this function, you need to make sure to always // perform the same validation as in `validate_unsigned`. PreDispatchUnsigned(call Call, info *DispatchInfo, length sc.Compact) error // Do any post-flight stuff for an extrinsic. // // If the transaction is signed, then `_pre` will contain the output of `pre_dispatch`, // and `None` otherwise. // // This gets given the `DispatchResult` `_result` from the extrinsic and can, if desired, // introduce a `TransactionValidityError`, causing the block to become invalid for including // it. // // WARNING: It is dangerous to return an error here. To do so will fundamentally invalidate the // transaction and any block that it is included in, causing the block author to not be // compensated for their work in validating the transaction or producing the block so far. // // It can only be used safely when you *know* that the extrinsic is one that can only be // introduced by the current block author; generally this implies that it is an inherent and // will come from either an offchain-worker or via `InherentData`.( PostDispatch(pre sc.Option[Pre], info *DispatchInfo, postInfo *PostDispatchInfo, length sc.Compact, dispatchErr error) error // ModulePath Returns the path of the module where the extension is located in. E.g. frame_system, frame_transaction_payment ModulePath() string }
SignedExtension - Means by which a transaction may be extended. This type embodies both the data and the logic that should be additionally associated with the transaction. It should be plain old data.
type SignedExtra ¶
type SignedExtra interface { sc.Encodable Decode(buffer *bytes.Buffer) DeepCopy() SignedExtra AdditionalSigned() (AdditionalSigned, error) Validate(who AccountId, call Call, info *DispatchInfo, length sc.Compact) (ValidTransaction, error) ValidateUnsigned(call Call, info *DispatchInfo, length sc.Compact) (ValidTransaction, error) PreDispatch(who AccountId, call Call, info *DispatchInfo, length sc.Compact) (sc.Sequence[Pre], error) PreDispatchUnsigned(call Call, info *DispatchInfo, length sc.Compact) error PostDispatch(pre sc.Option[sc.Sequence[Pre]], info *DispatchInfo, postInfo *PostDispatchInfo, length sc.Compact, dispatchErr error) error Metadata() sc.Sequence[MetadataSignedExtension] }
func NewSignedExtra ¶
func NewSignedExtra(checks []SignedExtension, mdGenerator *MetadataTypeGenerator) SignedExtra
type SignedPayload ¶
type SignedPayload interface { sc.Encodable AdditionalSigned() AdditionalSigned Call() Call Extra() SignedExtra }
func NewSignedPayload ¶
func NewSignedPayload(call Call, extra SignedExtra) (SignedPayload, error)
NewSignedPayload creates a new `SignedPayload`. It may fail if `additional_signed` of `Extra` is not available.
type Sr25519PublicKey ¶
type Sr25519PublicKey struct { sc.FixedSequence[sc.U8] // size 32 }
func DecodeSr25519PublicKey ¶
func DecodeSr25519PublicKey(buffer *bytes.Buffer) (Sr25519PublicKey, error)
func NewSr25519PublicKey ¶
func NewSr25519PublicKey(values ...sc.U8) (Sr25519PublicKey, error)
func (Sr25519PublicKey) Bytes ¶
func (s Sr25519PublicKey) Bytes() []byte
func (Sr25519PublicKey) SignatureType ¶
func (s Sr25519PublicKey) SignatureType() sc.U8
type StoredMap ¶
type StoredMap interface { EventDepositor Get(key AccountId) (AccountInfo, error) CanDecProviders(who AccountId) (bool, error) DecConsumers(who AccountId) error DecProviders(who AccountId) (DecRefStatus, error) IncConsumers(who AccountId) error IncConsumersWithoutLimit(who AccountId) error IncProviders(who AccountId) (IncRefStatus, error) Insert(who AccountId, data AccountData) (sc.Encodable, error) TryMutateExists(who AccountId, f func(who *AccountData) (sc.Encodable, error)) (sc.Encodable, error) }
type TimestampError ¶
type TimestampError struct {
sc.VaryingData
}
func NewTimestampErrorInvalid ¶
func NewTimestampErrorInvalid() TimestampError
func NewTimestampErrorTooEarly ¶
func NewTimestampErrorTooEarly() TimestampError
func NewTimestampErrorTooFarInFuture ¶
func NewTimestampErrorTooFarInFuture() TimestampError
func (TimestampError) Error ¶
func (te TimestampError) Error() string
func (TimestampError) IsFatal ¶
func (te TimestampError) IsFatal() sc.Bool
type TokenError ¶
type TokenError sc.VaryingData
func DecodeTokenError ¶
func DecodeTokenError(buffer *bytes.Buffer) (TokenError, error)
func NewTokenErrorBelowMinimum ¶
func NewTokenErrorBelowMinimum() TokenError
func NewTokenErrorBlocked ¶
func NewTokenErrorBlocked() TokenError
func NewTokenErrorCannotCreate ¶
func NewTokenErrorCannotCreate() TokenError
func NewTokenErrorCannotCreateHold ¶
func NewTokenErrorCannotCreateHold() TokenError
func NewTokenErrorFrozen ¶
func NewTokenErrorFrozen() TokenError
func NewTokenErrorFundsUnavailable ¶
func NewTokenErrorFundsUnavailable() TokenError
func NewTokenErrorNotExpendable ¶
func NewTokenErrorNotExpendable() TokenError
func NewTokenErrorOnlyProvider ¶
func NewTokenErrorOnlyProvider() TokenError
func NewTokenErrorUnknownAsset ¶
func NewTokenErrorUnknownAsset() TokenError
func NewTokenErrorUnsupported ¶
func NewTokenErrorUnsupported() TokenError
func (TokenError) Bytes ¶
func (err TokenError) Bytes() []byte
func (TokenError) Error ¶
func (err TokenError) Error() string
type TransactionLongevity ¶
type TransactionOutcome ¶
type TransactionOutcome sc.VaryingData
TransactionOutcome Describes on what should happen with a storage transaction.
func NewTransactionOutcomeCommit ¶
func NewTransactionOutcomeCommit(res sc.Encodable) TransactionOutcome
func NewTransactionOutcomeRollback ¶
func NewTransactionOutcomeRollback(res sc.Encodable) TransactionOutcome
type TransactionPriority ¶
type TransactionSource ¶
type TransactionSource sc.VaryingData
func DecodeTransactionSource ¶
func DecodeTransactionSource(buffer *bytes.Buffer) (TransactionSource, error)
func NewTransactionSourceExternal ¶
func NewTransactionSourceExternal() TransactionSource
func NewTransactionSourceInBlock ¶
func NewTransactionSourceInBlock() TransactionSource
func NewTransactionSourceLocal ¶
func NewTransactionSourceLocal() TransactionSource
func (TransactionSource) Bytes ¶
func (ts TransactionSource) Bytes() []byte
func (TransactionSource) MetadataDefinition ¶
func (ts TransactionSource) MetadataDefinition() *MetadataTypeDefinition
type TransactionValidityError ¶
type TransactionValidityError struct {
sc.VaryingData
}
TransactionValidityError Errors that can occur while checking the validity of a transaction.
func DecodeTransactionValidityError ¶
func DecodeTransactionValidityError(buffer *bytes.Buffer) (TransactionValidityError, error)
func (TransactionValidityError) Encode ¶
func (e TransactionValidityError) Encode(buffer *bytes.Buffer) error
func (TransactionValidityError) Error ¶
func (err TransactionValidityError) Error() string
func (TransactionValidityError) MetadataDefinition ¶
func (e TransactionValidityError) MetadataDefinition(typesInvalidTxId int, typesUnknownTxId int) *MetadataTypeDefinition
type TransactionValidityResult ¶
type TransactionValidityResult sc.VaryingData
TransactionValidityResult Information on a transaction's validity and, if valid, on how it relates to other transactions.
func DecodeTransactionValidityResult ¶
func DecodeTransactionValidityResult(buffer *bytes.Buffer) (TransactionValidityResult, error)
func NewTransactionValidityResult ¶
func NewTransactionValidityResult(value sc.Encodable) (TransactionValidityResult, error)
func (TransactionValidityResult) AsValidTransaction ¶
func (r TransactionValidityResult) AsValidTransaction() (ValidTransaction, error)
func (TransactionValidityResult) Bytes ¶
func (r TransactionValidityResult) Bytes() []byte
func (TransactionValidityResult) Encode ¶
func (r TransactionValidityResult) Encode(buffer *bytes.Buffer) error
func (TransactionValidityResult) IsValidTransaction ¶
func (r TransactionValidityResult) IsValidTransaction() bool
func (TransactionValidityResult) MetadataDefinition ¶
func (r TransactionValidityResult) MetadataDefinition(typesValidTransactionId int, typesValidityErrorId int) *MetadataTypeDefinition
type TransactionalError ¶
type TransactionalError sc.VaryingData
func DecodeTransactionalError ¶
func DecodeTransactionalError(buffer *bytes.Buffer) (TransactionalError, error)
func NewTransactionalErrorLimitReached ¶
func NewTransactionalErrorLimitReached() TransactionalError
func NewTransactionalErrorNoLayer ¶
func NewTransactionalErrorNoLayer() TransactionalError
func (TransactionalError) Bytes ¶
func (err TransactionalError) Bytes() []byte
func (TransactionalError) Error ¶
func (err TransactionalError) Error() string
type UncheckedExtrinsic ¶
type UncheckedExtrinsic interface { sc.Encodable Signature() sc.Option[ExtrinsicSignature] Function() Call Extra() SignedExtra IsSigned() bool Check() (CheckedExtrinsic, error) }
type UnknownTransaction ¶
type UnknownTransaction struct {
sc.VaryingData
}
func DecodeUnknownTransaction ¶
func DecodeUnknownTransaction(buffer *bytes.Buffer) (UnknownTransaction, error)
func NewUnknownTransactionCannotLookup ¶
func NewUnknownTransactionCannotLookup() UnknownTransaction
func NewUnknownTransactionCustomUnknownTransaction ¶
func NewUnknownTransactionCustomUnknownTransaction(unknown sc.U8) UnknownTransaction
func NewUnknownTransactionNoUnsignedValidator ¶
func NewUnknownTransactionNoUnsignedValidator() UnknownTransaction
func (UnknownTransaction) Error ¶
func (err UnknownTransaction) Error() string
func (UnknownTransaction) MetadataDefinition ¶
func (err UnknownTransaction) MetadataDefinition() *MetadataTypeDefinition
type UnsignedValidator ¶
type UnsignedValidator interface { // PreDispatch validates the call right before dispatch. // // This method should be used to prevent transactions already in the pool // (i.e. passing [`validate_unsigned`](Self::validate_unsigned)) from being included in blocks // in case they became invalid since being added to the pool. // // By default it's a good idea to call [`validate_unsigned`](Self::validate_unsigned) from // within this function again to make sure we never include an invalid transaction. Otherwise // the implementation of the call or this method will need to provide proper validation to // ensure that the transaction is valid. // // Changes made to storage *WILL* be persisted if the call returns `Ok`. PreDispatch(call Call) (ok sc.Empty, err error) // ValidateUnsigned returns the validity of the call // // This method has no side-effects. It merely checks whether the call would be rejected // by the runtime in an unsigned extrinsic. // // The validity checks should be as lightweight as possible because every node will execute // this code before the unsigned extrinsic enters the transaction pool and also periodically // afterwards to ensure the validity. To prevent dos-ing a network with unsigned // extrinsics, these validity checks should include some checks around uniqueness, for example, // like checking that the unsigned extrinsic was send by an authority in the active set. // // Changes made to storage should be discarded by caller. ValidateUnsigned(source TransactionSource, call Call) (ok ValidTransaction, err error) }
UnsignedValidator provides validation for unsigned extrinsics.
This trait provides two functions [`pre_dispatch`](Self::pre_dispatch) and [`validate_unsigned`](Self::validate_unsigned). The [`pre_dispatch`](Self::pre_dispatch) function is called right before dispatching the call wrapped by an unsigned extrinsic. The [`validate_unsigned`](Self::validate_unsigned) function is mainly being used in the context of the transaction pool to check the validity of the call wrapped by an unsigned extrinsic.
type ValidTransaction ¶
type ValidTransaction struct { // Priority of the transaction. // // Priority determines the ordering of two transactions that have all // their dependencies (required tags) satisfied. Priority TransactionPriority // Transaction dependencies // // A non-empty list signifies that some other transactions which provide // given tags are required to be included before that one. Requires sc.Sequence[TransactionTag] // Provided tags // // A list of tags this transaction provides. Successfully importing the transaction // will enable other transactions that depend on (require) those tags to be included as well. // Provided and required tags allow Substrate to build a dependency graph of transactions // and import them in the right (linear) order. Provides sc.Sequence[TransactionTag] // Transaction longevity // // Longevity describes minimum number of blocks the validity is correct. // After this period transaction should be removed from the pool or revalidated. Longevity TransactionLongevity // A flag indicating if the transaction should be propagated to other peers. // // By setting `false` here the transaction will still be considered for // including in blocks that are authored on the current node, but will // never be sent to other peers. Propagate sc.Bool }
ValidTransaction Contains information concerning a valid transaction.
func DecodeValidTransaction ¶
func DecodeValidTransaction(buffer *bytes.Buffer) (ValidTransaction, error)
func DefaultValidTransaction ¶
func DefaultValidTransaction() ValidTransaction
func (ValidTransaction) Bytes ¶
func (tx ValidTransaction) Bytes() []byte
func (ValidTransaction) CombineWith ¶
func (vt ValidTransaction) CombineWith(otherVt ValidTransaction) ValidTransaction
Combine two instances into one, as a best effort. This will take the superset of each of the `provides` and `requires` tags, it will sum the priorities, take the minimum longevity and the logic *And* of the propagate flags.
type Validator ¶
type Validator struct { AccountId AccountId AuthorityId Sr25519PublicKey }
type VrfSignature ¶
type VrfSignature struct { PreOutput sc.FixedSequence[sc.U8] Proof sc.FixedSequence[sc.U8] }
VRF signature data
func DecodeVrfSignature ¶
func DecodeVrfSignature(buffer *bytes.Buffer) (VrfSignature, error)
func NewVrfSignature ¶
func NewVrfSignature(output, proof sc.FixedSequence[sc.U8]) (VrfSignature, error)
func (VrfSignature) Bytes ¶
func (s VrfSignature) Bytes() []byte
type Weight ¶
type Weight struct { // The weight of computational time used based on some reference hardware. RefTime sc.U64 // The weight of storage space used by proof of validity. ProofSize sc.U64 }
func WeightFromParts ¶
Construct [`Weight`] from weight parts, namely reference time and proof size weights.
func (Weight) AllGt ¶
AllGt Returns true if all of `self`'s constituent weights is strictly greater than that of the `other`'s, otherwise returns false.
func (Weight) AnyGt ¶
AnyGt Returns true if any of `self`'s constituent weights is strictly greater than that of the `other`'s, otherwise returns false.
func (Weight) CheckedAdd ¶
Checked [`Weight`] addition. Computes `self + rhs`, returning `None` if overflow occurred.
func (*Weight) SaturatingAccrue ¶
Increment [`Weight`] by `amount` via saturating addition.
func (Weight) SaturatingAdd ¶
func (*Weight) SaturatingReduce ¶
Reduce [`Weight`] by `amount` via saturating subtraction.
func (Weight) SaturatingSub ¶
Saturating [`Weight`] subtraction. Computes `self - rhs`, saturating at the numeric bounds of all fields instead of overflowing.
type WeightToFee ¶
type WeightsPerClass ¶
type WeightsPerClass struct { // Base weight of single extrinsic of given class. BaseExtrinsic Weight // Maximal weight of single extrinsic. Should NOT include `base_extrinsic` cost. // // `None` indicates that this class of extrinsics doesn't have a limit. MaxExtrinsic sc.Option[Weight] // Block maximal total weight for all extrinsics of given class. // // `None` indicates that weight sum of this class of extrinsics is not // restricted. Use this value carefully, since it might produce heavily oversized // blocks. // // In the worst case, the total weight consumed by the class is going to be: // `MAX(max_total) + MAX(reserved)`. MaxTotal sc.Option[Weight] // Block reserved allowance for all extrinsics of a particular class. // // Setting to `None` indicates that extrinsics of that class are allowed // to go over total block weight (but at most `max_total` for that class). // Setting to `Some(x)` guarantees that at least `x` weight of particular class // is processed in every block. Reserved sc.Option[Weight] }
WeightsPerClass `DispatchClass`-specific weight configuration.
func DecodeWeightsPerClass ¶
func DecodeWeightsPerClass(buffer *bytes.Buffer) (WeightsPerClass, error)
func (WeightsPerClass) Bytes ¶
func (cl WeightsPerClass) Bytes() []byte
Source Files ¶
- account_data.go
- account_id.go
- account_info.go
- api_item.go
- api_module.go
- apply_extrinsic_result.go
- arithmetic_error.go
- authority.go
- block.go
- block_hash_count.go
- block_length.go
- block_weights.go
- call.go
- callable.go
- check_inherents_error.go
- check_inherents_result.go
- checked_extrinsic.go
- consumed_weight.go
- currency_adapter.go
- dec_ref_status.go
- digest.go
- digest_item.go
- digest_pre_runtime.go
- digest_seal.go
- dispatch_class.go
- dispatch_errors.go
- dispatch_info.go
- dispatch_outcome.go
- ecdsa_verify_error.go
- era.go
- errors.go
- event.go
- event_depositor.go
- existence_requirement.go
- existential_deposit.go
- extra.go
- extrinsic_phase.go
- extrinsic_signature.go
- extrinsic_signature_payload.go
- fatal_error.go
- find_author.go
- flags.go
- hash_256.go
- hash_512.go
- hash_blake2b.go
- header.go
- hooks.go
- identity_fee.go
- inc_ref_status.go
- inherent.go
- inherent_data.go
- invalid_transaction.go
- last_runtime_upgrade_info.go
- lookup.go
- max_locks.go
- max_reserves.go
- metadata.go
- metadata_extrinsic.go
- metadata_generator.go
- metadata_module.go
- metadata_runtime_api.go
- metadata_type_definition.go
- metadata_v14.go
- metadata_v15.go
- module.go
- multi_address.go
- multi_signature.go
- pays.go
- per_dispatch_class.go
- per_dispatch_class_u32.go
- per_dispatch_class_weight.go
- per_dispatch_class_weights_per_class.go
- perthings.go
- post_dispatch_info.go
- pre.go
- public_key.go
- public_key_ecdsa.go
- public_key_ed25519.go
- public_key_sr25519.go
- public_key_type.go
- raw_origin.go
- reasons.go
- runtime_api_module.go
- runtime_db_weight.go
- runtime_dispatch_info.go
- runtime_origin.go
- runtime_version.go
- session.go
- session_key.go
- signature_ecdsa.go
- signature_ed25519.go
- signature_sr25519.go
- signed_extension.go
- stored_map.go
- timestamp_error.go
- token_error.go
- transaction_outcome.go
- transaction_source.go
- transaction_validity_error.go
- transaction_validity_result.go
- transactional_error.go
- tuples.go
- unchecked_extrinsic.go
- unknown_transaction.go
- unsigned_validator.go
- valid_transaction.go
- validation.go
- validator.go
- vrf_signature.go
- weight.go
- weight_per_class.go
- weight_to_fee.go
- withdraw_reasons.go