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

ape_accounts.TestAccount does not support .sign_message for eip712.EIP712Message types #1961

Closed
fubuloubu opened this issue Mar 12, 2024 · 1 comment · Fixed by #1965
Closed
Assignees
Labels
category: bug Something isn't working

Comments

@fubuloubu
Copy link
Member

Environment information

  • OS: linux
  • Python Version: 3.9.14
  • ape and plugin versions:
$ ape --version
0.7.7

$ ape plugins list
Installed Plugins
  ens          0.7.0
  etherscan    0.7.0
  foundry      0.7.0
  infura       0.7.0
  ledger       0.7.0
  optimism     0.7.3
  safe         0.7.0b2.dev6+g20a5330
  solidity     0.7.0
  tokens       0.7.0
  • Contents of your ape-config.yaml (NOTE: do not post anything private like RPC urls or secrets!):
$ cat ape-config.yaml
contracts_folder: tests/contracts

plugins:
  - name: foundry
  - name: solidity
  - name: etherscan
  - name: alchemy

ethereum:
  mainnet:
    default_provider: alchemy
  local:
    default_provider: foundry

dependencies:
  - name: openzeppelin
    github: OpenZeppelin/openzeppelin-contracts
    version: 3.4.0
  - name: safe-contracts
    npm: "@gnosis.pm/safe-contracts"
    version: 1.3.0
    config_override:
      solidity:
        version: 0.7.6
      compile:
        exclude:
          - "test/*"
          - "interfaces/*"

solidity:
  import_remapping:
    - "@openzeppelin/contracts=openzeppelin/v3.4.0"
    - "@gnosis=safe-contracts/v1.3.0"

foundry:
  fork:
      ethereum:
        mainnet:
          upstream_provider: alchemy
          block_number: 15776634
        goerli:
          upstream_provider: alchemy
          block_number: 7849922
        sepolia:
          upstream_provider: alchemy
          block_number: 3091950

What went wrong?

When working on ApeWorX/ape-safe#41 I noticed that unlike ape_accounts.KeyfileAccount, ape_ledger.LedgerAccount, ape_trezor.TrezorAccount, or ape_frame.FrameAccount, the default built-in test accounts do not allow signing eip712.EIP712Message struct types, for which I had to monkeypatch this behavior to maintain a consistent interface in the feature I was working on.

How can it be fixed?

Add handling for eip712.EIP712Message signing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant