Extract out getLedgerFromIndex from lookupLedger.