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

Entry Point: Runtime API #5

Open
xlc opened this issue Apr 29, 2024 · 0 comments
Open

Entry Point: Runtime API #5

xlc opened this issue Apr 29, 2024 · 0 comments

Comments

@xlc
Copy link
Member

xlc commented Apr 29, 2024

Design the runtime API to invoke XCQ from offchain context (SDK, wallets, dApps, etc)

type Xcq = // TBD
type XcqResponse = // TBD
type XcqError = // TBD
type XcqResult = Result<XcqResponse, XcqResult>;
type SizeLimitedXcq = WithMaxSize<Xcq, GetUsize<1024 * 512>>; // max size is chain specific and for WithMaxSize see https://github.com/paritytech/polkadot-sdk/issues/4092
pub trait XcqApi {
  /// Execute the provided XCQ with an optional weight limit
  /// Return the result and consumed weight
  /// When weight_limit is none, the chain specific upper weight is used
  fn execute_query(query: SizeLimitedXcq, weight_limit: Option<Weight>) -> (XcqResult, Weight);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant