From 2cb744c269e887c0ae568b5d0daa2717569c3e8d Mon Sep 17 00:00:00 2001 From: Peter Kieltyka Date: Thu, 26 Sep 2024 13:39:31 -0400 Subject: [PATCH] intents: DelayedEncode type no longer requires data.Func argument --- intents/intent_data_transaction_delayed_abi.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/intents/intent_data_transaction_delayed_abi.go b/intents/intent_data_transaction_delayed_abi.go index d53f709d..52103e76 100644 --- a/intents/intent_data_transaction_delayed_abi.go +++ b/intents/intent_data_transaction_delayed_abi.go @@ -111,8 +111,10 @@ func getMethodFromAbi(abi string, method string) (string, []string, error) { // ie. transferFrom(address,address,uint256) // - // Handle the case for already encoded method abi - if strings.Contains(abi, "(") && strings.Contains(abi, ")") && strings.HasPrefix(abi, method) { + // Handle the case for already encoded method abi. + // NOTE: we do not need the know the `method` argument here. + abi = strings.TrimSpace(abi) + if len(abi) > 0 && strings.Contains(abi, "(") && abi[len(abi)-1] == ')' { // NOTE: even though the ethcoder function is `ParseEventDef`, designed for event type parsing // the abi format for a single function structure is the same, so it works. Perhaps we will rename // `ParseEventDef` in the future, or just add another method with a different name.