Skip to content

test(b20): exclude the token address from burnWithMemo revert-order callers - #247

Open
rayyan224 wants to merge 1 commit into
mainfrom
test/b20-burn-memo-revert-order-flake
Open

rayyan224 wants to merge 1 commit into
mainfrom
test/b20-burn-memo-revert-order-flake

Conversation

@rayyan224

Copy link
Copy Markdown
Collaborator

test_burnWithMemo_revertOrder fuzzes the caller and only excludes the zero address, vm, the precompile addresses and the admin. The fuzzer can pick address(token), so _mint(caller, amount) reverts with InvalidReceiver and the test fails intermittently (seen on #243: https://github.com/base/base-std/actions/runs/39852211956).

Adds vm.assume(caller != address(token)).

Testing: forge test --match-path test/unit/B20/supply/burnWithMemo_revertOrder.t.sol passes; forge fmt --check is clean. Other tests that call _assumeValidCaller and then mint to the caller may have the same gap; I did not audit them here.

…allers

The fuzzer can pick address(token) as the caller, which makes _mint(caller, ...) revert with InvalidReceiver and fails the test intermittently.

Co-authored-by: Toshi <toshi-noreply@coinbase.com>
@github-actions

Copy link
Copy Markdown

Interface Coverage

✅ All interface functions have test coverage.

@github-actions

Copy link
Copy Markdown

📊 Forge Coverage (src/lib/)

🟡 ≥95% across all metrics — some metrics below 99%.

File Lines Stmts Branches Funcs
🟡 B20FactoryLib.sol 97.70% 98.00% 100.00% 95.00%
🔴 test/lib/ForceFeeder.sol 0.00% 0.00% 100.00% 0.00%
🔴 test/lib/PrecompileProbe.sol 0.00% 0.00% 0.00% 0.00%
🟢 MockActivationRegistry.sol 100.00% 100.00% 100.00% 100.00%
🟢 MockActivationRegistryStorage.sol 100.00% 100.00% 100.00% 100.00%
🟢 MockB20.sol 100.00% 99.68% 100.00% 100.00%
🟢 MockB20Asset.sol 100.00% 100.00% 100.00% 100.00%
🟡 MockB20Factory.sol 98.96% 99.10% 100.00% 100.00%
🟢 MockB20Stablecoin.sol 100.00% 100.00% 100.00% 100.00%
🟢 MockB20Storage.sol 100.00% 100.00% 100.00% 100.00%
🟢 MockBaseTime.sol 100.00% 100.00% 100.00% 100.00%
🟡 MockPolicyRegistry.sol 100.00% 99.58% 97.78% 100.00%
🟢 MockPolicyRegistryStorage.sol 100.00% 100.00% 100.00% 100.00%
Total 97.14% 97.51% 98.21% 97.07%

Full report: download artifact. To browse locally: make coverage (runs forge coverage + genhtml + opens the HTML report).

@github-actions

Copy link
Copy Markdown

❌ Fork tests did not complete

No completed, non-empty suite was recorded. Check the workflow logs for build, setup, or execution errors.

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.

1 participant