<commit_before>package data

import (
	"fmt"
	"sort"
)

type LedgerEntryState uint8

const (
	Created LedgerEntryState = iota
	Modified
	Deleted
)

type AffectedNode struct {
	FinalFields       LedgerEntry `json:",omitempty"`
	LedgerEntryType   LedgerEntryType
	LedgerIndex       *Hash256    `json:",omitempty"`
	PreviousFields    LedgerEntry `json:",omitempty"`
	NewFields         LedgerEntry `json:",omitempty"`
	PreviousTxnID     *Hash256    `json:",omitempty"`
	PreviousTxnLgrSeq *uint32     `json:",omitempty"`
}

type NodeEffect struct {
	ModifiedNode *AffectedNode `json:",omitempty"`
	CreatedNode  *AffectedNode `json:",omitempty"`
	DeletedNode  *AffectedNode `json:",omitempty"`
}

type NodeEffects []NodeEffect

type MetaData struct {
	AffectedNodes     NodeEffects
	TransactionIndex  uint32
	TransactionResult TransactionResult
	DeliveredAmount   *Amount `json:",omitempty"`
}

type TransactionSlice []*TransactionWithMetaData

func (s TransactionSlice) Len() int      { return len(s) }
func (s TransactionSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
func (s TransactionSlice) Less(i, j int) bool {
	if s[i].LedgerSequence == s[j].LedgerSequence {
		return s[i].MetaData.TransactionIndex < s[j].MetaData.TransactionIndex
	}
	return s[i].LedgerSequence < s[j].LedgerSequence<commit_msg>Fix DeliveredAmount unmarshalling<commit_after>package data

import (
	"fmt"
	"sort"
)

type LedgerEntryState uint8

const (
	Created LedgerEntryState = iota
	Modified
	Deleted
)

type AffectedNode struct {
	FinalFields       LedgerEntry `json:",omitempty"`
	LedgerEntryType   LedgerEntryType
	LedgerIndex       *Hash256    `json:",omitempty"`
	PreviousFields    LedgerEntry `json:",omitempty"`
	NewFields         LedgerEntry `json:",omitempty"`
	PreviousTxnID     *Hash256    `json:",omitempty"`
	PreviousTxnLgrSeq *uint32     `json:",omitempty"`
}

type NodeEffect struct {
	ModifiedNode *AffectedNode `json:",omitempty"`
	CreatedNode  *AffectedNode `json:",omitempty"`
	DeletedNode  *AffectedNode `json:",omitempty"`
}

type NodeEffects []NodeEffect

type MetaData struct {
	AffectedNodes     NodeEffects
	TransactionIndex  uint32
	TransactionResult TransactionResult
	DeliveredAmount   *Amount `json:"delivered_amount,omitempty"`
}

type TransactionSlice []*TransactionWithMetaData

func (s TransactionSlice) Len() int      { return len(s) }
func (s TransactionSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
func (s TransactionSlice) Less(i, j int) bool {
	if s[i].LedgerSequence == s[j].LedgerSequence {
		return s[i].MetaData.TransactionIndex < s[j].MetaData.TransactionIndex
	}
	return s[i].LedgerSequence < s[j].LedgerSequence
{'fraction_non_alphanumeric': 0.11220621683093253, 'fraction_numerical': 0.008339651250947688, 'mean_word_length': 5.094688221709007, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1497389', 'n_tokens_mistral': 863, 'n_tokens_neox': 851, 'n_words': 201}