-
Notifications
You must be signed in to change notification settings - Fork 254
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
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
//! 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 | ||
//! ``` |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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>
let call = substrate::runtime_types::kitchensink_runtime::RuntimeCall::Assets( | ||
substrate::runtime_types::pallet_assets::pallet::Call::freeze_asset { id: 100 }, | ||
); |
There was a problem hiding this comment.
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!
Since Alex is away today I'll combine this with my PR and fix anything up there to make the two consistent :) |
* 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>
This example executes a
multisig::as_multi
extrinsiccontaining a
Assets:freeze_asset
call.While at it, also add the substrate scale metadata to facilitate
working with the substrate nodes.
Part of #712.