From 12a13c6d5639dc2e54d04f32cc5336b31e176bfb Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Thu, 15 Sep 2022 22:27:21 -0400 Subject: [PATCH] Refactor Fragment selector and topichash calculation in Contract (#3353). --- src.ts/contract/contract.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src.ts/contract/contract.ts b/src.ts/contract/contract.ts index 1fcd2b2b1..58780ef58 100644 --- a/src.ts/contract/contract.ts +++ b/src.ts/contract/contract.ts @@ -354,7 +354,7 @@ async function getSubTag(contract: BaseContract, event: ContractEventName): Prom } else if (typeof(event) === "string") { // Event name (name or signature); `"Transfer"` fragment = contract.interface.getEvent(event); - topics = [ contract.interface.getEventTopic(fragment) ]; + topics = [ fragment.topicHash ]; } else if (isDeferred(event)) { // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)` @@ -364,7 +364,7 @@ async function getSubTag(contract: BaseContract, event: ContractEventName): Prom } else if ("fragment" in event) { // ContractEvent; e.g. `contract.filter.Transfer` fragment = event.fragment; - topics = [ contract.interface.getEventTopic(fragment) ]; + topics = [ fragment.topicHash ]; } else { console.log(event);