forked from sei-protocol/sei-chain
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/firehose-tracer-at-latest-release-tag' into rel…
…ease/firehose
- Loading branch information
Showing
4 changed files
with
39 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package tracers | ||
|
||
import ( | ||
storetypes "github.com/cosmos/cosmos-sdk/store/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/ethereum/go-ethereum/common" | ||
) | ||
|
||
type EVMKeeper interface { | ||
GetEVMAddressOrDefault(sdk.Context, sdk.AccAddress) common.Address | ||
} | ||
|
||
// GetEVMAddress is a thin wrapper around GetEVMAddressOrDefault in the EVMKeeper interface | ||
// with the important differences that: | ||
// - It does **not** bill gas as this operation is for tracing purposes | ||
// - It also returns the default EVM address if the mapping does not exist | ||
func GetEVMAddress(ctx sdk.Context, keeper EVMKeeper, address sdk.AccAddress) common.Address { | ||
noGasBillingCtx := ctx.WithGasMeter(storetypes.NewNoConsumptionInfiniteGasMeter()) | ||
|
||
return keeper.GetEVMAddressOrDefault(noGasBillingCtx, address) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters