import DownloadManager from './DownloadManager'; import IBatchWriter from './interfaces/IBatchWriter'; import IBlockchain from './interfaces/IBlockchain'; import ICas from './interfaces/ICas'; import Config from './models/Config'; import IOperationProcessor from './interfaces/IOperationProcessor'; import IOperationStore from './interfaces/IOperationStore'; import IRequestHandler from './interfaces/IRequestHandler'; import ITransactionProcessor from './interfaces/ITransactionProcessor'; import IVersionManager from './interfaces/IVersionManager'; import Resolver from './Resolver'; /** * Defines a protocol version and its starting blockchain time. */ export interface ProtocolVersionModel { /** The inclusive starting logical blockchain time that this protocol applies to. */ startingBlockchainTime: number; version: string; } /** * The class that handles the loading of different versions of protocol codebase. */ export default class VersionManager implements IVersionManager { private config; private protocolVersionsReverseSorted; private batchWriters; private operationProcessors; private requestHandlers; private transactionProcessors; private protocolVersionMetadatas; constructor(config: Config, protocolVersions: ProtocolVersionModel[]); /** * Loads all the versions of the protocol codebase. */ initialize(blockchain: IBlockchain, cas: ICas, downloadManager: DownloadManager, operationStore: IOperationStore, resolver: Resolver): Promise; /** * Gets the corresponding version of the `IBatchWriter` based on the given blockchain time. */ getBatchWriter(blockchainTime: number): IBatchWriter; /** * Gets the corresponding version of the `IOperationProcessor` based on the given blockchain time. */ getOperationProcessor(blockchainTime: number): IOperationProcessor; /** * Gets the corresponding version of the `IRequestHandler` based on the given blockchain time. */ getRequestHandler(blockchainTime: number): IRequestHandler; /** * Gets the corresponding version of the `TransactionProcessor` based on the given blockchain time. */ getTransactionProcessor(blockchainTime: number): ITransactionProcessor; /** * Gets the corresponding protocol version string given the blockchain time. */ private getVersionString; private loadDefaultExportsForVersion; }