-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat(txwrapper-polkadot): Add support for Statemint & Statemine #75
Conversation
|
||
const KNOWN_CHAIN_PROPERTIES = { | ||
statemint: { | ||
ss58Format: PolkadotSS58Format.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.
@emostov @joepetrowski, I know the ss58Format
is 0, and it shares that same property of Polkadot (assuming all parachains will share the same ss58Format
as their relay chain). Just want to make confirm the tokenDecimals
and tokenSymbol
are the same. I saw in the statemint repo, that it calculates Dollars different from DOT ie: using 1/100 instead of 1/10.
Also Zeke should the key be statemint
here as well. Just not sure how parachains will deal with
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 good question. On the first part, I will defer final answers to Joe. But in general all non-development chains should ideally have there own ss58 prefix, so it does not make sense to me that it is 0 here. (Dev chains should have prefix 42).
To your second part, yes this is correct. Should not be a difference for parachains.
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.
DOLLARS
is the same:
- Polkadot: https://github.com/paritytech/polkadot/blob/5b75542/runtime/polkadot/src/constants.rs#L21
- Statemint: https://github.com/paritytech/statemint/blob/564273d/runtime/statemint/src/constants.rs#L4
SS58 for Statemint will be 0 (same as 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.
@emostov - the reason that this uses 0 as its SS58 is that it's a common good chain, so it uses DOT as its native currency. It's basically part of Polkadot, but rather than bloat the Relay Chain with this logic, we're putting it in a parachain.
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.
Lets
- wait to hear back on the chain properties before merging
- Re-export the utility pallet methods
|
||
const KNOWN_CHAIN_PROPERTIES = { | ||
statemint: { | ||
ss58Format: PolkadotSS58Format.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.
Yeah good question. On the first part, I will defer final answers to Joe. But in general all non-development chains should ideally have there own ss58 prefix, so it does not make sense to me that it is 0 here. (Dev chains should have prefix 42).
To your second part, yes this is correct. Should not be a difference for parachains.
Looks good, would be good to add another instance for Statemine, Statemint's Kusama cousin.
|
@joepetrowski & @TarikGul (cc @dvdplm) I think we should ship methods for system parachains in To do this:
Any concerns with this plan? If not I think we can convert this PR to comply with the above |
That sounds good. As logic becomes more specialized I think we can code in some helpful warnings. For example, if Statemint is the only chain with |
Co-authored-by: David <dvdplm@gmail.com>
…tech/txwrapper-core into tarik-txwrapper-statemint
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.
LGTM
LGTM @emostov! Great job! |
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.
lgtm
@@ -75,9 +88,18 @@ export function getRegistry({ | |||
// The default type registry has polkadot types | |||
const registry = new TypeRegistry(); | |||
|
|||
// As of now statemine is not a supported specName in the default polkadot-js/api type registry. |
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.
Do you know if there's an issue for that upstream? If there is, maybe link to it here?
Closes: #68
This PR adds support for the Statemint & Statemine chains.