-
Notifications
You must be signed in to change notification settings - Fork 710
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
Conversation
Co-authored-by: Francisco Aguirre <[email protected]>
Co-authored-by: Francisco Aguirre <[email protected]>
Co-authored-by: Francisco Aguirre <[email protected]>
Co-authored-by: Francisco Aguirre <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this 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> { |
There was a problem hiding this comment.
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:
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 { |
/// # Arguments | ||
/// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
/// # Arguments | |
/// | |
/// # Arguments: |
/// # Arguments | ||
/// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
/// # Arguments | |
/// | |
/// # Arguments: |
There was a problem hiding this 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...
Those files were introduced by mistake in #6039
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]>
…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)
…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)
…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)
…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)
…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)
…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)
…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)
Implemented is_trusted_reserve and is_trusted_teleporter API methods.
Tested them with regular and chopstick tests.
Fixes #97