-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'on/evm-query-tests' of https://github.com/NibiruChain/n…
…ibiru into on/evm-query-tests
- Loading branch information
Showing
7 changed files
with
74 additions
and
162 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
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,30 @@ | ||
package keeper | ||
|
||
import ( | ||
"math/big" | ||
|
||
"github.com/NibiruChain/nibiru/x/evm/statedb" | ||
|
||
errorsmod "cosmossdk.io/errors" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
// EVMConfig creates the EVMConfig based on current state | ||
func (k *Keeper) EVMConfig(ctx sdk.Context, proposerAddress sdk.ConsAddress, chainID *big.Int) (*statedb.EVMConfig, error) { | ||
params := k.GetParams(ctx) | ||
ethCfg := params.ChainConfig.EthereumConfig(chainID) | ||
|
||
// get the coinbase address from the block proposer | ||
coinbase, err := k.GetCoinbaseAddress(ctx, proposerAddress) | ||
if err != nil { | ||
return nil, errorsmod.Wrap(err, "failed to obtain coinbase address") | ||
} | ||
|
||
baseFee := k.GetBaseFee(ctx, ethCfg) | ||
return &statedb.EVMConfig{ | ||
Params: params, | ||
ChainConfig: ethCfg, | ||
CoinBase: coinbase, | ||
BaseFee: baseFee, | ||
}, nil | ||
} |
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