graceEndedText function

String graceEndedText(
  1. WalletLocalizations l10n,
  2. GraceExpiry by,
  3. int? blocksSinceLastCurrent
)

Why the grace ended, as one sentence with the next step — see unknownBranchGraceText. blocksSinceLastCurrent is what the blocks sentence names; a missing count falls to the never-confirmed sentence rather than inventing a number.

Implementation

String graceEndedText(
  WalletLocalizations l10n,
  GraceExpiry by,
  int? blocksSinceLastCurrent,
) {
  return switch (by) {
    GraceExpiry.blocks when blocksSinceLastCurrent != null =>
      l10n.walletSyncGraceEndedBlocks(
        compactBlockCount(blocksSinceLastCurrent, l10n.localeName),
      ),
    GraceExpiry.clock => l10n.walletSyncGraceEndedClock,
    GraceExpiry.blocks ||
    GraceExpiry.neverConfirmed ||
    GraceExpiry.unknown => l10n.walletSyncGraceNeverConfirmed,
  };
}