-
Notifications
You must be signed in to change notification settings - Fork 120
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 multi-config support #1503
Add multi-config support #1503
Conversation
Co-authored-by: Michael Müller <mich@elmueller.net>
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.
Looking good, the main thing would be to attempt to reduce the duplication of the verbose trait bounds on all the run
fns
/// A runtime configuration for the Polkadot based chain. | ||
/// This thing is not meant to be instantiated; it is just a collection of types. | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
pub enum 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.
pub enum Polkadot {} | |
pub enum Substrate {} |
I'm leaning towards renaming it to Substrate, as that's more correct and includes also solochains like Aleph Zero.
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.
In subxt
there is another config called Substrate
, which matches the default kitchen sink node extrinsic params. So in subxt
Polkadot
-> relay chain and node-template
config (used by most parachains and substrate-contracts-node
), and Substrate
-> substrate kitchen sink node with different extrinsic params.
We can give these different names possibly here though.
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.
Added Substrate config
I'm getting an unexpected error when trying to instantiate
The origin has enough balance. Do you have an idea why this misleading error is output? Ideally the @SkymanOne implementation of #1377 would catch this, but I guess it doesn't check the |
@cmichi I think that If you are using an ECDSA signer to generate keys and sign transactions, but the chain expects SR25519 keys, then the keys will differ. As a result, the addresses derived from these keys will also differ. |
Yep, |
The |
Summary
Related #1168
ink
orpallet-contracts
?Add multi chain support
Description
Add multi-chain config support. This solution includes an option --config for commands that depend on chain configuration.
Polkadot
serves as the default config, and if not provided, the default configuration is used.For now, the chain configuration is selected using the
--config
option, but in the future, it may be discovered automatically.Current limitations:
hash:
[u8;32]
- hardcoded in metadata crateAccountId32 - transcoder trait implemented only for this type (crate transcoder)
Balance:
From<u128>/Into<u128>
Checklist before requesting a review
CHANGELOG.md