mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 04:37:57 +00:00
Expose information about the extrinsic in the metadata (#4774)
* Expose information about the extrinsic in the metadata This pr exposes some information about the extrinsic used in the runtime via metadata. The following information are exposed: - Version of the extrinsic - List of all signed extensions used by the extrinsic. * Increment `spec_version`
This commit is contained in:
@@ -20,7 +20,10 @@ use sp_std::{fmt, prelude::*};
|
||||
use sp_io::hashing::blake2_256;
|
||||
use codec::{Decode, Encode, EncodeLike, Input, Error};
|
||||
use crate::{
|
||||
traits::{self, Member, MaybeDisplay, SignedExtension, Checkable, Extrinsic, IdentifyAccount},
|
||||
traits::{
|
||||
self, Member, MaybeDisplay, SignedExtension, Checkable, Extrinsic, ExtrinsicMetadata,
|
||||
IdentifyAccount,
|
||||
},
|
||||
generic::CheckedExtrinsic, transaction_validity::{TransactionValidityError, InvalidTransaction},
|
||||
};
|
||||
|
||||
@@ -130,6 +133,15 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<Address, Call, Signature, Extra> ExtrinsicMetadata
|
||||
for UncheckedExtrinsic<Address, Call, Signature, Extra>
|
||||
where
|
||||
Extra: SignedExtension,
|
||||
{
|
||||
const VERSION: u8 = TRANSACTION_VERSION;
|
||||
type SignedExtensions = Extra;
|
||||
}
|
||||
|
||||
/// A payload that has been signed for an unchecked extrinsics.
|
||||
///
|
||||
/// Note that the payload that we sign to produce unchecked extrinsic signature
|
||||
@@ -316,6 +328,7 @@ mod tests {
|
||||
#[derive(Debug, Encode, Decode, Clone, Eq, PartialEq, Ord, PartialOrd)]
|
||||
struct TestExtra;
|
||||
impl SignedExtension for TestExtra {
|
||||
const IDENTIFIER: &'static str = "TestExtra";
|
||||
type AccountId = u64;
|
||||
type Call = ();
|
||||
type AdditionalSigned = ();
|
||||
|
||||
Reference in New Issue
Block a user