forked from cerc-io/laconicd-deprecated
imp(tests): prune node integration tests (#1212)
* first pass * extra comment * fixed pruned node tests. Fix getBalance on pruned. Fix BaseFee on pruned. * fix tests execution * check logs on tests * address pr comments * address comments * Update rpc/namespaces/ethereum/eth/api.go * update error msg check * fix lint * fix linter * fix linter * fix py lint * test lint * fix lint * pin golangcli version * pin golanci version * pin lint to version 0.48 * fix linter * fix last linter last file Co-authored-by: ramacarlucho <ramirocarlucho@gmail.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
co-authored by
ramacarlucho
Federico Kunze Küllmer
parent
7331cd2065
commit
ccbaf1fe05
@@ -283,8 +283,13 @@ func (k *Keeper) GetNonce(ctx sdk.Context, addr common.Address) uint64 {
|
||||
// GetBalance load account's balance of gas token
|
||||
func (k *Keeper) GetBalance(ctx sdk.Context, addr common.Address) *big.Int {
|
||||
cosmosAddr := sdk.AccAddress(addr.Bytes())
|
||||
params := k.GetParams(ctx)
|
||||
coin := k.bankKeeper.GetBalance(ctx, cosmosAddr, params.EvmDenom)
|
||||
evmDenom := ""
|
||||
k.paramSpace.GetIfExists(ctx, types.ParamStoreKeyEVMDenom, &evmDenom)
|
||||
// if node is pruned, params is empty. Return invalid value
|
||||
if evmDenom == "" {
|
||||
return big.NewInt(-1)
|
||||
}
|
||||
coin := k.bankKeeper.GetBalance(ctx, cosmosAddr, evmDenom)
|
||||
return coin.Amount.BigInt()
|
||||
}
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ func (k Keeper) GetHashFn(ctx sdk.Context) vm.GetHashFunc {
|
||||
// ApplyTransaction runs and attempts to perform a state transition with the given transaction (i.e Message), that will
|
||||
// only be persisted (committed) to the underlying KVStore if the transaction does not fail.
|
||||
//
|
||||
// Gas tracking
|
||||
// # Gas tracking
|
||||
//
|
||||
// Ethereum consumes gas according to the EVM opcodes instead of general reads and writes to store. Because of this, the
|
||||
// state transition needs to ignore the SDK gas consumption mechanism defined by the GasKVStore and instead consume the
|
||||
@@ -309,18 +309,18 @@ func (k *Keeper) ApplyTransaction(ctx sdk.Context, tx *ethtypes.Transaction) (*t
|
||||
// If the message fails, the VM execution error with the reason will be returned to the client
|
||||
// and the transaction won't be committed to the store.
|
||||
//
|
||||
// Reverted state
|
||||
// # Reverted state
|
||||
//
|
||||
// The snapshot and rollback are supported by the `statedb.StateDB`.
|
||||
//
|
||||
// Different Callers
|
||||
// # Different Callers
|
||||
//
|
||||
// It's called in three scenarios:
|
||||
// 1. `ApplyTransaction`, in the transaction processing flow.
|
||||
// 2. `EthCall/EthEstimateGas` grpc query handler.
|
||||
// 3. Called by other native modules directly.
|
||||
//
|
||||
// Prechecks and Preprocessing
|
||||
// # Prechecks and Preprocessing
|
||||
//
|
||||
// All relevant state transition prechecks for the MsgEthereumTx are performed on the AnteHandler,
|
||||
// prior to running the transaction against the state. The prechecks run are the following:
|
||||
@@ -336,11 +336,11 @@ func (k *Keeper) ApplyTransaction(ctx sdk.Context, tx *ethtypes.Transaction) (*t
|
||||
//
|
||||
// 1. set up the initial access list (iff fork > Berlin)
|
||||
//
|
||||
// Tracer parameter
|
||||
// # Tracer parameter
|
||||
//
|
||||
// It should be a `vm.Tracer` object or nil, if pass `nil`, it'll create a default one based on keeper options.
|
||||
//
|
||||
// Commit parameter
|
||||
// # Commit parameter
|
||||
//
|
||||
// If commit is true, the `StateDB` will be committed, otherwise discarded.
|
||||
func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, tracer vm.EVMLogger, commit bool, cfg *types.EVMConfig, txConfig statedb.TxConfig) (*types.MsgEthereumTxResponse, error) {
|
||||
|
||||
Reference in New Issue
Block a user