Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(gre): add wallet methods #716

Merged
merged 3 commits into from
Sep 22, 2022
Merged

feat(gre): add wallet methods #716

merged 3 commits into from
Sep 22, 2022

Conversation

tmigone
Copy link
Contributor

@tmigone tmigone commented Sep 22, 2022

Motivation

Sometimes when using GRE it's useful to get wallet(s) derived from the mnemonic specified on the network config. This can easily be made using ethers and Wallet but including the functionality in GRE allows to later compose it with #696 which is a lot more useful.

This is particularly useful when running hardhat tasks that make use of cli commands, as the CLI env expects a wallet and not a signer connected to a provider (which is what the GRE works with).

Changes

Added two methods to GRE:

  • getWallets will return an array with 20 wallets derived from the mnemonic specified on the network config
  • getWallet will return a wallet derived from the same mnemonic. If it's not on the derivation path it returns undefined.

Signed-off-by: Tomás Migone tomas@edgeandnode.com

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
@codecov
Copy link

codecov bot commented Sep 22, 2022

Codecov Report

Base: 90.57% // Head: 90.57% // No change to project coverage 👍

Coverage data is based on head (9b91113) compared to base (af17480).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #716   +/-   ##
=======================================
  Coverage   90.57%   90.57%           
=======================================
  Files          35       35           
  Lines        1762     1762           
  Branches      296      296           
=======================================
  Hits         1596     1596           
  Misses        166      166           
Flag Coverage Δ
unittests 90.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
@tmigone tmigone requested a review from abarmat September 22, 2022 18:49
@tmigone tmigone merged commit 000810b into dev Sep 22, 2022
@tmigone tmigone deleted the tmigone/gre-wallet branch September 22, 2022 20:37
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants