support custom ss58addressformat in from_ss58check_with_version (#5526)
* support custom ss58addressformat in from_ss58check_with_version
* fix str parse
1. if can parse with u8, use u8 into.
2. if u8 can't parse, convert to str then parse
* add a test
* typo
* add error description in test
* fix the `TryFrom<u8>` for `Ss58AddressFormat`
change check logic in TryFrom<u8> to replace modified code in `from_ss58check_with_version`
* use Ss58AddressFormat::default() replace DEFAULT_VERSION
* Apply suggestions from code review
* Update primitives/core/src/crypto.rs
* Update primitives/core/src/crypto.rs
* Update primitives/core/src/crypto.rs
* Update primitives/core/src/crypto.rs
Co-authored-by: Bastian Köcher <[email protected]>
parent
a5d6c905
Please register or sign in to comment