-
Notifications
You must be signed in to change notification settings - Fork 675
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
Add C-chain wallet to the primary network #1850
Conversation
func publicKeyToEthAddress(pk *secp256k1.PublicKey) common.Address { | ||
return crypto.PubkeyToAddress(*(pk.ToECDSA())) | ||
} |
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.
This is also implemented in coreth - but would cause a circular import. I'd be willing to expose this here if we wanted coreth to just depend on this and we remove the duplicated code
avaxAddrToKeyIndex map[ids.ShortID]int | ||
ethAddrToKeyIndex map[common.Address]int | ||
|
||
// These can be used to iterate over. However, they should not be modified |
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.
(No action required) Maybe that suggests making them private and returning a copy? Or do performance concerns trump enforcing immutability?
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.
There shouldn't be anything performance critical using the keychain. (as it is only used to sign transactions)
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.
A couple of nits but mainly questions to educate myself.
I'm going to start working on a followup PR to abstract the EDIT: This wallet is only going to support import/export txs for now. We may add it later... but because of ethereum's execution flow... it isn't going to be very easy to track balances for non-avax txs. |
Automatic baseFee determination lgtm. |
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.
one small typo but LGTM
Why this should be merged
This significantly reduces the friction of issuing import/export txs for the C-chain on the primary network when using the avalanchego wallet.
How this works
MakeWallet
How this was tested
Ran the examples locally.