Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
fix(x/evm): return error properly
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdevbear committed Nov 2, 2023
1 parent 06b11bf commit a097397
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions cosmos/x/evm/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,12 @@ func (k *Keeper) EndBlock(ctx context.Context) error {
blockNum := uint64(sdk.UnwrapSDKContext(ctx).BlockHeight())
block := k.chain.GetBlockByNumber(blockNum)
if block == nil {
panic(
fmt.Sprintf(
"EVM BLOCK %d FAILED TO PROCESS", blockNum,
),
return fmt.Errorf(
"evm block %d failed to process", blockNum,
)
} else if block.NumberU64() != blockNum {
panic(
fmt.Sprintf(
"EVM BLOCK [%d] DOES NOT MATCH COMET BLOCK [%d]", block.NumberU64(), blockNum,
),
return fmt.Errorf(
"evm block [%d] does not match comet block [%d]", block.NumberU64(), blockNum,
)
}
return nil
Expand Down

0 comments on commit a097397

Please sign in to comment.