crypto: `lazy_static` removed, light parser for address URI added (#2250)
The `lazy_static` package does not work well in `no-std`: it requires `spin_no_std` feature, which also will propagate into `std` if enabled. This is not what we want. This PR provides simple address uri parser which allows to get rid of _regex_ which was used to parse the address uri, what in turns allows to remove lazy_static. Three regular expressions (`SS58_REGEX`,`SECRET_PHRASE_REGEX`,`JUNCTION_REGEX`) were replaced with the parser which unifies all of them. The new parser does not support Unicode, it is ASCII only. Related to: #2044 --------- Co-authored-by:Bastian Köcher <git@kchr.de> Co-authored-by:
Koute <koute@users.noreply.github.com> Co-authored-by: command-bot <>
Showing
- Cargo.lock 36 additions, 9 deletionsCargo.lock
- Cargo.toml 1 addition, 0 deletionsCargo.toml
- substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.stderr 6 additions, 6 deletions.../pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.stderr
- substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.stderr 6 additions, 6 deletions...ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.stderr
- substrate/primitives/core/Cargo.toml 2 additions, 4 deletionssubstrate/primitives/core/Cargo.toml
- substrate/primitives/core/fuzz/Cargo.toml 20 additions, 0 deletionssubstrate/primitives/core/fuzz/Cargo.toml
- substrate/primitives/core/fuzz/fuzz_targets/fuzz_address_uri.rs 53 additions, 0 deletions...ate/primitives/core/fuzz/fuzz_targets/fuzz_address_uri.rs
- substrate/primitives/core/src/address_uri.rs 432 additions, 0 deletionssubstrate/primitives/core/src/address_uri.rs
- substrate/primitives/core/src/crypto.rs 43 additions, 42 deletionssubstrate/primitives/core/src/crypto.rs
- substrate/primitives/core/src/lib.rs 2 additions, 0 deletionssubstrate/primitives/core/src/lib.rs
Please register or sign in to comment