* 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: Array<string>, data: string})
| 1174 | * If the matching event cannot be found, returns null. |
| 1175 | */ |
| 1176 | parseLog(log: { topics: Array<string>, data: string}): null | LogDescription { |
| 1177 | const fragment = this.getEvent(log.topics[0]); |
| 1178 | |
| 1179 | if (!fragment || fragment.anonymous) { return null; } |
| 1180 | |
| 1181 | // @TODO: If anonymous, and the only method, and the input count matches, should we parse? |
| 1182 | // Probably not, because just because it is the only event in the ABI does |
| 1183 | // not mean we have the full ABI; maybe just a fragment? |
| 1184 | |
| 1185 | |
| 1186 | return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics)); |
| 1187 | } |
| 1188 | |
| 1189 | /** |
| 1190 | * Parses a revert data, finding the matching error and extracts |
nothing calls this directly
no test coverage detected