(events)
| 493 | } |
| 494 | |
| 495 | export 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 | |
| 514 | export async function getCommitsSummary(events) { |
| 515 | const commitDataIndex = 2; |
no outgoing calls
no test coverage detected