MCPcopy
hub / github.com/numbersprotocol/nit / getCommits

Function getCommits

src/nit.ts:495–512  ·  view source on GitHub ↗
(events)

Source from the content-addressed store, hash-verified

493}
494
495export async function getCommits(events) {
496 const commitDataIndex = 2;
497 const commits = events.map(event => {
498 let commit;
499 try {
500 commit = JSON.parse(event.args[commitDataIndex]);
501 } catch (error) {
502 console.error(`Cannot get valid Commit from block ${event.blockNumber}`);
503 commit = {};
504 }
505 return {
506 "blockNumber": event.blockNumber,
507 "transactionHash": event.transactionHash,
508 "commit": commit,
509 };
510 });
511 return commits;
512}
513
514export async function getCommitsSummary(events) {
515 const commitDataIndex = 2;

Callers 3

logFunction · 0.85
getCommitFunction · 0.85
differenceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected