mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 22:51:13 +00:00
Make API backwards compatible with CC (#1697)
* Rework how a runtime api calls into the runtime Now we generate a default implementation for each api call that calls a generated method `method_runtime_api_impl`. This newly generated method is the one that will be implemented by the `impl_runtime_apis` macro in the runtime for the client side. * Support `changed_in` to change runtime api function signatures * Update documentation * Fixes tests * Implement checking the api version with a predicate * Make the implementation backwards compatible with CC * Update wasm files after merge * Check for wasm runtime differences by building master and current branch * Update spec_version and wasm files * Fixes * Revert my changes * Remove `patch.crates-io` from test-runtime
This commit is contained in:
@@ -215,14 +215,9 @@ fn should_return_runtime_version() {
|
||||
let client = Arc::new(test_client::new());
|
||||
let api = State::new(client.clone(), Subscriptions::new(core.executor()));
|
||||
|
||||
assert_matches!(
|
||||
api.runtime_version(None.into()),
|
||||
Ok(ref ver) if ver == &runtime::VERSION
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
::serde_json::to_string(&api.runtime_version(None.into()).unwrap()).unwrap(),
|
||||
r#"{"specName":"test","implName":"parity-test","authoringVersion":1,"specVersion":1,"implVersion":1,"apis":[["0xdf6acb689907609b",1],["0x37e397fc7c91f5e4",1],["0xd2bc9897eed08f15",1],["0x40fe3ad401f8959a",1],["0xc6e9a76309f39b09",1],["0xdd718d5cc53262d4",1]]}"#
|
||||
r#"{"specName":"test","implName":"parity-test","authoringVersion":1,"specVersion":1,"implVersion":1,"apis":[["0xdf6acb689907609b",1],["0x37e397fc7c91f5e4",1],["0xd2bc9897eed08f15",1],["0x40fe3ad401f8959a",2],["0xc6e9a76309f39b09",1],["0xdd718d5cc53262d4",1]]}"#
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user