mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
Rewrite impl_runtime_apis! and decl_runtime_apis! as proc-macro (#1174)
* Rewrites `impl_runtime_apis!` macro as `proc-macro` * Adds some documentation * Require the `impl_runtime_apis` to use a path for accessing the trait * Make the runtime implement `GetNodeBlockType` * Moves first chunk of runtime api code into the `impl_runtime_apis` macro This also renames `ClientWithApi` into `RuntimeApi`. * Make `impl_runtime_apis` use `runtime` api version automatically * `decl_runtime_apis` automatically adds `Block: BlockT` as generic parameter * Remove function generic arguments in block builder api * Remove some unnused stuff from the `decl_runtime_apis` macro * Make `InherentData` working again * Make `impl_runtime_apis!` implement the `RuntimeApi` side as well * Make it compile again after rebasing with master * Split `sr-api-macros` into multiple files * Reimplement `decl_runtime_apis!` as proc_macro * Use `decl_runtime_apis!` for `Core` as well and improve error reporting * Adds documentation for `decl_runtime_apis!` and `impl_runtime_apis!` * Move some code * Adds compile fail tests * Adds a test and fixes some bugs * Make `impl_runtime_apis!` support `_` as parameter name * Fixes build errors with wasm * Wasm rebuild after master rebase * Apply suggestions from code review Co-Authored-By: bkchr <bkchr@users.noreply.github.com> * Addresses some grumbles * Adds test to ensure that method signatures need to match * New wasm files
This commit is contained in:
@@ -66,12 +66,12 @@ pub type Executor = client::LocalCallExecutor<
|
||||
>;
|
||||
|
||||
/// Creates new client instance used for tests.
|
||||
pub fn new() -> client::Client<Backend, Executor, runtime::Block, runtime::ClientWithApi> {
|
||||
pub fn new() -> client::Client<Backend, Executor, runtime::Block, runtime::RuntimeApi> {
|
||||
new_with_backend(Arc::new(Backend::new()), false)
|
||||
}
|
||||
|
||||
/// Creates new test client instance that suports changes trie creation.
|
||||
pub fn new_with_changes_trie() -> client::Client<Backend, Executor, runtime::Block, runtime::ClientWithApi> {
|
||||
pub fn new_with_changes_trie() -> client::Client<Backend, Executor, runtime::Block, runtime::RuntimeApi> {
|
||||
new_with_backend(Arc::new(Backend::new()), true)
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ pub fn new_with_changes_trie() -> client::Client<Backend, Executor, runtime::Blo
|
||||
pub fn new_with_backend<B>(
|
||||
backend: Arc<B>,
|
||||
support_changes_trie: bool
|
||||
) -> client::Client<B, client::LocalCallExecutor<B, executor::NativeExecutor<LocalExecutor>>, runtime::Block, runtime::ClientWithApi>
|
||||
) -> client::Client<B, client::LocalCallExecutor<B, executor::NativeExecutor<LocalExecutor>>, runtime::Block, runtime::RuntimeApi>
|
||||
where
|
||||
B: backend::LocalBackend<runtime::Block, Blake2Hasher>,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user