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

Add multisig static example #713

Closed
wants to merge 3 commits into from
Closed

Add multisig static example #713

wants to merge 3 commits into from

Conversation

lexnv
Copy link
Collaborator

@lexnv lexnv commented Nov 10, 2022

This example executes a multisig::as_multi extrinsic
containing a Assets:freeze_asset call.

While at it, also add the substrate scale metadata to facilitate
working with the substrate nodes.

Part of #712.

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv self-assigned this Nov 10, 2022
Comment on lines +5 to +11
//! To run this example, a local polkadot node should be running. Example verified against substrate latest-38a955ba4a0.
//!
//! E.g.
//! ```bash
//! curl "https://releases.parity.io/substrate/x86_64-debian:stretch/latest/substrate/substrate" --output /usr/local/bin/substrate --location
//! substrate --dev --tmp
//! ```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the only example using Substrate? I think just for consistency with other examples maybe it's best to stick to Polkadot?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Polkadot node does not contain the Assets pallet, at least I didn't see it in the metadata of wss://rpc.polkadot.io:443

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's ok; we don't need to specifically use this Assets call as the example; in https://github.com/paritytech/subxt/pull/714/files I used a balance transfer so perhaps we could standardise and both just do that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I think I'll rename my example to dynamic_multisig.rs to align with yours :)

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Comment on lines +35 to +37
let call = substrate::runtime_types::kitchensink_runtime::RuntimeCall::Assets(
substrate::runtime_types::pallet_assets::pallet::Call::freeze_asset { id: 100 },
);
Copy link
Collaborator

@jsdw jsdw Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about:

substrate::tx().assets().freeze_asset(100).call_data().clone()

does that work instead?

And if so, perhaps we could add an into_call_data() to mirror the into_value() I added on the dynamic side, and avoid the clone here?

It'd be awesome if we can add that and make embedding calls like this way smoother!

@jsdw
Copy link
Collaborator

jsdw commented Nov 11, 2022

Since Alex is away today I'll combine this with my PR and fix anything up there to make the two consistent :)

@jsdw jsdw closed this Nov 11, 2022
niklasad1 added a commit that referenced this pull request Nov 15, 2022
* First pass adding functions to get blocks and extrinsics

* cargo fmt and cache block events

* prefix block hash with 0x

* pin streams for better ergonomics and add an example of subscribing to blocks

* remove unused var

* standardise on _all, _best and _finalized for different block header subs

* WIP center subscribing around blocks

* Remove the event filtering/subscribing  stuff

* clippy

* we need tokio, silly clippy

* add extrinsic_index() call

* Update subxt/src/blocks/block_types.rs

Co-authored-by: Andrew Jones <ascjones@gmail.com>

* Add dynbamic nested query example and make dynamic::tx a little easier to work with

* calL_value -> inner_tx

* rename example to dynamic_multisig to align with #713 naming

* align dynamic and static multisig examples

* Fix comment typo

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>

Co-authored-by: Andrew Jones <ascjones@gmail.com>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
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

Successfully merging this pull request may close these issues.

2 participants