Skip to content

[v0.2.0] README: add common-recipes section #71

Description

@neverDefined

Problem

The README explains what go-anvil is but doesn't show common end-to-end patterns. New users have to piece together calls from godoc.

Proposal

Add a "Recipes" section after the Quick Start with 4-6 short, copy-pasteable snippets. Pull these from the godoc Example functions in #70 so they stay in sync (or vice versa — link from README to godoc Examples).

Suggested recipes:

  1. Fund a fresh accountNewFundedAccount (depends on [v0.2.0] Wallet helpers: FundAccounts and NewFundedAccount #56).
  2. Time-travel a block timestampAdvanceTime (depends on [v0.2.0] Time-travel ergonomics: AdvanceBlocks and AdvanceTime #57).
  3. Snapshot, mutate, revert — Snapshot/Revert pattern.
  4. Fork from mainnetWithFork + WithForkBlockNumber.
  5. Impersonate a whaleImpersonate + SetBalance.
  6. Trace a failing txDebugTraceTransaction (depends on [v0.2.0] Add debug_traceTransaction and debug_traceCall wrappers #58).

Each recipe: 8-12 lines, no error handling boilerplate (use must style or just _, _ = ... for brevity, with a comment noting the user should handle errors in real code).

Acceptance criteria

  • Recipes section in README.
  • Cross-link between README and pkg.go.dev godoc Examples.
  • Recipes don't drift from real code — either they're copied from the Example functions, or there's a CI check that they compile (e.g. go run a sample file).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:docsREADME, godoc, examples, contributingtype:choreHousekeeping, no user-visible change

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions