@ceramicnetwork/core
Version:
Typescript implementation of the Ceramic protocol
8 lines • 600 B
JavaScript
import { StreamUtils } from '@ceramicnetwork/common';
export async function applyTipToState(logSyncer, anchorTimestampExtractor, stateManipulator, state, tip, opts) {
const streamID = StreamUtils.streamIdFromState(state);
const logWithoutTimestamps = await logSyncer.syncLogUntilMatch(streamID, tip, state.log.map((logEntry) => logEntry.cid));
const logWithTimestamps = await anchorTimestampExtractor.verifyAnchorAndApplyTimestamps(streamID, logWithoutTimestamps);
return stateManipulator.applyLogToState(state, logWithTimestamps, opts);
}
//# sourceMappingURL=apply-tip-helper.js.map