dop-stick
Version:
Source control tooling for versionable-upgradeable smart contracts
130 lines • 5.89 kB
JavaScript
;
// import { TimelineLogAdapter } from '../adapters/timelineLogAdapter';
// import { ParallelBatchLogAdapter } from '../adapters/parallelBatchLogAdapter';
// import { ValidationLogAdapter } from '../adapters/validationLogAdapter';
// import { ReviewAdapter } from '../adapters/reviewAdapter';
// import { ParallelDeploymentLogAdapter } from '../adapters/parallelDeploymentLogAdapter';
// import { ExecuteUpgradeLogAdapter } from '../adapters/executeUpgradeLogAdapter';
// import { FinalSummaryAdapter } from '../adapters/finalSummaryAdapter';
// export class UnifiedLogger {
// private static instance: UnifiedLogger;
// private timeline: TimelineLogAdapter;
// // Keep existing adapters for backward compatibility
// private batchAdapter: ParallelBatchLogAdapter;
// private validationAdapter: ValidationLogAdapter;
// private reviewAdapter: ReviewAdapter;
// private deploymentAdapter: ParallelDeploymentLogAdapter;
// private upgradeAdapter: ExecuteUpgradeLogAdapter;
// private summaryAdapter: FinalSummaryAdapter;
// private constructor(mode: UpgradeMode) {
// this.timeline = new TimelineLogAdapter();
// this.batchAdapter = new ParallelBatchLogAdapter();
// this.validationAdapter = new ValidationLogAdapter();
// this.reviewAdapter = new ReviewAdapter(mode);
// this.deploymentAdapter = new ParallelDeploymentLogAdapter();
// this.upgradeAdapter = new ExecuteUpgradeLogAdapter();
// this.summaryAdapter = new FinalSummaryAdapter(mode);
// }
// static getInstance(mode: UpgradeMode): UnifiedLogger {
// if (!UnifiedLogger.instance) {
// UnifiedLogger.instance = new UnifiedLogger(mode);
// }
// return UnifiedLogger.instance;
// }
// // Start the upgrade process
// startUpgrade(networkInfo: NetworkInfo): void {
// this.timeline.startTimeline(networkInfo);
// }
// // Batch Creation Section
// startBatchCreation(): void {
// this.timeline.startSection('BATCH CREATION');
// // Keep existing adapter for compatibility
// this.batchAdapter.startBatchCreation();
// }
// logBatchResults(batches: BatchSummary[]): void {
// this.timeline.logBatchResults(batches);
// // Keep existing adapter for compatibility
// this.batchAdapter.logBatchResults(batches);
// }
// // Validation Section
// startValidation(totalModules: number): void {
// this.timeline.startSection('VALIDATION');
// this.validationAdapter.startBatchValidation(totalModules);
// }
// logModuleValidation(result: ValidationResult): void {
// this.timeline.logModuleValidation(result);
// this.validationAdapter.logModuleValidation(
// result.moduleName,
// result.totalFunctions,
// result.missingCount,
// result.collisionCount,
// result.suggestedChanges.size
// );
// }
// // Review Section
// async processReview(validationResults: ModuleBatchValidationResult[]): Promise<boolean> {
// this.timeline.startSection('REVIEW');
// const summary = this.prepareReviewSummary(validationResults);
// this.timeline.logReviewSummary(summary);
// return await this.reviewAdapter.processValidationResults(validationResults);
// }
// // Deployment Section
// startDeployment(networkInfo: NetworkInfo): void {
// this.timeline.startSection('DEPLOYMENT');
// this.deploymentAdapter.startParallelDeployment();
// }
// logDeploymentProgress(state: DeploymentState): void {
// this.timeline.logDeploymentProgress(state);
// // Map to existing adapter methods based on state
// if (state.txHash && !state.isComplete) {
// this.deploymentAdapter.logTransactionSent(state.moduleName, state.txHash);
// }
// if (state.isComplete && state.address) {
// this.deploymentAdapter.logDeploymentSuccess(state.moduleName, state.address, state.stats);
// }
// if (state.error) {
// this.deploymentAdapter.logDeploymentError(state.moduleName, state.error);
// }
// }
// // Upgrade Section
// startUpgradeExecution(info: UpgradeInfo): void {
// this.timeline.startSection('DIAMOND UPGRADE');
// this.upgradeAdapter.startUpgrade({
// name: info.network.name,
// chainId: info.network.chainId,
// diamondAddress: info.diamondAddress
// });
// }
// logUpgradeProgress(progress: UpgradeProgress): void {
// this.timeline.logUpgradeProgress(progress);
// // Map to existing upgrade adapter methods
// switch (progress.type) {
// case 'preparation':
// this.upgradeAdapter.logPreparation(progress.cuts);
// break;
// case 'execution':
// this.upgradeAdapter.startExecution(progress.cuts);
// break;
// case 'confirmation':
// this.upgradeAdapter.logConfirmation(
// progress.blockNumber,
// progress.gasUsed,
// progress.cost
// );
// break;
// case 'error':
// this.upgradeAdapter.logError(progress.error, progress.txHash);
// break;
// }
// }
// // Final Summary Section
// logFinalSummary(summary: FinalSummary): void {
// this.timeline.logFinalSummary(summary);
// this.summaryAdapter.displayFinalSummary(summary.finalCuts);
// }
// // Error handling
// logError(section: string, error: Error): void {
// this.timeline.logError(section, error);
// }
// }
//# sourceMappingURL=unifiedLogger.js.map