Skip to content

Commit

Permalink
intents: DelayedEncode type no longer requires data.Func argument (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka authored Sep 26, 2024
1 parent cc002ab commit bfd03ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions intents/intent_data_transaction_delayed_abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit bfd03ed

Please sign in to comment.