ApeWorX / ape-foundry

Foundry network provider for the Ape Framework
https://www.apeworx.io/
Apache License 2.0
32 stars 13 forks source link

feat: add support for Foundry keystore accounts #86

Closed z80dev closed 6 months ago

z80dev commented 7 months ago

What I did

Added support for Foundry keystore accounts fixes: #

How I did it

Implemented AccountsContainer and a child class of KeystoreAccount handling the differences between ape's keystores and foundry's.

The main difference is that Foundry keystores don't include the address so we have to compute that, which requires unlocking and getting the private key. We do some caching and sometimes return None to make things more convenient.

How to verify it

After installing foundry, run:

cast wallet new testwallet

then after installing this plugin run:

ape accounts list --all

output should include:

Found 1 account in the 'foundry' plugin:
  *address encrypted* (alias: 'testwallet')

Checklist

z80dev commented 7 months ago

Needs some tests maybe

yeah I think this week I'll have time to add some.

@fubuloubu do you have any ideas about what to return when an account is locked, since right now we have to return AddressType the typechecker will fail if we keep returning a string?

fubuloubu commented 7 months ago

@fubuloubu do you have any ideas about what to return when an account is locked, since right now we have to return AddressType the typechecker will fail if we keep returning a string?

Use self.unlock

github-actions[bot] commented 6 months ago

This pull request is considered stale because it has been open 30 days with no activity. Remove stale label, add a comment, or make a new commit, otherwise this PR will be closed in 5 days.

github-actions[bot] commented 6 months ago

This PR was closed because it has been inactive for 35 days.