referrerpolicy=no-referrer-when-downgrade
sp_runtime::testing

Type Alias TestXt

Source
pub type TestXt<Call, Extra> = UncheckedExtrinsic<u64, Call, (), Extra>;
Expand description

Extrinsic type with u64 accounts and mocked signatures, used in testing.

Aliased Type§

struct TestXt<Call, Extra> {
    pub preamble: Preamble<u64, (), Extra>,
    pub function: Call,
}

Fields§

§preamble: Preamble<u64, (), Extra>

Information regarding the type of extrinsic this is (inherent or transaction) as well as associated extension (Extension) data if it’s a transaction and a possible signature.

§function: Call

The function that should be called.

Implementations

Source§

impl<Address, Call, Signature, Extension> UncheckedExtrinsic<Address, Call, Signature, Extension>

Source

pub fn new_unsigned(function: Call) -> Self

👎Deprecated: Use new_bare instead

New instance of a bare (ne unsigned) extrinsic. This could be used for an inherent or an old-school “unsigned transaction” (which are new being deprecated in favour of general transactions).

Source

pub fn is_inherent(&self) -> bool

Returns true if this extrinsic instance is an inherent, `false`` otherwise.

Source

pub fn is_signed(&self) -> bool

Returns true if this extrinsic instance is an old-school signed transaction, false otherwise.

Source

pub fn from_parts( function: Call, preamble: Preamble<Address, Signature, Extension>, ) -> Self

Create an UncheckedExtrinsic from a Preamble and the actual Call.

Source

pub fn new_bare(function: Call) -> Self

New instance of a bare (ne unsigned) extrinsic.

Source

pub fn new_bare_legacy(function: Call) -> Self

New instance of a bare (ne unsigned) extrinsic on extrinsic format version 4.

Source

pub fn new_signed( function: Call, signed: Address, signature: Signature, tx_ext: Extension, ) -> Self

New instance of an old-school signed transaction on extrinsic format version 4.

Source

pub fn new_transaction(function: Call, tx_ext: Extension) -> Self

New instance of an new-school unsigned transaction.

Source§

impl<Address, Call: Dispatchable, Signature, Extension: TransactionExtension<Call>> UncheckedExtrinsic<Address, Call, Signature, Extension>

Source

pub fn extension_weight(&self) -> Weight

Returns the weight of the extension of this transaction, if present. If the transaction doesn’t use any extension, the weight returned is equal to zero.

Trait Implementations

Source§

impl<LookupSource, AccountId, Call, Signature, Extension, Lookup> Checkable<Lookup> for UncheckedExtrinsic<LookupSource, Call, Signature, Extension>
where LookupSource: Member + MaybeDisplay, Call: Encode + Member + Dispatchable, Signature: Member + Verify, <Signature as Verify>::Signer: IdentifyAccount<AccountId = AccountId>, Extension: Encode + TransactionExtension<Call>, AccountId: Member + MaybeDisplay, Lookup: Lookup<Source = LookupSource, Target = AccountId>,

Source§

type Checked = CheckedExtrinsic<AccountId, Call, Extension>

Returned if check succeeds.
Source§

fn check( self, lookup: &Lookup, ) -> Result<Self::Checked, TransactionValidityError>

Check self, given an instance of Context.
Source§

fn unchecked_into_checked_i_know_what_i_am_doing( self, lookup: &Lookup, ) -> Result<Self::Checked, TransactionValidityError>

Blindly check self. Read more
Source§

impl<Address: Clone, Call: Clone, Signature: Clone, Extension: Clone> Clone for UncheckedExtrinsic<Address, Call, Signature, Extension>

Source§

fn clone(&self) -> UncheckedExtrinsic<Address, Call, Signature, Extension>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Address: Debug, Call: Debug, Signature: Debug, Extension: Debug> Debug for UncheckedExtrinsic<Address, Call, Signature, Extension>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Address, Call, Signature, Extension> Decode for UncheckedExtrinsic<Address, Call, Signature, Extension>
where Address: Decode, Signature: Decode, Call: Decode, Extension: Decode,

Source§

fn decode<I: Input>(input: &mut I) -> Result<Self, Error>

Attempt to deserialise the value from input.
§

fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self>, ) -> Result<DecodeFinished, Error>
where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§

fn skip<I>(input: &mut I) -> Result<(), Error>
where I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
Source§

impl<'a, Address: Decode, Signature: Decode, Call: Decode, Extension: Decode> Deserialize<'a> for UncheckedExtrinsic<Address, Call, Signature, Extension>

Source§

fn deserialize<D>(de: D) -> Result<Self, D::Error>
where D: Deserializer<'a>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<Address, Call, Signature, Extension> Encode for UncheckedExtrinsic<Address, Call, Signature, Extension>
where Preamble<Address, Signature, Extension>: Encode, Call: Encode, Extension: Encode,

Source§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
§

fn encode_to<T>(&self, dest: &mut T)
where T: Output + ?Sized,

Convert self to a slice and append it to the destination.
§

fn using_encoded<R, F>(&self, f: F) -> R
where F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
Source§

impl<Address: TypeInfo, Call: TypeInfo, Signature: TypeInfo, Extension: TypeInfo> ExtrinsicLike for UncheckedExtrinsic<Address, Call, Signature, Extension>

Source§

fn is_bare(&self) -> bool

Returns true if this Extrinsic is bare.
Source§

fn is_signed(&self) -> Option<bool>

👎Deprecated: Use and implement !is_bare() instead
Is this Extrinsic signed? If no information are available about signed/unsigned, None should be returned.
Source§

impl<Address, Call: Dispatchable, Signature, Extension: TransactionExtension<Call>> ExtrinsicMetadata for UncheckedExtrinsic<Address, Call, Signature, Extension>

Source§

const VERSIONS: &'static [u8] = _

The format versions of the Extrinsic. Read more
Source§

type TransactionExtensions = Extension

Transaction extensions attached to this Extrinsic.
Source§

impl<Address: PartialEq, Call: PartialEq, Signature: PartialEq, Extension: PartialEq> PartialEq for UncheckedExtrinsic<Address, Call, Signature, Extension>

Source§

fn eq( &self, other: &UncheckedExtrinsic<Address, Call, Signature, Extension>, ) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Address: Encode, Signature: Encode, Call: Encode, Extension: Encode> Serialize for UncheckedExtrinsic<Address, Call, Signature, Extension>

Source§

fn serialize<S>(&self, seq: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<Address, Call, Signature, Extension> TypeInfo for UncheckedExtrinsic<Address, Call, Signature, Extension>
where Address: StaticTypeInfo, Call: StaticTypeInfo, Signature: StaticTypeInfo, Extension: StaticTypeInfo,

Manual [TypeInfo] implementation because of custom encoding. The data is a valid encoded Vec<u8>, but requires some logic to extract the signature and payload.

See UncheckedExtrinsic::encode and UncheckedExtrinsic::decode.

Source§

type Identity = UncheckedExtrinsic<Address, Call, Signature, Extension>

The type identifying for which type info is provided. Read more
Source§

fn type_info() -> Type

Returns the static type identifier for Self.
Source§

impl<Address, Call, Signature, Extension> DecodeWithMemTracking for UncheckedExtrinsic<Address, Call, Signature, Extension>
where Address: DecodeWithMemTracking, Call: DecodeWithMemTracking, Signature: DecodeWithMemTracking, Extension: DecodeWithMemTracking,

Source§

impl<Address, Call, Signature, Extension> EncodeLike for UncheckedExtrinsic<Address, Call, Signature, Extension>
where Address: Encode, Signature: Encode, Call: Encode + Dispatchable, Extension: TransactionExtension<Call>,

Source§

impl<Address: Eq, Call: Eq, Signature: Eq, Extension: Eq> Eq for UncheckedExtrinsic<Address, Call, Signature, Extension>

Source§

impl<Address, Call, Signature, Extension> StructuralPartialEq for UncheckedExtrinsic<Address, Call, Signature, Extension>