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

Obtain the API difference between two runtime nodes #522

Closed
lexnv opened this issue Apr 28, 2022 · 1 comment
Closed

Obtain the API difference between two runtime nodes #522

lexnv opened this issue Apr 28, 2022 · 1 comment
Assignees

Comments

@lexnv
Copy link
Collaborator

lexnv commented Apr 28, 2022

There are cases when nodes contain different versions of the metadata, with modified/added pallets/calls.
It would be valuable to have a tool that outputs the differences in metadata in a human-readable way.

  • Full metadata inspection
> subxt-cli diff http://localhost:9933 http://localhost:9934

+ pallet XCM
  • Per pallet inspection
> subxt-cli diff http://localhost:9933 http://localhost:9934 --pallet Balances
--- a/http://localhost:9933/metadata/pallet/Balances
--- b/http://localhost:9934/metadata/pallet/Balances

pub mod calls {

+ pub struct NewTransferCall {
+     pub dest: ::subxt::sp_runtime::MultiAddress<
+         ::subxt::sp_core::crypto::AccountId32,
+         (),
+     >,
+     #[codec(compact)]
+     pub value: ::core::primitive::u128,
+ }
+ impl ::subxt::Call for Transfer {
+     const PALLET: &'static str = "Balances";
+     const FUNCTION: &'static str = "transfer";
+ }
  • Per call/storage/constant... inspection
> subxt-cli diff http://localhost:9933 http://localhost:9934 --pallet Balances --call NewTransferCall
--- a/http://localhost:9933/metadata/Balances/calls/NewTransferCall
--- b/http://localhost:9934/metadata/Balances/calls/NewTransferCall

pub struct NewTransferCall {
    pub dest: ::subxt::sp_runtime::MultiAddress<
-         ::subxt::sp_core::crypto::AccountId32,
+         ::subxt::sp_core::crypto::AccountId64,
        (),
@lexnv lexnv mentioned this issue Apr 28, 2022
12 tasks
@jsdw
Copy link
Collaborator

jsdw commented May 20, 2022

I like the diff style markers, but I also wonder whether the interface should be more code-based as above, or a little more human-readable. Definitely the structure of the output could do with some pondering; how can we most easily show people what the differences are?

@tadeohepperle tadeohepperle self-assigned this Jun 12, 2023
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

3 participants