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

Method parseLog

lib.esm/abi/interface.js:1049–1058  ·  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)

Source from the content-addressed store, hash-verified

1047 * If the matching event cannot be found, returns null.
1048 */
1049 parseLog(log) {
1050 const fragment = this.getEvent(log.topics[0]);
1051 if (!fragment || fragment.anonymous) {
1052 return null;
1053 }
1054 // @TODO: If anonymous, and the only method, and the input count matches, should we parse?
1055 // Probably not, because just because it is the only event in the ABI does
1056 // not mean we have the full ABI; maybe just a fragment?
1057 return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics));
1058 }
1059 /**
1060 * Parses a revert data, finding the matching error and extracts
1061 * the parameter values along with other useful error details.

Callers 1

test-abi.jsFile · 0.45

Calls 2

getEventMethod · 0.95
decodeEventLogMethod · 0.95

Tested by

no test coverage detected