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

Function extendCommits

src/commitdb.ts:74–84  ·  view source on GitHub ↗
(assetCid, blockchainInfo, fromIndex, toIndex)

Source from the content-addressed store, hash-verified

72}
73
74export async function extendCommits(assetCid, blockchainInfo, fromIndex, toIndex) {
75 const commitEvents = await nit.iterateCommitEvents(assetCid, blockchainInfo, fromIndex, toIndex);
76 const commitsSummary = await nit.getCommits(commitEvents);
77 await nit.showCommits(commitsSummary);
78 let extendedCommits = [];
79 for (const summary of commitsSummary) {
80 const extendedCommit = await extend(assetCid, summary, nit.blockchainNames[blockchainInfo.chainId])
81 extendedCommits.push(extendedCommit);
82 }
83 return extendedCommits;
84}
85
86// bubble -> calculate how many items to retrieve -> call update -> push extended commints to db -> return updated entry amount
87export async function update(assetCid, blockchainInfo, dbEntryAmount, dbEndpointUrl, accessToken=null) {

Callers 1

updateFunction · 0.85

Calls 1

extendFunction · 0.85

Tested by

no test coverage detected