Skip to content

Commit

Permalink
Add a new constant for method invoke evm
Browse files Browse the repository at this point in the history
  • Loading branch information
sarataha committed Jan 31, 2025
1 parent 19036e3 commit cf75074
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions actors/multisig.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ func (p *ActorParser) ParseMultisig(txType string, msg *parser.LotusMessage, msg
func determineTxType(txType string, to address.Address) string {
if txType == parser.MethodUnknown {
if strings.HasPrefix(to.String(), "f4") {
return "InvokeEVM"
return parser.MethodInvokeEVM
} else if strings.HasPrefix(to.String(), "f0") ||
strings.HasPrefix(to.String(), "f1") ||
strings.HasPrefix(to.String(), "f2") ||
strings.HasPrefix(to.String(), "f3") {
return "Send"
return parser.MethodSend
}
}
return txType
Expand Down
4 changes: 2 additions & 2 deletions actors/multisig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,13 @@ func TestDetermineTxType(t *testing.T) {
name: "Unknown txType with f4 address",
txType: parser.MethodUnknown,
to: createFakeF4Address(t),
expected: "InvokeEVM",
expected: parser.MethodInvokeEVM,
},
{
name: "Unknown txType with f0 address",
txType: parser.MethodUnknown,
to: "f01656666",
expected: "Send",
expected: parser.MethodSend,
},
{
name: "Known txType",
Expand Down
1 change: 1 addition & 0 deletions parser/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ const (
MethodBurnFromExported = "BurnFromExported" // MethodsDatacap
MethodAllowanceExported = "AllowanceExported" // MethodsDatacap
MethodGranularityExported = "GranularityExported" // MethodsDatacap
MethodInvokeEVM = "InvokeEVM" // MethodsEVM

MethodUnknown = "Unknown" // Common
)
Expand Down

0 comments on commit cf75074

Please sign in to comment.