Skip to content

Commit

Permalink
Helper functions for xdr.LedgerCloseMeta
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikiyer56 committed Dec 7, 2024
1 parent acdf16e commit 3b3bf8c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions xdr/ledger_close_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,20 @@ func (l LedgerCloseMeta) UpgradesProcessing() []UpgradeEntryMeta {
}
}

func (l LedgerCloseMeta) HasUpgradeChanges() bool {
return len(l.UpgradesProcessing()) != 0
}

func (l LedgerCloseMeta) IsFirstLedgerAfterProtocolUpgrade() bool {
upgradeMeta := l.UpgradesProcessing()
for _, upgrade := range upgradeMeta {
if upgrade.Upgrade.Type == LedgerUpgradeTypeLedgerUpgradeVersion {
return true
}
}
return false
}

// EvictedTemporaryLedgerKeys returns a slice of ledger keys for
// temporary ledger entries that have been evicted in this ledger.
func (l LedgerCloseMeta) EvictedTemporaryLedgerKeys() ([]LedgerKey, error) {
Expand Down

0 comments on commit 3b3bf8c

Please sign in to comment.