metadata

package
v0.0.0-...-19a5819 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: ISC Imports: 5 Imported by: 0

Documentation

Overview

Package metadata provides test helpers for validating transaction metadata. Ported from rippled test helpers (Discrepancy_test.cpp, Freeze_test.cpp, etc.).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNodeCount

func CheckNodeCount(t *testing.T, result jtx.TxResult, expected int)

CheckNodeCount verifies the number of AffectedNodes in metadata.

func CheckXRPConservation

func CheckXRPConservation(t *testing.T, result jtx.TxResult, fee uint64)

CheckXRPConservation verifies that XRP is conserved across a transaction's metadata. For every AccountRoot in AffectedNodes, sums the previous and final Balance values. Verifies: sumPrev - sumFinal == fee (XRP destroyed equals the fee). Ported from rippled's Discrepancy_test.cpp testXRPDiscrepancy().

func FindNode

func FindNode(meta *tx.Metadata, nodeType, entryType string) *tx.AffectedNode

FindNode finds the first AffectedNode matching the given type and entry type.

func FindNodeByAccount

func FindNodeByAccount(meta *tx.Metadata, account string) *tx.AffectedNode

FindNodeByAccount finds the first ModifiedNode AccountRoot for a specific account.

func FindNodes

func FindNodes(meta *tx.Metadata, nodeType, entryType string) []*tx.AffectedNode

FindNodes finds all AffectedNodes matching the given type and entry type.

func GetFinalField

func GetFinalField(node *tx.AffectedNode, field string) any

GetFinalField extracts a field from FinalFields of an AffectedNode.

func GetNewField

func GetNewField(node *tx.AffectedNode, field string) any

GetNewField extracts a field from NewFields of an AffectedNode.

func GetPreviousField

func GetPreviousField(node *tx.AffectedNode, field string) any

GetPreviousField extracts a field from PreviousFields of an AffectedNode.

func ToUint32

func ToUint32(v any) uint32

ToUint32 converts various numeric types to uint32.

Types

This section is empty.

Jump to

Keyboard shortcuts

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