* 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})
| 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 |
no test coverage detected