integrity

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balance

type Balance struct {
	ID              string
	Currency        string
	Balance         string
	Credit          string
	Debit           string
	InflightBalance string
	InflightCredit  string
	InflightDebit   string
}

type Issue

type Issue struct {
	Kind          string `json:"kind"`
	BalanceID     string `json:"balance_id,omitempty"`
	TransactionID string `json:"transaction_id,omitempty"`
	Field         string `json:"field,omitempty"`
	Expected      string `json:"expected,omitempty"`
	Actual        string `json:"actual,omitempty"`
	Message       string `json:"message"`
}

type Reader

type Reader interface {
	ReadIntegritySnapshot(context.Context) (Snapshot, error)
}

type Report

type Report struct {
	Verified     bool    `json:"verified"`
	Balances     int     `json:"balances"`
	Transactions int     `json:"transactions"`
	Issues       []Issue `json:"issues"`
}

func Check

func Check(snapshot Snapshot) Report

Check replays committed legs and reservation releases with integer arithmetic. The current engine ignores the retained rate field and credits the same minor units it debits. Legacy non-unit rates cannot identify which historic engine semantics produced a row, so those rows are explicitly unsupported.

func Verify

func Verify(ctx context.Context, reader Reader) (Report, error)

Verify never repairs or invokes reconciliation. Unsupported legacy evidence prevents a clean verdict, rather than silently assuming a monetary value.

type Snapshot

type Snapshot struct {
	Balances     []Balance
	Transactions []model.ChainRow
}

Snapshot contains only persisted economic evidence. Readers must obtain both collections in the same read-only REPEATABLE READ database transaction.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL