Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated functions #678

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions node-api/src/metadata/metadata_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ pub struct Metadata {
}

impl Metadata {
/// Access a pallet given its name.
#[deprecated(note = "please use `pallet_by_name` or `pallet_by_name_err` instead")]
pub fn pallet(&self, pallet_name: &str) -> Result<PalletMetadata<'_>, MetadataError> {
self.pallet_by_name(pallet_name)
.ok_or_else(|| MetadataError::PalletNameNotFound(pallet_name.to_string()))
}

/// An iterator over all of the available pallets.
pub fn pallets(&self) -> impl Iterator<Item = PalletMetadata<'_>> {
self.pallets.values().map(|inner| PalletMetadata { inner, types: self.types() })
Expand Down
6 changes: 0 additions & 6 deletions primitives/src/config/asset_runtime_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,3 @@ impl Config for AssetRuntimeConfig {
/// A struct representing the signed extra and additional parameters required
/// to construct a transaction and pay in asset fees.
pub type AssetTipExtrinsicParams<T> = GenericExtrinsicParams<T, AssetTip<<T as Config>::Balance>>;

#[deprecated(
since = "0.14.0",
note = "Please use `AssetRuntimeConfig` instead, this will be removed in the next release."
)]
pub type SubstrateKitchensinkConfig = AssetRuntimeConfig;
6 changes: 0 additions & 6 deletions primitives/src/config/default_runtime_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,3 @@ pub type DefaultRuntimeConfig =
/// A struct representing the signed extra and additional parameters required
/// to construct a transaction and pay in token fees.
pub type PlainTipExtrinsicParams<T> = GenericExtrinsicParams<T, PlainTip<<T as Config>::Balance>>;

#[deprecated(
since = "0.14.0",
note = "Please use `DefaultRuntimeConfig` instead, this will be removed in the next release."
)]
pub type PolkadotConfig = DefaultRuntimeConfig;
94 changes: 0 additions & 94 deletions src/api/rpc_api/author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,57 +210,6 @@ pub trait SubmitAndWatch {
) -> Result<ExtrinsicReport<Self::Hash>>;
}

#[maybe_async::maybe_async(?Send)]
pub trait SubmitAndWatchUntilSuccess {
type Client: Subscribe;
type Hash: Decode;

/// Submit an extrinsic and watch it until
/// - wait_for_finalized = false => InBlock
/// - wait_for_finalized = true => Finalized
/// Returns and error if the extrinsic was not successfully executed.
/// If it was successful, a report containing the following is returned:
/// - extrinsic hash
/// - hash of the block the extrinsic was included in
/// - last known extrinsic (transaction) status
/// - associated events of the extrinsic
/// This method is blocking.
#[deprecated(
since = "0.14.0",
note = "please use `SubmitAndWatch::submit_and_watch_extrinsic_until` instead, this will be removed in the next release."
)]
async fn submit_and_watch_extrinsic_until_success<Address, Call, Signature, SignedExtra>(
&self,
extrinsic: UncheckedExtrinsicV4<Address, Call, Signature, SignedExtra>,
wait_for_finalized: bool,
) -> Result<ExtrinsicReport<Self::Hash>>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode;

/// Submit an encoded, opaque extrinsic and watch it until
/// - wait_for_finalized = false => InBlock
/// - wait_for_finalized = true => Finalized
/// Returns and error if the extrinsic was not successfully executed.
/// If it was successful, a report containing the following is returned:
/// - extrinsic hash
/// - hash of the block the extrinsic was included in
/// - last known extrinsic (transaction) status
/// - associated events of the extrinsic
/// This method is blocking.
#[deprecated(
since = "0.14.0",
note = "please use `SubmitAndWatch::submit_and_watch_opaque_extrinsic_until` instead, this will be removed in the next release."
)]
async fn submit_and_watch_opaque_extrinsic_until_success(
&self,
encoded_extrinsic: &Bytes,
wait_for_finalized: bool,
) -> Result<ExtrinsicReport<Self::Hash>>;
}

#[maybe_async::maybe_async(?Send)]
impl<T, Client> SubmitAndWatch for Api<T, Client>
where
Expand Down Expand Up @@ -391,46 +340,3 @@ where
Err(Error::NoStream)
}
}

#[maybe_async::maybe_async(?Send)]
impl<T, Client> SubmitAndWatchUntilSuccess for Api<T, Client>
where
T: Config,
Client: Subscribe + Request,
{
type Client = Client;
type Hash = T::Hash;

async fn submit_and_watch_extrinsic_until_success<Address, Call, Signature, SignedExtra>(
&self,
extrinsic: UncheckedExtrinsicV4<Address, Call, Signature, SignedExtra>,
wait_for_finalized: bool,
) -> Result<ExtrinsicReport<Self::Hash>>
where
Address: Encode,
Call: Encode,
Signature: Encode,
SignedExtra: Encode,
{
let xt_status = match wait_for_finalized {
true => XtStatus::Finalized,
false => XtStatus::InBlock,
};

self.submit_and_watch_opaque_extrinsic_until(&extrinsic.encode().into(), xt_status)
.await
}

async fn submit_and_watch_opaque_extrinsic_until_success(
&self,
encoded_extrinsic: &Bytes,
wait_for_finalized: bool,
) -> Result<ExtrinsicReport<Self::Hash>> {
let xt_status = match wait_for_finalized {
true => XtStatus::Finalized,
false => XtStatus::InBlock,
};

self.submit_and_watch_opaque_extrinsic_until(encoded_extrinsic, xt_status).await
}
}