Skip to content

Commit

Permalink
rename SignedExtra to TransactionExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
haerdib committed Feb 4, 2025
1 parent c771a79 commit cd8b33c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 46 deletions.
10 changes: 6 additions & 4 deletions primitives/src/extrinsics/extrinsic_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,16 +265,18 @@ where
/// actually contains.
// https://github.com/paritytech/substrate/blob/1612e39131e3fe57ba4c78447fb1cbf7c4f8830e/primitives/runtime/src/generic/unchecked_extrinsic.rs#L192-L197
#[derive(Decode, Encode, Clone, Eq, PartialEq, Debug)]
pub struct SignedPayload<Call, SignedExtra, Implicit>((Call, SignedExtra, Implicit));
pub struct SignedPayload<Call, TransactionExtension, Implicit>(
(Call, TransactionExtension, Implicit),
);

impl<Call, SignedExtra, Implicit> SignedPayload<Call, SignedExtra, Implicit>
impl<Call, TransactionExtension, Implicit> SignedPayload<Call, TransactionExtension, Implicit>
where
Call: Encode,
SignedExtra: Encode,
TransactionExtension: Encode,
Implicit: Encode,
{
/// Create new `SignedPayload` from raw components.
pub fn from_raw(call: Call, extra: SignedExtra, additional_signed: Implicit) -> Self {
pub fn from_raw(call: Call, extra: TransactionExtension, additional_signed: Implicit) -> Self {
Self((call, extra, additional_signed))
}

Expand Down
48 changes: 24 additions & 24 deletions src/api/rpc_api/author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ pub trait SubmitExtrinsic {

/// Submit an encodable extrinsic to the substrate node.
/// Returns the extrinsic hash.
async fn submit_extrinsic<Address, Call, Signature, SignedExtra>(
async fn submit_extrinsic<Address, Call, Signature, TransactionExtension>(
&self,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, SignedExtra>,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, TransactionExtension>,
) -> Result<Self::Hash>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode;
TransactionExtension: Encode;

/// Submit an encoded, opaque extrinsic to the substrate node.
/// Returns the extrinsic hash.
Expand All @@ -61,15 +61,15 @@ where
{
type Hash = T::Hash;

async fn submit_extrinsic<Address, Call, Signature, SignedExtra>(
async fn submit_extrinsic<Address, Call, Signature, TransactionExtension>(
&self,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, SignedExtra>,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, TransactionExtension>,
) -> Result<Self::Hash>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode,
TransactionExtension: Encode,
{
self.submit_opaque_extrinsic(&extrinsic.encode().into()).await
}
Expand All @@ -91,15 +91,15 @@ pub trait SubmitAndWatch {
/// to watch the extrinsic progress.
///
/// This method is blocking if the sync-api feature is activated
async fn submit_and_watch_extrinsic<Address, Call, Signature, SignedExtra>(
async fn submit_and_watch_extrinsic<Address, Call, Signature, TransactionExtension>(
&self,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, SignedExtra>,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, TransactionExtension>,
) -> Result<TransactionSubscriptionFor<Self::Client, Self::Hash>>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode;
TransactionExtension: Encode;

/// Submit an encoded, opaque extrinsic an return a Subscription to
/// watch the extrinsic progress.
Expand Down Expand Up @@ -130,16 +130,16 @@ pub trait SubmitAndWatch {
/// - last known extrinsic (transaction) status
///
/// This method is blocking if the sync-api feature is activated
async fn submit_and_watch_extrinsic_until<Address, Call, Signature, SignedExtra>(
async fn submit_and_watch_extrinsic_until<Address, Call, Signature, TransactionExtension>(
&self,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, SignedExtra>,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, TransactionExtension>,
watch_until: XtStatus,
) -> Result<ExtrinsicReport<Self::Hash>>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode;
TransactionExtension: Encode;

/// Submit an encoded, opaque extrinsic until the desired status
/// is reached, if no error is encountered previously.
Expand Down Expand Up @@ -182,17 +182,17 @@ pub trait SubmitAndWatch {
Address,
Call,
Signature,
SignedExtra,
TransactionExtension,
>(
&self,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, SignedExtra>,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, TransactionExtension>,
watch_until: XtStatus,
) -> Result<ExtrinsicReport<Self::Hash>>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode;
TransactionExtension: Encode;

/// Submit an encoded, opaque extrinsic and watch it until the desired status
/// is reached, if no error is encountered previously.
Expand Down Expand Up @@ -227,15 +227,15 @@ where
type Client = Client;
type Hash = T::Hash;

async fn submit_and_watch_extrinsic<Address, Call, Signature, SignedExtra>(
async fn submit_and_watch_extrinsic<Address, Call, Signature, TransactionExtension>(
&self,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, SignedExtra>,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, TransactionExtension>,
) -> Result<TransactionSubscriptionFor<Self::Client, Self::Hash>>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode,
TransactionExtension: Encode,
{
self.submit_and_watch_opaque_extrinsic(&extrinsic.encode().into()).await
}
Expand All @@ -254,16 +254,16 @@ where
.map_err(|e| e.into())
}

async fn submit_and_watch_extrinsic_until<Address, Call, Signature, SignedExtra>(
async fn submit_and_watch_extrinsic_until<Address, Call, Signature, TransactionExtension>(
&self,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, SignedExtra>,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, TransactionExtension>,
watch_until: XtStatus,
) -> Result<ExtrinsicReport<Self::Hash>>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode,
TransactionExtension: Encode,
{
self.submit_and_watch_opaque_extrinsic_until(&extrinsic.encode().into(), watch_until)
.await
Expand Down Expand Up @@ -301,17 +301,17 @@ where
Address,
Call,
Signature,
SignedExtra,
TransactionExtension,
>(
&self,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, SignedExtra>,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, TransactionExtension>,
watch_until: XtStatus,
) -> Result<ExtrinsicReport<Self::Hash>>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode,
TransactionExtension: Encode,
{
self.submit_and_watch_opaque_extrinsic_until_without_events(
&extrinsic.encode().into(),
Expand Down
12 changes: 6 additions & 6 deletions src/api/runtime_api/block_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ pub trait BlockBuilderApi: RuntimeApi {
type Header;

/// Apply the given extrinsic.
async fn apply_extrinsic<Address, Call, Signature, SignedExtra>(
async fn apply_extrinsic<Address, Call, Signature, TransactionExtension>(
&self,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, SignedExtra>,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, TransactionExtension>,
at_block: Option<Self::Hash>,
) -> Result<Self::ApplyExtrinsicResult>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode;
TransactionExtension: Encode;

/// Apply the given opaque extrinsic.
async fn apply_opaque_extrinsic(
Expand Down Expand Up @@ -79,16 +79,16 @@ where
type CheckInherentsResult = CheckInherentsResult;
type Header = T::Header;

async fn apply_extrinsic<Address, Call, Signature, SignedExtra>(
async fn apply_extrinsic<Address, Call, Signature, TransactionExtension>(
&self,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, SignedExtra>,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, TransactionExtension>,
at_block: Option<Self::Hash>,
) -> Result<Self::ApplyExtrinsicResult>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode,
TransactionExtension: Encode,
{
self.apply_opaque_extrinsic(extrinsic.encode(), at_block).await
}
Expand Down
24 changes: 12 additions & 12 deletions src/api/runtime_api/transaction_payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ pub trait TransactionPaymentApi: RuntimeApi {
type Weight;

/// Query the transaction fee details.
async fn query_fee_details<Address, Call, Signature, SignedExtra>(
async fn query_fee_details<Address, Call, Signature, TransactionExtension>(
&self,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, SignedExtra>,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, TransactionExtension>,
length: u32,
at_block: Option<Self::Hash>,
) -> Result<Self::FeeDetails>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode;
TransactionExtension: Encode;

/// Query the transaction fee details of opaque extrinsic.
async fn query_fee_details_opaque(
Expand All @@ -48,17 +48,17 @@ pub trait TransactionPaymentApi: RuntimeApi {
) -> Result<Self::FeeDetails>;

/// Query the transaction fee info.
async fn query_info<Address, Call, Signature, SignedExtra>(
async fn query_info<Address, Call, Signature, TransactionExtension>(
&self,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, SignedExtra>,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, TransactionExtension>,
length: u32,
at_block: Option<Self::Hash>,
) -> Result<Self::RuntimeDispatchInfo>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode;
TransactionExtension: Encode;

/// Query the transaction info of opaque extrinsic.
async fn query_info_opaque(
Expand Down Expand Up @@ -94,17 +94,17 @@ where
type Balance = T::Balance;
type Weight = Weight;

async fn query_fee_details<Address, Call, Signature, SignedExtra>(
async fn query_fee_details<Address, Call, Signature, TransactionExtension>(
&self,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, SignedExtra>,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, TransactionExtension>,
length: u32,
at_block: Option<Self::Hash>,
) -> Result<Self::FeeDetails>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode,
TransactionExtension: Encode,
{
self.query_fee_details_opaque(extrinsic.encode(), length, at_block).await
}
Expand All @@ -123,17 +123,17 @@ where
.await
}

async fn query_info<Address, Call, Signature, SignedExtra>(
async fn query_info<Address, Call, Signature, TransactionExtension>(
&self,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, SignedExtra>,
extrinsic: UncheckedExtrinsic<Address, Call, Signature, TransactionExtension>,
length: u32,
at_block: Option<Self::Hash>,
) -> Result<Self::RuntimeDispatchInfo>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode,
TransactionExtension: Encode,
{
self.query_info_opaque(extrinsic.encode(), length, at_block).await
}
Expand Down

0 comments on commit cd8b33c

Please sign in to comment.