Skip to content

Altered json to be more regular#8

Merged
gilescope merged 29 commits intomainfrom
vNext
Oct 4, 2021
Merged

Altered json to be more regular#8
gilescope merged 29 commits intomainfrom
vNext

Conversation

@gilescope
Copy link
Copy Markdown
Contributor

@gilescope gilescope commented Sep 14, 2021

Less exceptions:

  • "symbols": [], rather than null.
  • network not optional. Now set for bare accounts: "network": "BareEd25519",
  • standardAccount = null implies Reserved.

(See also paritytech/substrate#9755 )

@gilescope gilescope requested a review from bkchr September 14, 2021 12:12
gilescope and others added 5 commits September 14, 2021 14:37
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
No way to have two instances of Ss58AddressFormat that mean the same thing but are different.
(Before Custom(42) was the same as Ss58AddressFormat::Substrate but not eq.)
gilescope and others added 8 commits September 28, 2021 11:44
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
(brought in from master merge on substrate PR)
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Copy link
Copy Markdown
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

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

Looks good.

Just some tests would be nice.

@bkchr
Copy link
Copy Markdown
Member

bkchr commented Sep 29, 2021

Looks good.

Modulo the nitpicks.

build.rs Outdated
let mut registry = registry.registry;

let mut ordered_prefixes = registry.iter().map(|i| i.prefix).collect::<Vec<_>>();
ordered_prefixes.sort_unstable();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't use sort_unstable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's sorting primitives - there's no difference between 6 and 6 in this case - it's just a tad faster. In general I agree we don't want non-determinism but here I believe it makes no difference which we use.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please use sort().

it's just a tad faster.

We are sorting here like in maximum 256 elements, no one will be able to tell the difference.

gilescope and others added 6 commits October 1, 2021 05:45
@gilescope gilescope merged commit d03a06f into main Oct 4, 2021
@gilescope gilescope deleted the vNext branch March 18, 2022 09:21
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