MCPcopy Create free account
hub / github.com/PageLeay/celestial-runtime / parseLog

Method parseLog

src.ts/abi/interface.ts:1215–1226  ·  view source on GitHub ↗

* Parses a receipt log, finding the matching event and extracts * the parameter values along with other useful event details. * * If the matching event cannot be found, returns null.

(log: { topics: ReadonlyArray<string>, data: string})

Source from the content-addressed store, hash-verified

1213 * If the matching event cannot be found, returns null.
1214 */
1215 parseLog(log: { topics: ReadonlyArray<string>, data: string}): null | LogDescription {
1216 const fragment = this.getEvent(log.topics[0]);
1217
1218 if (!fragment || fragment.anonymous) { return null; }
1219
1220 // @TODO: If anonymous, and the only method, and the input count matches, should we parse?
1221 // Probably not, because just because it is the only event in the ABI does
1222 // not mean we have the full ABI; maybe just a fragment?
1223
1224
1225 return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics));
1226 }
1227
1228 /**
1229 * Parses a revert data, finding the matching error and extracts

Callers 1

test-abi.tsFile · 0.45

Calls 2

getEventMethod · 0.95
decodeEventLogMethod · 0.95

Tested by

no test coverage detected