Skip to content

Faucet DX: fix no-op behavior and add explicit feedback#25

Merged
snissn merged 1 commit into
masterfrom
fix/faucet-noop-feedback
Feb 5, 2026
Merged

Faucet DX: fix no-op behavior and add explicit feedback#25
snissn merged 1 commit into
masterfrom
fix/faucet-noop-feedback

Conversation

@snissn

@snissn snissn commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Fixes the faucet button no-op behavior by improving both backend compatibility and frontend feedback.

What changed

  • Faucet server now tries both local RPC methods to set balance:
    • anvil_setBalance
    • hardhat_setBalance
  • If neither method is available, returns a clear error instead of silently doing nothing.
  • Faucet response now includes the method used and before/after balances.
  • UI faucet button now shows explicit outcomes:
    • Faucet funded (X ETH -> Y ETH) when balance was topped up
    • Already funded (Y ETH) when no top-up was needed

Why

  • Users reported button clicks that appeared to do nothing.
  • Local chains can be Anvil or Hardhat-compatible; only supporting one RPC method is brittle.
  • Explicit feedback makes faucet behavior observable and debuggable.

Validation

  • pnpm test (29 passing)

Fallback to hardhat_setBalance when anvil_setBalance is unavailable, and show explicit funded/already-funded feedback in UI.
@snissn snissn merged commit 5d77439 into master Feb 5, 2026
1 check passed
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