Skip to content
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 aex3 wallet support for hyperchain accounts #4171

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

seanhinde
Copy link
Contributor

Allow use of aex3 wallet files containing mnemonic phrase as hyper chain staking accounts and parent chain accounts when using an AE parent chain.

Imports the read only parts of erlang libraries eaex3 and eaax10 directly.

This PR was sponsored by the ACF

@seanhinde seanhinde requested a review from hanssv July 17, 2023 07:52
ParentConnMod = aehttpc_aeternity,
SignModule = get_sign_module(),
{ok, PCSpendPubkey} = aeser_api_encoder:safe_decode(account_pubkey, PCSpendAddress),
{ParentConnMod, PCSpendPubkey, HCPCPairs, SignModule}.

parse_ae_stakers(StakersConfig) ->
lists:map(
fun(#{<<"hyper_chain_account">> := #{<<"pub">> := HCEncodedPubkey} = HC,
Copy link
Member

Choose a reason for hiding this comment

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

Not hyperchain_account?

private_to_public(DKey = #{curve := Curve, pub_key := undefined,
priv_key := <<PrivateKey:32/binary>>}) ->
DKey#{pub_key := private_to_public(Curve, PrivateKey)};
private_to_public(DKey) ->
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps at least pattern-match on #{pub_key := _}?

case {Path, key_type(DKey0)} of
{"m" ++ Path1, private} ->
derive_private_path(Path1, DKey0);
{"m" ++ _Path1, public} ->
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this case also be checked for "M"?

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.

None yet

2 participants