import { P2P, StateManager } from '@shardeum-foundation/lib-types'; import * as ShardusTypes from '../shardus/shardus-types'; import { Cycle, CycleShardData } from '../state-manager/state-manager-types'; import { hashMap } from './partition-gossip'; import { NetworkClass } from '../network'; /** TYPES */ type txId = string; type txId2 = string; type ReceiptMap = Map; export declare function calculatePartitionBlock(shard: { ourStoredPartitions: number[]; }): Map; export declare function createNetworkHash(hashes: Map): P2P.SnapshotTypes.NetworkStateHash; export declare function updateStateHashesByCycleMap(counter: Cycle['counter'], stateHash: P2P.SnapshotTypes.StateHashes, stateHashesByCycle: Iterable): Map; export declare function updateReceiptHashesByCycleMap(counter: Cycle['counter'], receiptHash: P2P.SnapshotTypes.ReceiptHashes, receiptHashesByCycle: Iterable): Map; export declare function updateSummaryHashesByCycleMap(counter: Cycle['counter'], summaryHashes: P2P.SnapshotTypes.SummaryHashes, summaryHashesByCycle: Iterable): Map; export declare function savePartitionAndNetworkHashes(shard: CycleShardData, partitionHashes: hashMap, networkHash: P2P.SnapshotTypes.NetworkStateHash): Promise; export declare function saveReceiptAndNetworkHashes(shard: CycleShardData, receiptMapHashes: hashMap, networkReceiptHash: P2P.SnapshotTypes.NetworkReceiptHash): Promise; export declare function saveSummaryAndNetworkHashes(shard: CycleShardData, summaryHashes: hashMap, summaryReceiptHash: P2P.SnapshotTypes.NetworkSummarytHash): Promise; export declare function readOldCycleRecord(): Promise; export declare function readOldNetworkHash(): Promise<{ hash: string; }>; export declare function readOldPartitionHashes(): Promise<{ hash: string; partitionId: string; }[]>; export declare function calculateOldDataMap(shardGlobals: StateManager.shardFunctionTypes.ShardGlobals, nodeShardDataMap: StateManager.shardFunctionTypes.NodeShardDataMap, oldPartitionHashMap: Map, lastSnapshotCycle: number): Promise>; export declare function copyOldDataToDataToMigrate(oldDataMap: Map, dataToMigrate: Map): void; export declare function getMissingPartitions(shardGlobals: StateManager.shardFunctionTypes.ShardGlobals, oldDataMap: Map): number[]; export declare function registerDownloadRoutes(network: NetworkClass, oldDataMap: Map, oldPartitionHashMap: Map): void; export declare function downloadDataFromNode(url: string): Promise; /** If necessary, convert `inputMap` to a plan object. If the value passed to * this function is a `Map`, it will be converted. if it is not a `Map`, * we'll just return the value as it was passed. */ export declare function convertMapToObj(inputMap: Map | object): object; export {};