-
Notifications
You must be signed in to change notification settings - Fork 248
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
use unit type in polkadot config #943
Conversation
>; | ||
pub enum PolkadotConfig {} | ||
|
||
impl Config for PolkadotConfig { |
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.
I do wonder, we implement the Config
directly to gain more flexibility for the PolkadotConfig
?
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.
Yeah, WithExtrinsicParams
only lets you change the extrinsic params bit; Tadeo needed to change another param so implementing Config "properly" is the way to go :)
I might be wrong, but the question I think is, when you run It's a good point though that people basing things off the I think what you've done here is all good for now; maybe we need to look through more things and provide more |
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.
Looks good to me!
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.
pausing merge this....
we shouldn't target the node template
in substrate it's different from the substrate --dev (it's called node)
https://github.com/paritytech/substrate/blob/master/bin/node/runtime/src/lib.rs#L1833 the AccountIndex
is actually a u32, it might not matter for subxt anyway in most cases
I would prefer to have SubstrateNodeTemplateConfig
and SubstrateNodeConfig
or something SubstrateConfig
is not obvious what it refer to but as most folks just run substrate --dev
it's most reasonable to support by default
Yeah, PolkadotConfig is ()
but I'm not against removing the inheritance from SubstrateConfig
If the two are different in the |
My complete guess for why the two are different: the address type looks like: pub enum MultiAddress<AccountId, AccountIndex> {
/// It's an account ID (pubkey).
Id(AccountId),
/// It's an account index.
Index(#[codec(compact)] AccountIndex),
/// It's some arbitrary raw bytes.
Raw(Vec<u8>),
/// It's a 32 byte representation.
Address32([u8; 32]),
/// Its a 20 byte representation.
Address20([u8; 20]),
} And so Substrate uses Ultimately it won't affect anybody to use I wouldn't be opposed to more |
So just to check, This PR changes @niklasad1 what do you reckon? |
Go ahead and merge it, missed that it didn't modify the SubstrateConfig so all good from myside |
I changed the second generic parameter in the polkadot config to
()
, but I am a bit confused still about the default for substrate.There are the two directories
node
andnode-template
insubstate/bin
.node-template
seems to use()
:in
substrate/bin/node-template/runtime/src/lib.rs
while
node
seems to use u32:in
substrate/bin/node/primitives/src/lib.rs
andin
substrate/bin/node/runtime/src/lib.rs