coinbase / smart-wallet

MIT License
258 stars 47 forks source link

Get CoinbaseSmartWallet to 100% test coverage #36

Closed stevieraykatz closed 3 months ago

stevieraykatz commented 3 months ago

As part of an ongoing effort to achieve 100% coverage for all contracts in this repo...

  1. Added a test for a (currently) impossible to reach case wherein an invalid ethereum address is stored as an owner for a smart wallet. This is achieved by directly writing an invalid owner bytes into the storage of MultiOwnable before making a call to isValidSignature.
  2. Added a test for the implementation() method

foundry coverage report as of this PR:

| File                                             | % Lines          | % Statements     | % Branches      | % Funcs         |
|--------------------------------------------------|------------------|------------------|-----------------|-----------------|
| script/DeployERC4337Factory.s.sol                | 0.00% (0/8)      | 0.00% (0/12)     | 100.00% (0/0)   | 0.00% (0/2)     |
| src/CoinbaseSmartWallet.sol                      | 100.00% (46/46)  | 100.00% (65/65)  | 100.00% (22/22) | 100.00% (13/13) |
| src/CoinbaseSmartWalletFactory.sol               | 100.00% (10/10)  | 100.00% (10/10)  | 75.00% (3/4)    | 75.00% (3/4)    |
| src/ERC1271.sol                                  | 85.71% (12/14)   | 89.47% (17/19)   | 100.00% (2/2)   | 100.00% (6/6)   |
| src/MultiOwnable.sol                             | 100.00% (27/27)  | 100.00% (38/38)  | 80.00% (8/10)   | 100.00% (13/13) |
| src/utils/ERC1271InputGenerator.sol              | 0.00% (0/9)      | 0.00% (0/14)     | 0.00% (0/6)     | 0.00% (0/1)     |
| test/CoinbaseSmartWallet/SmartWalletTestBase.sol | 0.00% (0/16)     | 0.00% (0/18)     | 0.00% (0/1)     | 0.00% (0/6)     |
| test/CoinbaseSmartWallet/UpgradeToAndCall.t.sol  | 100.00% (1/1)    | 100.00% (1/1)    | 100.00% (0/0)   | 50.00% (1/2)    |
| test/MultiOwnable/MultiOwnableTestBase.t.sol     | 0.00% (0/3)      | 0.00% (0/3)      | 100.00% (0/0)   | 0.00% (0/1)     |
| test/mocks/MockCoinbaseSmartWallet.sol           | 50.00% (1/2)     | 66.67% (2/3)     | 100.00% (0/0)   | 50.00% (1/2)    |
| test/mocks/MockEntryPoint.sol                    | 40.00% (2/5)     | 33.33% (2/6)     | 0.00% (0/2)     | 33.33% (1/3)    |
| test/mocks/MockMultiOwnable.sol                  | 100.00% (1/1)    | 100.00% (1/1)    | 100.00% (0/0)   | 100.00% (1/1)   |
| test/mocks/MockTarget.sol                        | 80.00% (4/5)     | 100.00% (4/4)    | 0.00% (0/1)     | 66.67% (2/3)    |
| Total                                            | 70.75% (104/147) | 72.16% (140/194) | 72.92% (35/48)  | 71.93% (41/57)  |
cb-heimdall commented 3 months ago

Review Error for wilsoncusack @ 2024-03-19 00:52:09 UTC User failed mfa authentication, see go/mfa-help

cb-heimdall commented 3 months ago

Review Error for wilsoncusack @ 2024-03-19 18:01:50 UTC User failed mfa authentication, see go/mfa-help