Documentation ¶
Index ¶
- Constants
- func DecodeBalanceStatus(buffer *bytes.Buffer) sc.U8
- func EraTypeDefinition() sc.Sequence[MetadataDefinitionVariant]
- func LookupAddress(a MultiAddress) sc.Option[Address32]
- func LookupIndex(index AccountIndex) sc.Option[Address32]
- type AccountData
- type AccountId
- type AccountIdExtra
- type AccountIdLookup
- type AccountIndex
- type AccountInfo
- type AccountRaw
- type AdditionalSigned
- type Address20
- type Address32
- type ApiItem
- type ApplyExtrinsicResult
- type ArithmeticError
- type Authority
- type Balance
- type BalanceStatus
- type Blake2bHash
- type BlockNumber
- type Call
- type Callable
- type CheckInherentsResult
- type ConstantMultiplier
- type ConsumedWeight
- func (cw *ConsumedWeight) Accrue(weight Weight, class DispatchClass)
- func (cw ConsumedWeight) Bytes() []byte
- func (cw *ConsumedWeight) CheckedAccrue(weight Weight, class DispatchClass) (ok sc.Empty, err error)
- func (cw ConsumedWeight) Encode(buffer *bytes.Buffer)
- func (cw *ConsumedWeight) Get(class DispatchClass) *Weight
- func (cw *ConsumedWeight) Reduce(weight Weight, class DispatchClass)
- func (cw *ConsumedWeight) SaturatingAdd(weight Weight, class DispatchClass)
- func (cw ConsumedWeight) Total() Weight
- type CustomModuleError
- type DecRefStatus
- type Digest
- type DigestItem
- type DispatchClass
- type DispatchError
- func DecodeDispatchError(buffer *bytes.Buffer) DispatchError
- 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 DispatchErrorWithPostInfo
- type DispatchInfo
- type DispatchOutcome
- type DispatchResult
- type DispatchResultWithPostInfo
- type Ecdsa
- type Ed25519
- type Era
- type Event
- type EventRecord
- type ExistenceRequirement
- type ExtrinsicPhase
- type ExtrinsicSignature
- type FeeDetails
- type H256
- type H512
- type Header
- type IdentityFee
- type IncRefStatus
- type InclusionFee
- type InherentData
- type InherentError
- type InvalidTransaction
- func DecodeInvalidTransaction(buffer *bytes.Buffer) InvalidTransaction
- 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 IsFatalError
- type LastRuntimeUpgradeInfo
- type Metadata
- type MetadataDefinitionPrimitive
- type MetadataDefinitionVariant
- type MetadataExtrinsic
- type MetadataModule
- type MetadataModuleConstant
- type MetadataModuleStorage
- type MetadataModuleStorageEntry
- type MetadataModuleStorageEntryDefinition
- func DecodeMetadataModuleStorageEntryDefinition(buffer *bytes.Buffer) MetadataModuleStorageEntryDefinition
- func NewMetadataModuleStorageEntryDefinitionMap(storageHashFuncs sc.Sequence[MetadataModuleStorageHashFunc], ...) MetadataModuleStorageEntryDefinition
- func NewMetadataModuleStorageEntryDefinitionPlain(key sc.Compact) MetadataModuleStorageEntryDefinition
- type MetadataModuleStorageEntryModifier
- type MetadataModuleStorageHashFunc
- type MetadataSignedExtension
- type MetadataType
- func DecodeMetadataType(buffer *bytes.Buffer) MetadataType
- 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
- 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
- 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 MetadataTypeParameter
- type Module
- type MultiAddress
- func DecodeMultiAddress(buffer *bytes.Buffer) MultiAddress
- 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
- func (a MultiAddress) AsAccountIndex() AccountIndex
- func (a MultiAddress) AsAddress20() Address20
- func (a MultiAddress) AsAddress32() Address32
- func (a MultiAddress) AsRaw() AccountRaw
- func (a MultiAddress) IsAccountId() sc.Bool
- func (a MultiAddress) IsAccountIndex() sc.Bool
- func (a MultiAddress) IsAddress20() sc.Bool
- func (a MultiAddress) IsAddress32() sc.Bool
- func (a MultiAddress) IsRaw() sc.Bool
- type MultiSignature
- func (s MultiSignature) AsEcdsa() Ecdsa
- func (s MultiSignature) AsEd25519() Ed25519
- func (s MultiSignature) AsSr25519() Sr25519
- func (s MultiSignature) IsEcdsa() sc.Bool
- func (s MultiSignature) IsEd25519() sc.Bool
- func (s MultiSignature) IsSr25519() sc.Bool
- func (s MultiSignature) Verify(msg sc.Sequence[sc.U8], signer Address32) sc.Bool
- type Pays
- type PerDispatchClass
- type Perbill
- type PostDispatchInfo
- type Pre
- type PublicKey
- type RawOrigin
- type Reasons
- type RefCount
- type RuntimeDbWeight
- type RuntimeDispatchInfo
- type RuntimeMetadataV14
- type RuntimeOrigin
- type RuntimeVersion
- type SessionKey
- type SignedExtra
- type SignedPayload
- type Sr25519
- type TimestampError
- type TokenError
- func DecodeTokenError(buffer *bytes.Buffer) TokenError
- func NewTokenErrorBelowMinimum() TokenError
- func NewTokenErrorCannotCreate() TokenError
- func NewTokenErrorFrozen() TokenError
- func NewTokenErrorNoFounds() TokenError
- func NewTokenErrorUnknownAsset() TokenError
- func NewTokenErrorUnsupported() TokenError
- func NewTokenErrorWouldDie() TokenError
- type TransactionLongevity
- type TransactionOutcome
- type TransactionPriority
- type TransactionSource
- type TransactionTag
- type TransactionValidityError
- type TransactionValidityResult
- type TransactionalError
- type UnknownTransaction
- type ValidTransaction
- type VersionedAuthorityList
- type Weight
- func (w Weight) Add(rhs Weight) Weight
- func (w Weight) AllGt(rhs Weight) sc.Bool
- func (w Weight) AnyGt(otherW Weight) sc.Bool
- func (w Weight) Bytes() []byte
- func (w Weight) CheckedAdd(rhs Weight) sc.Option[Weight]
- func (w Weight) Encode(buffer *bytes.Buffer)
- 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
Constants ¶
const ( ArithmeticErrorUnderflow sc.U8 = iota ArithmeticErrorOverflow ArithmeticErrorDivisionByZero )
const ( BalanceStatusFree sc.U8 = iota BalanceStatusReserved )
const ( InherentErrorInherentDataExists sc.U8 = iota InherentErrorDecodingFailed InherentErrorFatalErrorReported InherentErrorApplication )
const ( DecRefStatusReaped sc.U8 = iota DecRefStatusExists )
const ( DigestTypeConsensusMessage = 4 DigestTypeSeal = 5 DigestTypePreRuntime = 6 DigestTypeRuntimeEnvironmentUpgraded = 8 )
const ( // DispatchClassNormal A normal dispatch. DispatchClassNormal sc.U8 = 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 )
const ( DispatchErrorOther sc.U8 = iota DispatchErrorCannotLookup DispatchErrorBadOrigin DispatchErrorModule DispatchErrorConsumerRemaining DispatchErrorNoProviders DispatchErrorTooManyConsumers DispatchErrorToken DispatchErrorArithmetic DispatchErrorTransactional DispatchErrorExhausted DispatchErrorCorruption )
const ( MetadataReserved sc.U32 = 0x6174656d // "meta" MetadataVersion sc.U8 = 14 )
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 ( // PaysYes Transactor will pay related fees. PaysYes sc.U8 = iota // PaysNo Transactor will NOT pay related fees. PaysNo )
const ( // PhaseApplyExtrinsic Applying an extrinsic. PhaseApplyExtrinsic sc.U8 = iota // PhaseFinalization Finalizing the block. PhaseFinalization // PhaseInitialization Initializing the block. PhaseInitialization )
const ( RawOriginRoot sc.U8 = iota RawOriginSigned RawOriginNone )
const ( TimestampErrorTooEarly sc.U8 = iota TimestampErrorTooFarInFuture )
const ( TokenErrorNoFunds sc.U8 = iota TokenErrorWouldDie TokenErrorBelowMinimum TokenErrorCannotCreate TokenErrorUnknownAsset TokenErrorFrozen TokenErrorUnsupported )
const ( TransactionValidityErrorInvalidTransaction sc.U8 = iota TransactionValidityErrorUnknownTransaction )
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 ( // 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 ( // 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 ( // Too many transactional layers have been spawned. TransactionalErrorLimitReached sc.U8 = iota // A transactional layer was expected, but does not exist. TransactionalErrorNoLayer )
const ( // Commit the transaction. TransactionOutcomeCommit sc.U8 = iota // Rollback the transaction. TransactionOutcomeRollback )
const ( WithdrawReasonsTransactionPayment = 1 << iota WithdrawReasonsTransfer WithdrawReasonsReserve WithdrawReasonsFee WithdrawReasonsTip )
Variables ¶
This section is empty.
Functions ¶
func EraTypeDefinition ¶
func EraTypeDefinition() sc.Sequence[MetadataDefinitionVariant]
func LookupAddress ¶
func LookupAddress(a MultiAddress) sc.Option[Address32]
LookupAddress Lookup an address to get an Id, if there's one there.
func LookupIndex ¶
func LookupIndex(index AccountIndex) sc.Option[Address32]
LookupIndex Lookup an T::AccountIndex to get an Id, if there's one there.
Types ¶
type AccountData ¶
func DecodeAccountData ¶
func DecodeAccountData(buffer *bytes.Buffer) AccountData
func (AccountData) Bytes ¶
func (ad AccountData) Bytes() []byte
func (AccountData) Encode ¶
func (ad AccountData) Encode(buffer *bytes.Buffer)
func (AccountData) Total ¶
func (ad AccountData) Total() *big.Int
type AccountId ¶
type AccountId struct {
Address32 // TODO: Varies depending on Signature (32 for ed25519 and sr25519, 33 for ecdsa)
}
AccountId It's an account ID (pubkey).
func DecodeAccountId ¶
type AccountIdExtra ¶
type AccountIdExtra struct { Address32 SignedExtra }
func DecodeAccountIdExtra ¶
func DecodeAccountIdExtra(buffer *bytes.Buffer) AccountIdExtra
func (AccountIdExtra) Bytes ¶
func (ae AccountIdExtra) Bytes() []byte
func (AccountIdExtra) Encode ¶
func (ae AccountIdExtra) Encode(buffer *bytes.Buffer)
type AccountIdLookup ¶
type AccountIdLookup struct { }
AccountIdLookup A lookup implementation returning the `AccountId` from a `MultiAddress`.
func DefaultAccountIdLookup ¶
func DefaultAccountIdLookup() AccountIdLookup
func (AccountIdLookup) Lookup ¶
func (l AccountIdLookup) Lookup(a MultiAddress) (Address32, TransactionValidityError)
TODO: MultiAddress[AccountId, AccountIndex]
type AccountInfo ¶
type AccountInfo struct { Nonce AccountIndex Consumers RefCount Providers RefCount Sufficients RefCount Data AccountData }
func DecodeAccountInfo ¶
func DecodeAccountInfo(buffer *bytes.Buffer) AccountInfo
func (AccountInfo) Bytes ¶
func (ai AccountInfo) Bytes() []byte
func (AccountInfo) Encode ¶
func (ai AccountInfo) Encode(buffer *bytes.Buffer)
type AccountRaw ¶
AccountRaw It's some arbitrary raw bytes.
func DecodeAccountRaw ¶
func DecodeAccountRaw(buffer *bytes.Buffer) AccountRaw
func (AccountRaw) Encode ¶
func (a AccountRaw) Encode(buffer *bytes.Buffer)
type AdditionalSigned ¶
type Address20 ¶
type Address20 struct { sc.FixedSequence[sc.U8] // size 20 }
Address20 It's a 20 byte representation.
func DecodeAddress20 ¶
func NewAddress20 ¶
type Address32 ¶
type Address32 struct { sc.FixedSequence[sc.U8] // size 32 }
Address32 It's a 32 byte representation.
func DecodeAddress32 ¶
func NewAddress32 ¶
type ApiItem ¶
func DecodeApiItem ¶
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
func NewApplyExtrinsicResult ¶
func NewApplyExtrinsicResult(value sc.Encodable) ApplyExtrinsicResult
func (ApplyExtrinsicResult) Bytes ¶
func (r ApplyExtrinsicResult) Bytes() []byte
func (ApplyExtrinsicResult) Encode ¶
func (r ApplyExtrinsicResult) Encode(buffer *bytes.Buffer)
type ArithmeticError ¶
type ArithmeticError = sc.VaryingData
func DecodeArithmeticError ¶
func DecodeArithmeticError(buffer *bytes.Buffer) ArithmeticError
func NewArithmeticErrorDivisionByZero ¶
func NewArithmeticErrorDivisionByZero() ArithmeticError
func NewArithmeticErrorOverflow ¶
func NewArithmeticErrorOverflow() ArithmeticError
func NewArithmeticErrorUnderflow ¶
func NewArithmeticErrorUnderflow() ArithmeticError
type Authority ¶
func DecodeAuthority ¶
type BalanceStatus ¶
type Blake2bHash ¶
type Blake2bHash struct { sc.FixedSequence[sc.U8] // size 32 }
func DecodeBlake2bHash ¶
func DecodeBlake2bHash(buffer *bytes.Buffer) Blake2bHash
func NewBlake2bHash ¶
func NewBlake2bHash(values ...sc.U8) Blake2bHash
func (Blake2bHash) Bytes ¶
func (h Blake2bHash) Bytes() []byte
func (Blake2bHash) Encode ¶
func (h Blake2bHash) Encode(buffer *bytes.Buffer)
type BlockNumber ¶
type Call ¶
type Call interface { sc.Encodable ModuleIndex() sc.U8 FunctionIndex() sc.U8 Args() sc.VaryingData Dispatch(origin RuntimeOrigin, args sc.VaryingData) DispatchResultWithPostInfo[PostDispatchInfo] IsInherent() bool BaseWeight(...any) Weight ClassifyDispatch(baseWeight Weight) DispatchClass PaysFee(baseWeight Weight) Pays WeightInfo(baseWeight Weight) Weight DecodeArgs(buffer *bytes.Buffer) Call }
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
func NewCheckInherentsResult ¶
func NewCheckInherentsResult() CheckInherentsResult
func (CheckInherentsResult) Encode ¶
func (cir CheckInherentsResult) Encode(buffer *bytes.Buffer)
func (CheckInherentsResult) PutError ¶
func (cir CheckInherentsResult) PutError(inherentIdentifier [8]byte, error IsFatalError) error
type ConstantMultiplier ¶
type ConstantMultiplier struct {
Multiplier Balance
}
func NewConstantMultiplier ¶
func NewConstantMultiplier(multiplier Balance) ConstantMultiplier
func (ConstantMultiplier) WeightToFee ¶
func (cm ConstantMultiplier) WeightToFee(weight Weight) Balance
type ConsumedWeight ¶
type ConsumedWeight PerDispatchClass[Weight]
An object to track the currently used extrinsic weight in a block.
func DecodeConsumedWeight ¶
func DecodeConsumedWeight(buffer *bytes.Buffer) ConsumedWeight
func (*ConsumedWeight) Accrue ¶
func (cw *ConsumedWeight) Accrue(weight Weight, class DispatchClass)
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) (ok sc.Empty, err error)
CheckedAccrue Try to increase the weight of the given class. Saturates at the numeric bounds.
func (ConsumedWeight) Encode ¶
func (cw ConsumedWeight) Encode(buffer *bytes.Buffer)
func (*ConsumedWeight) Get ¶
func (cw *ConsumedWeight) Get(class DispatchClass) *Weight
Get current value for given class.
func (*ConsumedWeight) Reduce ¶
func (cw *ConsumedWeight) Reduce(weight Weight, class DispatchClass)
Reduce the weight of the given class. Saturates at the numeric bounds.
func (*ConsumedWeight) SaturatingAdd ¶
func (cw *ConsumedWeight) SaturatingAdd(weight Weight, class DispatchClass)
SaturatingAdd Increase the weight of the given class. Saturates at the numeric bounds.
func (ConsumedWeight) Total ¶
func (cw ConsumedWeight) Total() Weight
Returns the total weight consumed by all extrinsics in the block.
Saturates on overflow.
type CustomModuleError ¶
type CustomModuleError struct { Index sc.U8 // Module index matching the metadata module index. Error 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
func (CustomModuleError) Bytes ¶
func (e CustomModuleError) Bytes() []byte
func (CustomModuleError) Encode ¶
func (e CustomModuleError) Encode(buffer *bytes.Buffer)
type DecRefStatus ¶
type DigestItem ¶
func DecodeDigestItem ¶
func DecodeDigestItem(buffer *bytes.Buffer) DigestItem
func (DigestItem) Bytes ¶
func (di DigestItem) Bytes() []byte
func (DigestItem) Encode ¶
func (di DigestItem) Encode(buffer *bytes.Buffer)
type DispatchClass ¶
type DispatchClass struct {
sc.VaryingData
}
A generalized group of dispatch types.
func DecodeDispatchClass ¶
func DecodeDispatchClass(buffer *bytes.Buffer) DispatchClass
func DispatchClassAll ¶
func DispatchClassAll() []DispatchClass
Returns an array containing all dispatch classes.
func NewDispatchClassMandatory ¶
func NewDispatchClassMandatory() DispatchClass
func NewDispatchClassNormal ¶
func NewDispatchClassNormal() DispatchClass
func NewDispatchClassOperational ¶
func NewDispatchClassOperational() DispatchClass
type DispatchError ¶
type DispatchError = sc.VaryingData
func DecodeDispatchError ¶
func DecodeDispatchError(buffer *bytes.Buffer) DispatchError
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
type DispatchErrorWithPostInfo ¶
type DispatchErrorWithPostInfo[T sc.Encodable] struct { // Additional information about the `Dispatchable` which is only known post dispatch. PostInfo T // The actual `DispatchResult` indicating whether the dispatch was successful. Error DispatchError }
DispatchErrorWithPostInfo Result of a `Dispatchable` which contains the `DispatchResult` and additional information about the `Dispatchable` that is only known post dispatch.
func DecodeErrorWithPostInfo ¶
func DecodeErrorWithPostInfo(buffer *bytes.Buffer) DispatchErrorWithPostInfo[PostDispatchInfo]
func (DispatchErrorWithPostInfo[PostDispatchInfo]) Bytes ¶
func (e DispatchErrorWithPostInfo[PostDispatchInfo]) Bytes() []byte
func (DispatchErrorWithPostInfo[PostDispatchInfo]) Encode ¶
func (e DispatchErrorWithPostInfo[PostDispatchInfo]) Encode(buffer *bytes.Buffer)
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
func GetDispatchInfo ¶
func GetDispatchInfo(call Call) DispatchInfo
func (DispatchInfo) Bytes ¶
func (di DispatchInfo) Bytes() []byte
func (DispatchInfo) Encode ¶
func (di DispatchInfo) Encode(buffer *bytes.Buffer)
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
func NewDispatchOutcome ¶
func NewDispatchOutcome(value sc.Encodable) DispatchOutcome
func (DispatchOutcome) Bytes ¶
func (o DispatchOutcome) Bytes() []byte
func (DispatchOutcome) Encode ¶
func (o DispatchOutcome) Encode(buffer *bytes.Buffer)
type DispatchResult ¶
type DispatchResult sc.VaryingData
func NewDispatchResult ¶
func NewDispatchResult(value sc.Encodable) DispatchResult
type DispatchResultWithPostInfo ¶
type DispatchResultWithPostInfo[T sc.Encodable] struct { HasError sc.Bool Ok T Err DispatchErrorWithPostInfo[T] }
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 = sc.VaryingData
type EventRecord ¶
type EventRecord struct { Phase ExtrinsicPhase Event Event Topics sc.Sequence[H256] }
func (EventRecord) Bytes ¶
func (er EventRecord) Bytes() []byte
func (EventRecord) Encode ¶
func (er EventRecord) Encode(buffer *bytes.Buffer)
type ExistenceRequirement ¶
const ( ExistenceRequirementKeepAlive ExistenceRequirement = iota ExistenceRequirementAllowDeath )
type ExtrinsicPhase ¶
type ExtrinsicPhase = sc.VaryingData
func DecodeExtrinsicPhase ¶
func DecodeExtrinsicPhase(buffer *bytes.Buffer) ExtrinsicPhase
func NewExtrinsicPhaseApply ¶
func NewExtrinsicPhaseApply(index sc.U32) ExtrinsicPhase
func NewExtrinsicPhaseFinalization ¶
func NewExtrinsicPhaseFinalization() ExtrinsicPhase
func NewExtrinsicPhaseInitialization ¶
func NewExtrinsicPhaseInitialization() ExtrinsicPhase
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(buffer *bytes.Buffer) ExtrinsicSignature
func (ExtrinsicSignature) Bytes ¶
func (s ExtrinsicSignature) Bytes() []byte
func (ExtrinsicSignature) Encode ¶
func (s ExtrinsicSignature) Encode(buffer *bytes.Buffer)
type FeeDetails ¶
type FeeDetails struct { InclusionFee sc.Option[InclusionFee] Tip Balance // not serializable }
func DecodeFeeDetails ¶
func DecodeFeeDetails(buffer *bytes.Buffer) FeeDetails
func (FeeDetails) Bytes ¶
func (fd FeeDetails) Bytes() []byte
func (FeeDetails) Encode ¶
func (fd FeeDetails) Encode(buffer *bytes.Buffer)
func (FeeDetails) FinalFee ¶
func (fd FeeDetails) FinalFee() Balance
type Header ¶
type Header struct { ParentHash Blake2bHash Number BlockNumber StateRoot H256 ExtrinsicsRoot H256 Digest Digest }
func DecodeHeader ¶
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 )
type InclusionFee ¶
func DecodeInclusionFee ¶
func DecodeInclusionFee(buffer *bytes.Buffer) InclusionFee
func NewInclusionFee ¶
func NewInclusionFee(baseFee, lenFee, adjustedWeightFee Balance) InclusionFee
func (InclusionFee) Bytes ¶
func (i InclusionFee) Bytes() []byte
func (InclusionFee) Encode ¶
func (i InclusionFee) Encode(buffer *bytes.Buffer)
func (InclusionFee) InclusionFee ¶
func (i InclusionFee) InclusionFee() Balance
type InherentData ¶
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()
func (*InherentData) Encode ¶
func (id *InherentData) Encode(buffer *bytes.Buffer)
type InherentError ¶
type InherentError struct {
sc.VaryingData
}
func NewInherentErrorApplication ¶
func NewInherentErrorApplication() InherentError
func NewInherentErrorDecodingFailed ¶
func NewInherentErrorDecodingFailed(inherentIdentifier sc.Sequence[sc.U8]) InherentError
func NewInherentErrorFatalErrorReported ¶
func NewInherentErrorFatalErrorReported() InherentError
func NewInherentErrorInherentDataExists ¶
func NewInherentErrorInherentDataExists(inherentIdentifier sc.Sequence[sc.U8]) InherentError
func (InherentError) Error ¶
func (ie InherentError) Error() string
func (InherentError) IsFatal ¶
func (ie InherentError) IsFatal() sc.Bool
type InvalidTransaction ¶
type InvalidTransaction struct {
sc.VaryingData
}
func DecodeInvalidTransaction ¶
func DecodeInvalidTransaction(buffer *bytes.Buffer) InvalidTransaction
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) Bytes ¶
func (e InvalidTransaction) Bytes() []byte
type LastRuntimeUpgradeInfo ¶
func DecodeLastRuntimeUpgradeInfo ¶
func DecodeLastRuntimeUpgradeInfo(buffer *bytes.Buffer) (value LastRuntimeUpgradeInfo)
func (LastRuntimeUpgradeInfo) Bytes ¶
func (lrui LastRuntimeUpgradeInfo) Bytes() []byte
func (LastRuntimeUpgradeInfo) Encode ¶
func (lrui LastRuntimeUpgradeInfo) Encode(buffer *bytes.Buffer)
type Metadata ¶
type Metadata struct {
Data RuntimeMetadataV14
}
func NewMetadata ¶
func NewMetadata(data RuntimeMetadataV14) Metadata
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
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
func NewMetadataDefinitionVariant ¶
func NewMetadataDefinitionVariant(name string, fields sc.Sequence[MetadataTypeDefinitionField], index sc.U8, docs string) MetadataDefinitionVariant
func (MetadataDefinitionVariant) Bytes ¶
func (mdv MetadataDefinitionVariant) Bytes() []byte
func (MetadataDefinitionVariant) Encode ¶
func (mdv MetadataDefinitionVariant) Encode(buffer *bytes.Buffer)
type MetadataExtrinsic ¶
type MetadataExtrinsic struct { Type sc.Compact Version sc.U8 SignedExtensions sc.Sequence[MetadataSignedExtension] }
func DecodeMetadataExtrinsic ¶
func DecodeMetadataExtrinsic(buffer *bytes.Buffer) MetadataExtrinsic
func (MetadataExtrinsic) Bytes ¶
func (me MetadataExtrinsic) Bytes() []byte
func (MetadataExtrinsic) Encode ¶
func (me MetadataExtrinsic) Encode(buffer *bytes.Buffer)
type MetadataModule ¶
type MetadataModule struct { Name sc.Str Storage sc.Option[MetadataModuleStorage] Call sc.Option[sc.Compact] Event sc.Option[sc.Compact] Constants sc.Sequence[MetadataModuleConstant] Error sc.Option[sc.Compact] Index sc.U8 }
func DecodeMetadataModule ¶
func DecodeMetadataModule(buffer *bytes.Buffer) MetadataModule
func (MetadataModule) Bytes ¶
func (mm MetadataModule) Bytes() []byte
func (MetadataModule) Encode ¶
func (mm MetadataModule) Encode(buffer *bytes.Buffer)
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
func (MetadataModuleConstant) Bytes ¶
func (mmc MetadataModuleConstant) Bytes() []byte
func (MetadataModuleConstant) Encode ¶
func (mmc MetadataModuleConstant) Encode(buffer *bytes.Buffer)
type MetadataModuleStorage ¶
type MetadataModuleStorage struct { Prefix sc.Str Items sc.Sequence[MetadataModuleStorageEntry] }
func DecodeMetadataModuleStorage ¶
func DecodeMetadataModuleStorage(buffer *bytes.Buffer) MetadataModuleStorage
func (MetadataModuleStorage) Bytes ¶
func (mms MetadataModuleStorage) Bytes() []byte
func (MetadataModuleStorage) Encode ¶
func (mms MetadataModuleStorage) Encode(buffer *bytes.Buffer)
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
func NewMetadataModuleStorageEntry ¶
func NewMetadataModuleStorageEntry(name string, modifier MetadataModuleStorageEntryModifier, definition MetadataModuleStorageEntryDefinition, docs string) MetadataModuleStorageEntry
func (MetadataModuleStorageEntry) Bytes ¶
func (mmse MetadataModuleStorageEntry) Bytes() []byte
func (MetadataModuleStorageEntry) Encode ¶
func (mmse MetadataModuleStorageEntry) Encode(buffer *bytes.Buffer)
type MetadataModuleStorageEntryDefinition ¶
type MetadataModuleStorageEntryDefinition = sc.VaryingData
func DecodeMetadataModuleStorageEntryDefinition ¶
func DecodeMetadataModuleStorageEntryDefinition(buffer *bytes.Buffer) MetadataModuleStorageEntryDefinition
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
type MetadataModuleStorageHashFunc ¶
const ( MetadataModuleStorageHashFuncBlake128 MetadataModuleStorageHashFunc = iota MetadataModuleStorageHashFuncBlake256 MetadataModuleStorageHashFuncMultiBlake128Concat MetadataModuleStorageHashFuncXX128 MetadataModuleStorageHashFuncXX256 MetadataModuleStorageHashFuncMultiXX64 MetadataModuleStorageHashFuncIdentity )
func DecodeMetadataModuleStorageHashFunc ¶
func DecodeMetadataModuleStorageHashFunc(buffer *bytes.Buffer) MetadataModuleStorageHashFunc
type MetadataSignedExtension ¶
type MetadataSignedExtension struct { Identifier sc.Str Type sc.Compact AdditionalSigned sc.Compact }
func DecodeMetadataSignedExtension ¶
func DecodeMetadataSignedExtension(buffer *bytes.Buffer) MetadataSignedExtension
func NewMetadataSignedExtension ¶
func NewMetadataSignedExtension(identifier sc.Str, typeIndex, additionalSigned int) MetadataSignedExtension
func (MetadataSignedExtension) Bytes ¶
func (mse MetadataSignedExtension) Bytes() []byte
func (MetadataSignedExtension) Encode ¶
func (mse MetadataSignedExtension) Encode(buffer *bytes.Buffer)
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
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
func (MetadataType) Encode ¶
func (mt MetadataType) Encode(buffer *bytes.Buffer)
type MetadataTypeDefinition ¶
type MetadataTypeDefinition = sc.VaryingData
func DecodeMetadataTypeDefinition ¶
func DecodeMetadataTypeDefinition(buffer *bytes.Buffer) MetadataTypeDefinition
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
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
func (MetadataTypeDefinitionField) Encode ¶
func (mtdf MetadataTypeDefinitionField) Encode(buffer *bytes.Buffer)
type MetadataTypeParameter ¶
func DecodeMetadataTypeParameter ¶
func DecodeMetadataTypeParameter(buffer *bytes.Buffer) MetadataTypeParameter
func NewMetadataEmptyTypeParameter ¶
func NewMetadataEmptyTypeParameter(text string) MetadataTypeParameter
func NewMetadataTypeParameter ¶
func NewMetadataTypeParameter(id int, text string) MetadataTypeParameter
func (MetadataTypeParameter) Bytes ¶
func (mtp MetadataTypeParameter) Bytes() []byte
func (MetadataTypeParameter) Encode ¶
func (mtp MetadataTypeParameter) Encode(buffer *bytes.Buffer)
type Module ¶
type Module interface { Functions() map[sc.U8]Call PreDispatch(call Call) (sc.Empty, TransactionValidityError) ValidateUnsigned(source TransactionSource, call Call) (ValidTransaction, TransactionValidityError) Metadata() (sc.Sequence[MetadataType], MetadataModule) }
type MultiAddress ¶
type MultiAddress struct {
sc.VaryingData
}
func DecodeMultiAddress ¶
func DecodeMultiAddress(buffer *bytes.Buffer) MultiAddress
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
func (MultiAddress) AsAccountIndex ¶
func (a MultiAddress) AsAccountIndex() AccountIndex
func (MultiAddress) AsAddress20 ¶
func (a MultiAddress) AsAddress20() Address20
func (MultiAddress) AsAddress32 ¶
func (a MultiAddress) AsAddress32() Address32
func (MultiAddress) AsRaw ¶
func (a MultiAddress) AsRaw() AccountRaw
func (MultiAddress) IsAccountId ¶
func (a MultiAddress) IsAccountId() sc.Bool
func (MultiAddress) IsAccountIndex ¶
func (a MultiAddress) IsAccountIndex() sc.Bool
func (MultiAddress) IsAddress20 ¶
func (a MultiAddress) IsAddress20() sc.Bool
func (MultiAddress) IsAddress32 ¶
func (a MultiAddress) IsAddress32() sc.Bool
func (MultiAddress) IsRaw ¶
func (a MultiAddress) IsRaw() sc.Bool
type MultiSignature ¶
type MultiSignature struct {
sc.VaryingData
}
func DecodeMultiSignature ¶
func DecodeMultiSignature(buffer *bytes.Buffer) MultiSignature
func NewMultiSignatureEcdsa ¶
func NewMultiSignatureEcdsa(signature Ecdsa) MultiSignature
func NewMultiSignatureEd25519 ¶
func NewMultiSignatureEd25519(signature Ed25519) MultiSignature
func NewMultiSignatureSr25519 ¶
func NewMultiSignatureSr25519(signature Sr25519) MultiSignature
func (MultiSignature) AsEcdsa ¶
func (s MultiSignature) AsEcdsa() Ecdsa
func (MultiSignature) AsEd25519 ¶
func (s MultiSignature) AsEd25519() Ed25519
func (MultiSignature) AsSr25519 ¶
func (s MultiSignature) AsSr25519() Sr25519
func (MultiSignature) IsEcdsa ¶
func (s MultiSignature) IsEcdsa() sc.Bool
func (MultiSignature) IsEd25519 ¶
func (s MultiSignature) IsEd25519() sc.Bool
func (MultiSignature) IsSr25519 ¶
func (s MultiSignature) IsSr25519() sc.Bool
type Pays ¶
type Pays = sc.VaryingData
func DecodePays ¶
func ExtractActualPaysFee ¶
func ExtractActualPaysFee(result *DispatchResultWithPostInfo[PostDispatchInfo], info *DispatchInfo) Pays
ExtractActualPaysFee Extract the actual pays_fee from a dispatch result if any or fall back to the default weight.
func NewPaysYes ¶
func NewPaysYes() Pays
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)
func (*PerDispatchClass[T]) Get ¶
func (pdc *PerDispatchClass[T]) Get(class DispatchClass) *T
Get current value for given class.
type Perbill ¶
func DecodePerbill ¶
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 sc.U8 }
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
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) Encode ¶
func (pdi PostDispatchInfo) Encode(buffer *bytes.Buffer)
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 ¶
Pre is the type that encodes information that can be passed from pre_dispatch to post-dispatch.
type PublicKey ¶
type PublicKey = sc.FixedSequence[sc.U8]
TODO: Extend for different types (ecdsa, ed25519, sr25519)
func DecodePublicKey ¶
type RawOrigin ¶
type RawOrigin struct {
sc.VaryingData // [T AccountId]
}
func NewRawOriginNone ¶
func NewRawOriginNone() RawOrigin
func NewRawOriginRoot ¶
func NewRawOriginRoot() RawOrigin
func NewRawOriginSigned ¶
func (RawOrigin) IsNoneOrigin ¶
func (RawOrigin) IsRootOrigin ¶
func (RawOrigin) IsSignedOrigin ¶
type RuntimeDbWeight ¶
RuntimeDbWeight 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) Encode ¶
func (dbw RuntimeDbWeight) Encode(buffer *bytes.Buffer)
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
func (RuntimeDispatchInfo) Bytes ¶
func (rdi RuntimeDispatchInfo) Bytes() []byte
func (RuntimeDispatchInfo) Encode ¶
func (rdi RuntimeDispatchInfo) Encode(buffer *bytes.Buffer)
type RuntimeMetadataV14 ¶
type RuntimeMetadataV14 struct { Types sc.Sequence[MetadataType] Modules sc.Sequence[MetadataModule] Extrinsic MetadataExtrinsic Type sc.Compact }
func DecodeRuntimeMetadataV14 ¶
func DecodeRuntimeMetadataV14(buffer *bytes.Buffer) RuntimeMetadataV14
func (RuntimeMetadataV14) Bytes ¶
func (rm RuntimeMetadataV14) Bytes() []byte
func (RuntimeMetadataV14) Encode ¶
func (rm RuntimeMetadataV14) Encode(buffer *bytes.Buffer)
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
func (RuntimeVersion) Bytes ¶
func (rv RuntimeVersion) Bytes() []byte
func (RuntimeVersion) Encode ¶
func (rv RuntimeVersion) Encode(buffer *bytes.Buffer)
type SessionKey ¶
func DecodeSessionKey ¶
func DecodeSessionKey(buffer *bytes.Buffer) SessionKey
func NewSessionKey ¶
func NewSessionKey(key []byte, typeId [4]byte) SessionKey
func (SessionKey) Bytes ¶
func (sk SessionKey) Bytes() []byte
func (SessionKey) Encode ¶
func (sk SessionKey) Encode(buffer *bytes.Buffer)
type SignedExtra ¶
type SignedExtra struct { Era Era // a compact integer containing the nonce of the sender. // The nonce must be incremented by one for each extrinsic created, // otherwise the Polkadot network will reject the extrinsic. Nonce sc.U32 // encode as Compact // a compact integer containing the transactor pay including tip. Fee sc.U128 // encode as Compact }
SignedExtra implements SignedExtension Extra data, E, is a tuple containing additional metadata about the extrinsic and the system it is meant to be executed in.
func DecodeExtra ¶
func DecodeExtra(buffer *bytes.Buffer) SignedExtra
func (SignedExtra) Bytes ¶
func (e SignedExtra) Bytes() []byte
func (SignedExtra) Encode ¶
func (e SignedExtra) Encode(buffer *bytes.Buffer)
type SignedPayload ¶
type SignedPayload struct { Call Call Extra SignedExtra AdditionalSigned }
SignedPayload A payload that has been signed for an unchecked extrinsics.
Note that the payload that we sign to produce unchecked extrinsic signature is going to be different than the `SignaturePayload` - so the thing the extrinsic actually contains.
TODO: make it generic generic::SignedPayload<RuntimeCall, SignedExtra>;
func (SignedPayload) Bytes ¶
func (sp SignedPayload) Bytes() []byte
func (SignedPayload) Encode ¶
func (sp SignedPayload) Encode(buffer *bytes.Buffer)
func (SignedPayload) UsingEncoded ¶
func (sp SignedPayload) UsingEncoded() sc.Sequence[sc.U8]
type TimestampError ¶
type TimestampError struct {
sc.VaryingData
}
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
func NewTokenErrorBelowMinimum ¶
func NewTokenErrorBelowMinimum() TokenError
func NewTokenErrorCannotCreate ¶
func NewTokenErrorCannotCreate() TokenError
func NewTokenErrorFrozen ¶
func NewTokenErrorFrozen() TokenError
func NewTokenErrorNoFounds ¶
func NewTokenErrorNoFounds() TokenError
func NewTokenErrorUnknownAsset ¶
func NewTokenErrorUnknownAsset() TokenError
func NewTokenErrorUnsupported ¶
func NewTokenErrorUnsupported() TokenError
func NewTokenErrorWouldDie ¶
func NewTokenErrorWouldDie() TokenError
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
func NewTransactionSourceExternal ¶
func NewTransactionSourceExternal() TransactionSource
func NewTransactionSourceInBlock ¶
func NewTransactionSourceInBlock() TransactionSource
func NewTransactionSourceLocal ¶
func NewTransactionSourceLocal() TransactionSource
type TransactionValidityError ¶
type TransactionValidityError sc.VaryingData
TransactionValidityError Errors that can occur while checking the validity of a transaction.
func DecodeTransactionValidityError ¶
func DecodeTransactionValidityError(buffer *bytes.Buffer) TransactionValidityError
func NewTransactionValidityError ¶
func NewTransactionValidityError(value sc.Encodable) TransactionValidityError
func (TransactionValidityError) Bytes ¶
func (e TransactionValidityError) Bytes() []byte
func (TransactionValidityError) Encode ¶
func (e TransactionValidityError) Encode(buffer *bytes.Buffer)
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
func NewTransactionValidityResult ¶
func NewTransactionValidityResult(value sc.Encodable) TransactionValidityResult
func (TransactionValidityResult) AsValidTransaction ¶
func (r TransactionValidityResult) AsValidTransaction() ValidTransaction
func (TransactionValidityResult) Bytes ¶
func (r TransactionValidityResult) Bytes() []byte
func (TransactionValidityResult) Encode ¶
func (r TransactionValidityResult) Encode(buffer *bytes.Buffer)
func (TransactionValidityResult) IsValidTransaction ¶
func (r TransactionValidityResult) IsValidTransaction() sc.Bool
type TransactionalError ¶
type TransactionalError = sc.VaryingData
func DecodeTransactionalError ¶
func DecodeTransactionalError(buffer *bytes.Buffer) TransactionalError
func NewTransactionalErrorLimitReached ¶
func NewTransactionalErrorLimitReached() TransactionalError
func NewTransactionalErrorNoLayer ¶
func NewTransactionalErrorNoLayer() TransactionalError
type UnknownTransaction ¶
type UnknownTransaction struct {
sc.VaryingData
}
func DecodeUnknownTransaction ¶
func DecodeUnknownTransaction(buffer *bytes.Buffer) UnknownTransaction
func NewUnknownTransactionCannotLookup ¶
func NewUnknownTransactionCannotLookup() UnknownTransaction
func NewUnknownTransactionCustomUnknownTransaction ¶
func NewUnknownTransactionCustomUnknownTransaction(unknown sc.U8) UnknownTransaction
func NewUnknownTransactionNoUnsignedValidator ¶
func NewUnknownTransactionNoUnsignedValidator() UnknownTransaction
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
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.
func (ValidTransaction) Encode ¶
func (tx ValidTransaction) Encode(buffer *bytes.Buffer)
type VersionedAuthorityList ¶
func DecodeVersionedAuthorityList ¶
func DecodeVersionedAuthorityList(buffer *bytes.Buffer) VersionedAuthorityList
func (VersionedAuthorityList) Bytes ¶
func (val VersionedAuthorityList) Bytes() []byte
func (VersionedAuthorityList) Encode ¶
func (val VersionedAuthorityList) Encode(buffer *bytes.Buffer)
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 DecodeWeight ¶
func ExtractActualWeight ¶
func ExtractActualWeight(result *DispatchResultWithPostInfo[PostDispatchInfo], info *DispatchInfo) Weight
ExtractActualWeight Extract the actual weight from a dispatch result if any or fall back to the default weight.
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 ¶
Source Files ¶
- account_data.go
- account_info.go
- apply_extrinsic_result.go
- arithmetic_error.go
- authority.go
- balance_status.go
- call.go
- check_inherents_result.go
- checked_extrinsic.go
- constant_multiplier.go
- dec_ref_status.go
- digest.go
- digest_item.go
- dispatch_class.go
- dispatch_errors.go
- dispatch_info.go
- dispatch_outcome.go
- dispatch_result.go
- era.go
- event.go
- existence_requirement.go
- extra.go
- extrinsic_signature.go
- extrinsic_signature_payload.go
- fee_details.go
- hash.go
- header.go
- identity_fee.go
- inc_ref_status.go
- inclusion_fee.go
- inherent_data.go
- interfaces.go
- is_fatal_error.go
- last_runtime_upgrade_info.go
- lookup.go
- metadata.go
- metadata_extrinsic.go
- metadata_module.go
- metadata_type_definition.go
- module.go
- multi_address.go
- multi_signature.go
- pays.go
- perthings.go
- phase.go
- post_dispatch_info.go
- pre.go
- public_key.go
- reasons.go
- runtime_dispatch_info.go
- runtime_origin.go
- runtime_version.go
- session_key.go
- signature.go
- timestamp_error.go
- token_error.go
- transaction_errors.go
- transaction_source.go
- transaction_validity_result.go
- transactional_error.go
- transactional_outcome.go
- valid_transaction.go
- versioned_authority_list.go
- weight.go
- weight_to_fee.go
- withdraw_reasons.go