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

Added Trusted Query API calls #6039

Merged
merged 32 commits into from
Oct 17, 2024
Merged

Added Trusted Query API calls #6039

merged 32 commits into from
Oct 17, 2024

Conversation

x3c41a
Copy link
Contributor

@x3c41a x3c41a commented Oct 14, 2024

Implemented is_trusted_reserve and is_trusted_teleporter API methods.
Tested them with regular and chopstick tests.
Fixes #97

@x3c41a x3c41a requested a review from a team as a code owner October 14, 2024 10:47
@x3c41a x3c41a marked this pull request as draft October 14, 2024 10:47
@x3c41a x3c41a added the T6-XCM This PR/Issue is related to XCM. label Oct 15, 2024
polkadot/xcm/xcm-runtime-apis/tests/trusted_query.rs Outdated Show resolved Hide resolved
prdoc/pr_6039.prdoc Show resolved Hide resolved
prdoc/pr_6039.prdoc Outdated Show resolved Hide resolved
prdoc/pr_6039.prdoc Outdated Show resolved Hide resolved
polkadot/xcm/pallet-xcm/src/lib.rs Show resolved Hide resolved
polkadot/xcm/xcm-runtime-apis/src/lib.rs Outdated Show resolved Hide resolved
polkadot/xcm/xcm-runtime-apis/src/trust_query.rs Outdated Show resolved Hide resolved
polkadot/xcm/xcm-runtime-apis/src/trust_query.rs Outdated Show resolved Hide resolved
polkadot/xcm/xcm-runtime-apis/tests/mock.rs Outdated Show resolved Hide resolved
@x3c41a x3c41a changed the title WIP: Added Trusted Query API calls Added Trusted Query API calls Oct 16, 2024
@x3c41a x3c41a changed the title Added Trusted Query API calls Added Trusted Query API calls. Made sure that API works with chopstick tests. Oct 16, 2024
@x3c41a x3c41a changed the title Added Trusted Query API calls. Made sure that API works with chopstick tests. Added Trusted Query API calls Oct 16, 2024
Copy link
Contributor

@franciscoaguirre franciscoaguirre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Contributor

@acatangiu acatangiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@@ -1797,6 +1797,15 @@ impl_runtime_apis! {
genesis_config_presets::preset_names()
}
}

impl xcm_runtime_apis::trusted_query::TrustedQueryApi<Block> for Runtime {
fn is_trusted_reserve(asset: VersionedAsset, location: VersionedLocation) -> Result<bool, xcm_runtime_apis::trusted_query::Error> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can define a

type XcmTrustedQueryResult = Result<bool, xcm_runtime_apis::trusted_query::Error>;

at the top level of files like this on so then the runtime apis have shorter/more-readable signature:

Suggested change
fn is_trusted_reserve(asset: VersionedAsset, location: VersionedLocation) -> Result<bool, xcm_runtime_apis::trusted_query::Error> {
fn is_trusted_reserve(asset: VersionedAsset, location: VersionedLocation) -> XcmTrustedQueryResult {

Comment on lines 28 to 29
/// # Arguments
///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

Suggested change
/// # Arguments
///
/// # Arguments:

Comment on lines 35 to 36
/// # Arguments
///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

Suggested change
/// # Arguments
///
/// # Arguments:

@x3c41a x3c41a enabled auto-merge October 17, 2024 18:46
@x3c41a x3c41a added this pull request to the merge queue Oct 17, 2024
Merged via the queue into master with commit 7240b47 Oct 17, 2024
188 of 193 checks passed
@x3c41a x3c41a deleted the new-runtime-call branch October 17, 2024 19:57
Copy link
Contributor

@acatangiu acatangiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@x3c41a this suggestion applied to all runtimes, not just one.

Also I see you merged the PR with some junk binary files added after the reviews, please ASAP open a PR to remove them...

github-merge-queue bot pushed a commit that referenced this pull request Oct 18, 2024
Those files were introduced by mistake in
#6039
github-merge-queue bot pushed a commit that referenced this pull request Oct 21, 2024
Changed returned type of API methods from `Result<bool,
xcm_runtime_apis::trusted_query::Error>` to a typed one `type
XcmTrustedQueryResult = Result<bool,
xcm_runtime_apis::trusted_query::Error>;`
Follow-up of
[PR-6039](#6039)

---------

Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Adrian Catangiu <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Oct 24, 2024
…hains (#6212)

Added missing API methods to Rococo and Westend parachains.
Preparatory work for making chopstick tests run smoothly.
Follow-up of
[PR#6039](#6039)
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 25, 2024
…hains (paritytech#6212)

Added missing API methods to Rococo and Westend parachains.
Preparatory work for making chopstick tests run smoothly.
Follow-up of
[PR#6039](paritytech#6039)
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 25, 2024
…hains (paritytech#6212)

Added missing API methods to Rococo and Westend parachains.
Preparatory work for making chopstick tests run smoothly.
Follow-up of
[PR#6039](paritytech#6039)
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 25, 2024
…hains (paritytech#6212)

Added missing API methods to Rococo and Westend parachains.
Preparatory work for making chopstick tests run smoothly.
Follow-up of
[PR#6039](paritytech#6039)
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 25, 2024
…hains (paritytech#6212)

Added missing API methods to Rococo and Westend parachains.
Preparatory work for making chopstick tests run smoothly.
Follow-up of
[PR#6039](paritytech#6039)
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 25, 2024
…hains (paritytech#6212)

Added missing API methods to Rococo and Westend parachains.
Preparatory work for making chopstick tests run smoothly.
Follow-up of
[PR#6039](paritytech#6039)
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 29, 2024
…hains (paritytech#6212)

Added missing API methods to Rococo and Westend parachains.
Preparatory work for making chopstick tests run smoothly.
Follow-up of
[PR#6039](paritytech#6039)
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 29, 2024
…hains (paritytech#6212)

Added missing API methods to Rococo and Westend parachains.
Preparatory work for making chopstick tests run smoothly.
Follow-up of
[PR#6039](paritytech#6039)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T6-XCM This PR/Issue is related to XCM.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make trusted Teleporters and Reserves queryable through Runtime APIs
3 participants