Skip to content

Commit

Permalink
Versions
Browse files Browse the repository at this point in the history
  • Loading branch information
backsapc committed Oct 7, 2024
1 parent 4449d81 commit 02cef15
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 32 deletions.
32 changes: 2 additions & 30 deletions precompiles/act/act.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"cosmossdk.io/log"
storetypes "cosmossdk.io/store/types"
"embed"
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -123,8 +122,7 @@ func (p *Precompile) Run(evm *vm.EVM, contract *vm.Contract, readonly bool) (bz
return bz, nil
}

// IsTransaction checks if the given method name corresponds to a transaction or query.
func (Precompile) IsTransaction(method string) bool {
func (p *Precompile) IsTransaction(method string) bool {
switch method {
// transactions
case CheckActionMethod:
Expand All @@ -149,33 +147,7 @@ func (Precompile) IsTransaction(method string) bool {
case TemplateByIdQuery:
return false
}

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)
return false
}

// Logger returns a precompile-specific logger.
Expand Down
2 changes: 1 addition & 1 deletion precompiles/warden/query_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/query"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
cmn "github.com/evmos/evmos/v18/precompiles/common"
cmn "github.com/evmos/evmos/v20/precompiles/common"
wardencommon "github.com/warden-protocol/wardenprotocol/precompiles/common"
types "github.com/warden-protocol/wardenprotocol/warden/x/warden/types/v1beta3"
)
Expand Down
2 changes: 1 addition & 1 deletion precompiles/warden/tx_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
cmn "github.com/evmos/evmos/v18/precompiles/common"
cmn "github.com/evmos/evmos/v20/precompiles/common"
wardencommon "github.com/warden-protocol/wardenprotocol/precompiles/common"
"github.com/warden-protocol/wardenprotocol/warden/x/warden/types/v1beta3"
types "github.com/warden-protocol/wardenprotocol/warden/x/warden/types/v1beta3"
Expand Down

0 comments on commit 02cef15

Please sign in to comment.