mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 18:01:03 +00:00
XCM remove extra QueryId types from traits (#3763)
We do not need to make these traits generic over QueryId type, we can just use the QueryId alias everywhere
This commit is contained in:
@@ -132,7 +132,7 @@ pub trait QueryController<Origin, Timeout>: QueryHandler {
|
||||
origin: Origin,
|
||||
timeout: Timeout,
|
||||
match_querier: VersionedLocation,
|
||||
) -> Result<Self::QueryId, DispatchError>;
|
||||
) -> Result<QueryId, DispatchError>;
|
||||
}
|
||||
|
||||
impl<Origin, RuntimeCall> ExecuteController<Origin, RuntimeCall> for () {
|
||||
@@ -186,7 +186,7 @@ impl<Origin, Timeout> QueryController<Origin, Timeout> for () {
|
||||
_origin: Origin,
|
||||
_timeout: Timeout,
|
||||
_match_querier: VersionedLocation,
|
||||
) -> Result<Self::QueryId, DispatchError> {
|
||||
) -> Result<QueryId, DispatchError> {
|
||||
Ok(Default::default())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ impl<
|
||||
type Beneficiary = Beneficiary;
|
||||
type AssetKind = AssetKind;
|
||||
type Balance = u128;
|
||||
type Id = Querier::QueryId;
|
||||
type Id = QueryId;
|
||||
type Error = xcm::latest::Error;
|
||||
|
||||
fn pay(
|
||||
|
||||
@@ -38,7 +38,7 @@ pub use sp_std::{
|
||||
collections::{btree_map::BTreeMap, btree_set::BTreeSet},
|
||||
fmt::Debug,
|
||||
};
|
||||
pub use xcm::latest::{prelude::*, Weight};
|
||||
pub use xcm::latest::{prelude::*, QueryId, Weight};
|
||||
use xcm_executor::traits::{Properties, QueryHandler, QueryResponseStatus};
|
||||
pub use xcm_executor::{
|
||||
traits::{
|
||||
@@ -414,7 +414,6 @@ pub struct TestQueryHandler<T, BlockNumber>(core::marker::PhantomData<(T, BlockN
|
||||
impl<T: Config, BlockNumber: sp_runtime::traits::Zero + Encode> QueryHandler
|
||||
for TestQueryHandler<T, BlockNumber>
|
||||
{
|
||||
type QueryId = u64;
|
||||
type BlockNumber = BlockNumber;
|
||||
type Error = XcmError;
|
||||
type UniversalLocation = T::UniversalLocation;
|
||||
@@ -423,7 +422,7 @@ impl<T: Config, BlockNumber: sp_runtime::traits::Zero + Encode> QueryHandler
|
||||
responder: impl Into<Location>,
|
||||
_timeout: Self::BlockNumber,
|
||||
_match_querier: impl Into<Location>,
|
||||
) -> Self::QueryId {
|
||||
) -> QueryId {
|
||||
let query_id = 1;
|
||||
expect_response(query_id, responder.into());
|
||||
query_id
|
||||
@@ -433,7 +432,7 @@ impl<T: Config, BlockNumber: sp_runtime::traits::Zero + Encode> QueryHandler
|
||||
message: &mut Xcm<()>,
|
||||
responder: impl Into<Location>,
|
||||
timeout: Self::BlockNumber,
|
||||
) -> Result<Self::QueryId, Self::Error> {
|
||||
) -> Result<QueryId, Self::Error> {
|
||||
let responder = responder.into();
|
||||
let destination = Self::UniversalLocation::get()
|
||||
.invert_target(&responder)
|
||||
@@ -445,7 +444,7 @@ impl<T: Config, BlockNumber: sp_runtime::traits::Zero + Encode> QueryHandler
|
||||
Ok(query_id)
|
||||
}
|
||||
|
||||
fn take_response(query_id: Self::QueryId) -> QueryResponseStatus<Self::BlockNumber> {
|
||||
fn take_response(query_id: QueryId) -> QueryResponseStatus<Self::BlockNumber> {
|
||||
QUERIES
|
||||
.with(|q| {
|
||||
q.borrow().get(&query_id).and_then(|v| match v {
|
||||
@@ -460,7 +459,7 @@ impl<T: Config, BlockNumber: sp_runtime::traits::Zero + Encode> QueryHandler
|
||||
}
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
fn expect_response(_id: Self::QueryId, _response: xcm::latest::Response) {
|
||||
fn expect_response(_id: QueryId, _response: xcm::latest::Response) {
|
||||
// Unnecessary since it's only a test implementation
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user