vault.export_post_processing
Documentation for eth_defi.vault.export_post_processing Python module.
Best-effort cleanup hooks for vault metadata exports.
The scanner stores raw discovery metadata for protocol-specific readers. The
public JSON export may need a small amount of derived cleanup before metrics
are calculated. Hooks in this module receive only the in-memory
VaultDatabase used by that export.
Every hook is isolated. A broken offchain service or malformed optional record is logged and the export continues with the data it already has. This is deliberate: post-processing must not take down the long-running scanner.
Functions
|
Run export cleanup hooks without allowing one to stop the pipeline. |
- run_vault_export_post_processors(vault_db, processors=(<function clean_yearn_vault_metadata>, ))
Run export cleanup hooks without allowing one to stop the pipeline.
Hooks mutate only
vault_dbin memory. Each hook is timed and isolated; an exception is logged with a traceback and the next hook still runs. The returned IDs are useful to refresh stale sticky-export rows, but a failed hook simply contributes no IDs and leaves the original metadata intact.- Parameters
vault_db (eth_defi.vault.vaultdb.VaultDatabase) – In-memory database loaded for the current JSON export.
processors (tuple[collections.abc.Callable[[eth_defi.vault.vaultdb.VaultDatabase], collections.abc.Iterable[str]], ...]) – Ordered cleanup hooks. Tests may provide a small explicit tuple.
- Returns
Union of vault IDs changed by successfully completed hooks.
- Return type