Skip to content

Commit

Permalink
Update precompiles/act/act.go
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
backsapc and coderabbitai[bot] authored Oct 7, 2024
1 parent 332211a commit 074ae02
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion precompiles/act/act.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,32 @@ func (Precompile) IsTransaction(method string) bool {
return false
}

panic(fmt.Errorf("invalid method name: %s", method))
func (p *Precompile) IsTransaction(method string) (bool, error) {
switch method {
// transactions
case CheckActionMethod:
return true, nil
case NewTemplateMethod:
return true, nil
case RevokeActionMethod:
return true, nil
case UpdateTemplateMethod:
return true, nil
case VoteForActionMethod:
return true, nil
// queries
case ActionsQuery:
return false, nil
case ActionByIdQuery:
return false, nil
case ActionsByAddressQuery:
return false, nil
case TemplatesQuery:
return false, nil
case TemplateByIdQuery:
return false, nil
}
return false, fmt.Errorf("invalid method name: %s", method)
}

// Logger returns a precompile-specific logger.
Expand Down

0 comments on commit 074ae02

Please sign in to comment.