MCPcopy Index your code
hub / github.com/numbersprotocol/nit / log

Function log

src/nit.ts:332–344  ·  view source on GitHub ↗
(assetCid: string, blockchainInfo, fromIndex: number, toIndex: number = null)

Source from the content-addressed store, hash-verified

330}
331
332export async function log(assetCid: string, blockchainInfo, fromIndex: number, toIndex: number = null) {
333 const network = await blockchainInfo.provider.getNetwork();
334
335 if (toIndex <= fromIndex) {
336 const commitBlockNumbers = await getCommitBlockNumbers(assetCid, blockchainInfo);
337 const commitAmount: number = commitBlockNumbers.length;
338 toIndex = commitAmount;
339 }
340
341 const commitEvents = await iterateCommitEvents(assetCid, blockchainInfo, fromIndex, toIndex);
342 const commits = await getCommits(commitEvents);
343 await showCommits(commits);
344}
345
346export async function getCommit(assetCid: string, blockchainInfo, blockNumber: number) {
347 const filter = await blockchainInfo.contract.filters.Commit(null, assetCid);

Callers

nothing calls this directly

Calls 4

getCommitBlockNumbersFunction · 0.85
iterateCommitEventsFunction · 0.85
getCommitsFunction · 0.85
showCommitsFunction · 0.85

Tested by

no test coverage detected