Conversation
3598379 to
20e7806
Compare
sorpaas
reviewed
Mar 15, 2023
sorpaas
approved these changes
Mar 15, 2023
44eec1f to
63a4403
Compare
koushiro
reviewed
Mar 16, 2023
… directly Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com>
koushiro
reviewed
Mar 16, 2023
koushiro
reviewed
Mar 16, 2023
Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com>
Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com>
koushiro
reviewed
Mar 16, 2023
koushiro
reviewed
Mar 16, 2023
koushiro
reviewed
Mar 16, 2023
koushiro
reviewed
Mar 16, 2023
koushiro
reviewed
Mar 16, 2023
koushiro
reviewed
Mar 16, 2023
koushiro
reviewed
Mar 16, 2023
koushiro
reviewed
Mar 16, 2023
Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com>
Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com>
Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com>
Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com>
Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com>
Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com>
Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com>
koushiro
reviewed
Mar 16, 2023
koushiro
reviewed
Mar 16, 2023
yjhmelody
reviewed
Mar 16, 2023
| } | ||
|
|
||
| impl From<ecdsa::Public> for AccountId20 { | ||
| fn from(pk: ecdsa::Public) -> Self { |
Contributor
There was a problem hiding this comment.
I think this logic should not be implmented in a From. It is not a cheap convert.
Contributor
Author
There was a problem hiding this comment.
what would you suggest as alternative?
Member
There was a problem hiding this comment.
I think this should be okay. I don't recall any restrictions that we shouldn't use From for expensive convert.
yjhmelody
reviewed
Mar 16, 2023
|
|
||
| #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Default)] | ||
| #[derive(Encode, Decode, MaxEncodedLen, TypeInfo)] | ||
| pub struct AccountId20(pub [u8; 20]); |
Contributor
There was a problem hiding this comment.
Should add more docs for these types. e.g. eth compatible address blah blah.
Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com>
Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com>
koushiro
approved these changes
Mar 17, 2023
Dinonard
pushed a commit
to AstarNetwork/frontier
that referenced
this pull request
Mar 22, 2023
* bootstrap fp-account * clippy * make IdentityAddressMapping support From<H160> * clippy * fix import warning * fix pallet-evm tests * fix pallet-hotfix-sufficients tests * use libsecp256k1::PublicKey::parse_compressed and sp_core::keccak_256 directly Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com> * simplify keccak_256 hashing Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com> * format derives Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com> * merge_derives = false * fix imports * impl Debug for AccountId20 * simplify Display for EthereumSigner Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com> * fmt * simplify keccak_256 hashing * simplify ecdsa path Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com> * format derives Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com> * use sp_io for keccak_256 Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com> * remove sha3 dependency Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com> * remove sha3 dependency Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com> * remove sha3 dependency Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com> * remove sha3 import * remove sha3 dependency * simplify keccak_256 hashing on tests Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com> * remove serde imports Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com> * add account docs * remove sp-keyring from template deps --------- Co-authored-by: Qinxuan Chen <koushiro.cqx@gmail.com> Co-authored-by: Wei Tang <wei@pacna.org>
Closed
37 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on Moonbeam's
AccountId20implementation:Introduces a new
fp-accountcrate intoprimitives, as an alternative to Frontier'sH256->H160truncation mapping.H160addresses live natively on the Substrate runtime, and there's no need for translation betweenH256andH160.