Commit graph

2 commits

Author SHA1 Message Date
Arran Schlosberg
ba9ab538b9
feat: options.ApplyTo for default values (#225)
## Why this should be merged

Adds default-value support to the `options` package, which could
previously only create configured types from zero values.

## How this works

Exposes the option-application loop as the `ApplyTo()` function and
refactors `As()` to share this code path.

## How this was tested

Testable example acting as a unit test.
2025-09-09 15:11:33 +01:00
Arran Schlosberg
44068c8bab
refactor: abstract options package (#74)
## Why this should be merged

Simplifies the creation and application of variadic options; this is
also applicable to many of my other WIP branches (e.g. `snapshot`).

## How this works

See `libevm/options/options.go`, which is very simple.

## How this was tested

Existing tests of `vm.PrecompileEnvironment.Call()`, which itself uses
refactored options.
2024-11-21 13:59:51 -08:00