Merge pull request #665 from cosmos/662-logs-find-attribute

Allow any string eventType in logs.findAttribute
This commit is contained in:
Simon Warta 2021-02-10 21:12:23 +01:00 committed by GitHub
commit 780ef3e47b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,11 +68,7 @@ export function parseLogs(input: unknown): readonly Log[] {
*
* Throws if the attribute was not found.
*/
export function findAttribute(
logs: readonly Log[],
eventType: "message" | "transfer",
attrKey: string,
): Attribute {
export function findAttribute(logs: readonly Log[], eventType: string, attrKey: string): Attribute {
const firstLogs = logs.find(() => true);
const out = firstLogs?.events
.find((event) => event.type === eventType)