dop-stick
Version:
Source control tooling for versionable-upgradeable smart contracts
91 lines • 4.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.InfoTimelineAdapter = void 0;
const timelineLogAdapter_1 = require("./timelineLogAdapter");
const terminal_1 = require("../core/terminal");
const logFormatters_1 = require("../logFormatters");
const ICONS = {
INFO: 'ℹ️',
FACETS: '💎',
FUNCTIONS: '⚡',
EVENTS: '📡',
ANALYSIS: '🔍',
DOCS: '📝',
CACHE: '💾',
SUCCESS: '✓',
ERROR: '✖',
WARNING: '⚠️',
STATS: '📊',
COMPARE: '⚖️',
UNKNOWN: '❓'
};
const COLORS = {
HEADER: '\x1b[95m',
SUCCESS: terminal_1.Terminal.colors.success,
ERROR: terminal_1.Terminal.colors.error,
WARNING: terminal_1.Terminal.colors.warning,
INFO: terminal_1.Terminal.colors.info,
MUTED: terminal_1.Terminal.colors.muted,
RESET: terminal_1.Terminal.colors.reset
};
class InfoTimelineAdapter {
constructor() {
this.timeline = new timelineLogAdapter_1.TimelineLogAdapter();
}
startInfoProcess(diamondAddress, network) {
this.timeline.startSection(`${ICONS.INFO} DIAMOND ANALYSIS`);
this.timeline.logInnerStep(`• Diamond: ${logFormatters_1.LogFormatters.makeAddressCopyable(diamondAddress)}`, 1);
this.timeline.logInnerStep(`• Network: ${network}`, 1);
this.timeline.logEmptyStep();
}
logFacetsAnalysis(totalFacets, totalSelectors, unknownSelectors) {
this.timeline.logStep(`${ICONS.FACETS} Facets Analysis`);
this.timeline.logInnerStep(`• Total Facets: ${totalFacets}`, 1);
this.timeline.logInnerStep(`• Total Selectors: ${totalSelectors}`, 1);
this.timeline.logInnerStep(`• Unknown Selectors: ${unknownSelectors}`, 1);
this.timeline.logEmptyStep();
}
logFacetProcessing(facetName, address) {
this.timeline.logStep(`${ICONS.FUNCTIONS} Processing Facet: ${facetName}`);
this.timeline.logInnerStep(`• Address: ${logFormatters_1.LogFormatters.makeAddressCopyable(address)}`, 1);
}
logFacetEvents(facetName, eventCount) {
this.timeline.logInnerStep(`• Events Found: ${eventCount}`, 1);
this.timeline.logEmptyStep();
}
logComparisonAnalysis(matched, unmatched) {
this.timeline.logStep(`${ICONS.COMPARE} Comparison Analysis`);
this.timeline.logInnerStep(`• Matched Selectors: ${matched}`, 1);
this.timeline.logInnerStep(`• Discrepancies: ${unmatched}`, 1);
this.timeline.logEmptyStep();
}
logDocumentationGeneration(markdownPath, jsonPath, hash, timestamp) {
this.timeline.logStep(`${ICONS.DOCS} Documentation Generated`);
this.timeline.logInnerStep(`• Markdown: ${markdownPath}`, 1);
this.timeline.logInnerStep(`• JSON: ${jsonPath}`, 1);
this.timeline.logInnerStep(`• Hash: ${hash}`, 1);
this.timeline.logInnerStep(`• Timestamp: ${timestamp}`, 1);
this.timeline.logEmptyStep();
}
logAnalysisSummary(data) {
this.timeline.logStep(`${ICONS.STATS} Analysis Summary`);
this.timeline.logInnerStep(`• Total Facets: ${data.totalFacets}`, 1);
this.timeline.logInnerStep(`• Total Selectors: ${data.totalSelectors}`, 1);
this.timeline.logInnerStep(`• Unknown Selectors: ${data.unknownSelectors}`, 1);
this.timeline.logInnerStep(`• Discrepancies: ${data.discrepancies}`, 1);
this.timeline.logEmptyStep();
}
logError(message, details) {
this.timeline.logStep(`${ICONS.ERROR} Error`);
this.timeline.logInnerColoredStep(`• ${message}`, 1, COLORS.ERROR);
if (details) {
this.timeline.logInnerColoredStep(`• Details: ${JSON.stringify(details, null, 2)}`, 1, COLORS.ERROR);
}
this.timeline.logEmptyStep();
}
completeInfoProcess() {
this.timeline.logColoredStep(`${ICONS.SUCCESS} Analysis completed successfully`, 0, COLORS.SUCCESS);
}
}
exports.InfoTimelineAdapter = InfoTimelineAdapter;
//# sourceMappingURL=infoTimelineAdapter.js.map