Skip to content

Commit

Permalink
evm: rm recover (evmos#542)
Browse files Browse the repository at this point in the history
* evm: rm recover

* rm query

* lint
  • Loading branch information
fedekunze authored Sep 9, 2021
1 parent 397e862 commit 6a2914d
Show file tree
Hide file tree
Showing 8 changed files with 2,179 additions and 1,745 deletions.
8 changes: 5 additions & 3 deletions client/docs/statik/statik.go

Large diffs are not rendered by default.

3,371 changes: 2,086 additions & 1,285 deletions client/docs/swagger-ui/swagger.yaml

Large diffs are not rendered by default.

28 changes: 0 additions & 28 deletions docs/api/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
- [QueryAccountResponse](#ethermint.evm.v1.QueryAccountResponse)
- [QueryBalanceRequest](#ethermint.evm.v1.QueryBalanceRequest)
- [QueryBalanceResponse](#ethermint.evm.v1.QueryBalanceResponse)
- [QueryBaseFeeRequest](#ethermint.evm.v1.QueryBaseFeeRequest)
- [QueryBaseFeeResponse](#ethermint.evm.v1.QueryBaseFeeResponse)
- [QueryBlockBloomRequest](#ethermint.evm.v1.QueryBlockBloomRequest)
- [QueryBlockBloomResponse](#ethermint.evm.v1.QueryBlockBloomResponse)
- [QueryBlockLogsRequest](#ethermint.evm.v1.QueryBlockLogsRequest)
Expand Down Expand Up @@ -639,32 +637,6 @@ QueryBalanceResponse is the response type for the Query/Balance RPC method.



<a name="ethermint.evm.v1.QueryBaseFeeRequest"></a>

### QueryBaseFeeRequest
QueryBaseFeeRequest defines the request type for querying the EIP1559 base
fee.






<a name="ethermint.evm.v1.QueryBaseFeeResponse"></a>

### QueryBaseFeeResponse
BaseFeeResponse returns the EIP1559 base fee.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `base_fee` | [string](#string) | | |






<a name="ethermint.evm.v1.QueryBlockBloomRequest"></a>

### QueryBlockBloomRequest
Expand Down
12 changes: 0 additions & 12 deletions proto/ethermint/evm/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -255,18 +255,6 @@ message QueryParamsResponse {
Params params = 1 [ (gogoproto.nullable) = false ];
}

// QueryBaseFeeRequest defines the request type for querying the EIP1559 base
// fee.
message QueryBaseFeeRequest {}

// BaseFeeResponse returns the EIP1559 base fee.
message QueryBaseFeeResponse {
string base_fee = 1 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
}

// QueryStaticCallRequest defines static call response
message QueryStaticCallResponse { bytes data = 1; }

Expand Down
2 changes: 0 additions & 2 deletions proto/ethermint/feemarket/v1/feemarket.proto
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
syntax = "proto3";
package ethermint.feemarket.v1;

import "gogoproto/gogo.proto";

option go_package = "github.com/tharsis/ethermint/x/feemarket/types";

// Params defines the EVM module parameters
Expand Down
26 changes: 0 additions & 26 deletions x/evm/handler.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package evm

import (
"fmt"
"runtime/debug"

tmlog "github.com/tendermint/tendermint/libs/log"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

Expand All @@ -15,8 +10,6 @@ import (
// NewHandler returns a handler for Ethermint type messages.
func NewHandler(server types.MsgServer) sdk.Handler {
return func(ctx sdk.Context, msg sdk.Msg) (result *sdk.Result, err error) {
defer Recover(ctx.Logger(), &err)

ctx = ctx.WithEventManager(sdk.NewEventManager())

switch msg := msg.(type) {
Expand All @@ -31,22 +24,3 @@ func NewHandler(server types.MsgServer) sdk.Handler {
}
}
}

func Recover(logger tmlog.Logger, err *error) {
if r := recover(); r != nil {
*err = sdkerrors.Wrapf(sdkerrors.ErrPanic, "%v", r)

if e, ok := r.(error); ok {
logger.Error(
"message handler panicked",
"error", e,
"stack trace", string(debug.Stack()),
)
} else {
logger.Error(
"message handler panicked",
"recover", fmt.Sprintf("%v", r),
)
}
}
}
9 changes: 0 additions & 9 deletions x/evm/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,6 @@ func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.Q
}, nil
}

// BaseFee implements the Query/BaseFee gRPC method
func (k Keeper) BaseFee(c context.Context, _ *types.QueryBaseFeeRequest) (*types.QueryBaseFeeResponse, error) {
_ = sdk.UnwrapSDKContext(c)

return &types.QueryBaseFeeResponse{
BaseFee: sdk.OneInt(), // TODO: update
}, nil
}

// EthCall implements eth_call rpc api.
func (k Keeper) EthCall(c context.Context, req *types.EthCallRequest) (*types.MsgEthereumTxResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
Expand Down
468 changes: 88 additions & 380 deletions x/evm/types/query.pb.go

Large diffs are not rendered by default.

0 comments on commit 6a2914d

Please sign in to comment.