forked from cerc-io/laconicd-deprecated
update from fork
This commit is contained in:
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package cli
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package cli
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package cli
|
||||
|
||||
import (
|
||||
|
||||
+19
-1
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package evm
|
||||
|
||||
import (
|
||||
@@ -24,7 +39,10 @@ func InitGenesis(
|
||||
) []abci.ValidatorUpdate {
|
||||
k.WithChainID(ctx)
|
||||
|
||||
k.SetParams(ctx, data.Params)
|
||||
err := k.SetParams(ctx, data.Params)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("error setting params %s", err))
|
||||
}
|
||||
|
||||
// ensure evm module account is set
|
||||
if addr := accountKeeper.GetModuleAddress(types.ModuleName); addr == nil {
|
||||
|
||||
+18
-2
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package evm
|
||||
|
||||
import (
|
||||
@@ -15,10 +30,11 @@ func NewHandler(server types.MsgServer) sdk.Handler {
|
||||
|
||||
switch msg := msg.(type) {
|
||||
case *types.MsgEthereumTx:
|
||||
// execute state transition
|
||||
res, err := server.EthereumTx(sdk.WrapSDKContext(ctx), msg)
|
||||
return sdk.WrapServiceResult(ctx, res, err)
|
||||
|
||||
case *types.MsgUpdateParams:
|
||||
res, err := server.UpdateParams(sdk.WrapSDKContext(ctx), msg)
|
||||
return sdk.WrapServiceResult(ctx, res, err)
|
||||
default:
|
||||
err := errorsmod.Wrapf(errortypes.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg)
|
||||
return nil, err
|
||||
|
||||
@@ -376,7 +376,7 @@ func (suite *EvmTestSuite) TestDeployAndCallContract() {
|
||||
tx = types.NewTx(suite.chainID, 2, &receiver, big.NewInt(0), gasLimit, gasPrice, nil, nil, bytecode, nil)
|
||||
suite.SignTx(tx)
|
||||
|
||||
_, err = suite.handler(suite.ctx, tx)
|
||||
result, err = suite.handler(suite.ctx, tx)
|
||||
suite.Require().NoError(err, "failed to handle eth tx msg")
|
||||
|
||||
err = proto.Unmarshal(result.Data, &res)
|
||||
@@ -388,7 +388,7 @@ func (suite *EvmTestSuite) TestDeployAndCallContract() {
|
||||
tx = types.NewTx(suite.chainID, 2, &receiver, big.NewInt(0), gasLimit, gasPrice, nil, nil, bytecode, nil)
|
||||
suite.SignTx(tx)
|
||||
|
||||
_, err = suite.handler(suite.ctx, tx)
|
||||
result, err = suite.handler(suite.ctx, tx)
|
||||
suite.Require().NoError(err, "failed to handle eth tx msg")
|
||||
|
||||
err = proto.Unmarshal(result.Data, &res)
|
||||
@@ -596,7 +596,8 @@ func (suite *EvmTestSuite) TestERC20TransferReverted() {
|
||||
|
||||
before := k.GetBalance(suite.ctx, suite.from)
|
||||
|
||||
ethCfg := suite.app.EvmKeeper.GetChainConfig(suite.ctx).EthereumConfig(nil)
|
||||
evmParams := suite.app.EvmKeeper.GetParams(suite.ctx)
|
||||
ethCfg := evmParams.GetChainConfig().EthereumConfig(nil)
|
||||
baseFee := suite.app.EvmKeeper.GetBaseFee(suite.ctx, ethCfg)
|
||||
|
||||
txData, err := types.UnpackTxData(tx.Data)
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package keeper
|
||||
|
||||
import (
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
|
||||
func SetupContract(b *testing.B) (*KeeperTestSuite, common.Address) {
|
||||
suite := KeeperTestSuite{}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
|
||||
amt := sdk.Coins{ethermint.NewPhotonCoinInt64(1000000000000000000)}
|
||||
err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, amt)
|
||||
@@ -34,7 +34,7 @@ func SetupContract(b *testing.B) (*KeeperTestSuite, common.Address) {
|
||||
|
||||
func SetupTestMessageCall(b *testing.B) (*KeeperTestSuite, common.Address) {
|
||||
suite := KeeperTestSuite{}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
|
||||
amt := sdk.Coins{ethermint.NewPhotonCoinInt64(1000000000000000000)}
|
||||
err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, amt)
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package keeper
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
"github.com/cerc-io/laconicd/x/evm/statedb"
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
)
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
// TxConfig loads `TxConfig` from current transient storage
|
||||
func (k *Keeper) TxConfig(ctx sdk.Context, txHash common.Hash) statedb.TxConfig {
|
||||
return statedb.NewTxConfig(
|
||||
common.BytesToHash(ctx.HeaderHash()), // BlockHash
|
||||
txHash, // TxHash
|
||||
uint(k.GetTxIndexTransient(ctx)), // TxIndex
|
||||
uint(k.GetLogSizeTransient(ctx)), // LogIndex
|
||||
)
|
||||
}
|
||||
|
||||
// VMConfig creates an EVM configuration from the debug setting and the extra EIPs enabled on the
|
||||
// module parameters. The config generated uses the default JumpTable from the EVM.
|
||||
func (k Keeper) VMConfig(ctx sdk.Context, msg core.Message, cfg *statedb.EVMConfig, tracer vm.EVMLogger) vm.Config {
|
||||
noBaseFee := true
|
||||
if types.IsLondon(cfg.ChainConfig, ctx.BlockHeight()) {
|
||||
noBaseFee = k.feeMarketKeeper.GetParams(ctx).NoBaseFee
|
||||
}
|
||||
|
||||
var debug bool
|
||||
if _, ok := tracer.(types.NoOpTracer); !ok {
|
||||
debug = true
|
||||
}
|
||||
|
||||
return vm.Config{
|
||||
Debug: debug,
|
||||
Tracer: tracer,
|
||||
NoBaseFee: noBaseFee,
|
||||
ExtraEips: cfg.Params.EIPs(),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package keeper
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/core"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
sdkmath "cosmossdk.io/math"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
)
|
||||
|
||||
// GetEthIntrinsicGas returns the intrinsic gas cost for the transaction
|
||||
func (k *Keeper) GetEthIntrinsicGas(ctx sdk.Context, msg core.Message, cfg *params.ChainConfig, isContractCreation bool) (uint64, error) {
|
||||
height := big.NewInt(ctx.BlockHeight())
|
||||
homestead := cfg.IsHomestead(height)
|
||||
istanbul := cfg.IsIstanbul(height)
|
||||
|
||||
return core.IntrinsicGas(msg.Data(), msg.AccessList(), isContractCreation, homestead, istanbul)
|
||||
}
|
||||
|
||||
// RefundGas transfers the leftover gas to the sender of the message, caped to half of the total gas
|
||||
// consumed in the transaction. Additionally, the function sets the total gas consumed to the value
|
||||
// returned by the EVM execution, thus ignoring the previous intrinsic gas consumed during in the
|
||||
// AnteHandler.
|
||||
func (k *Keeper) RefundGas(ctx sdk.Context, msg core.Message, leftoverGas uint64, denom string) error {
|
||||
// Return EVM tokens for remaining gas, exchanged at the original rate.
|
||||
remaining := new(big.Int).Mul(new(big.Int).SetUint64(leftoverGas), msg.GasPrice())
|
||||
|
||||
switch remaining.Sign() {
|
||||
case -1:
|
||||
// negative refund errors
|
||||
return errorsmod.Wrapf(types.ErrInvalidRefund, "refunded amount value cannot be negative %d", remaining.Int64())
|
||||
case 1:
|
||||
// positive amount refund
|
||||
refundedCoins := sdk.Coins{sdk.NewCoin(denom, sdkmath.NewIntFromBigInt(remaining))}
|
||||
|
||||
// refund to sender from the fee collector module account, which is the escrow account in charge of collecting tx fees
|
||||
|
||||
err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, authtypes.FeeCollectorName, msg.From().Bytes(), refundedCoins)
|
||||
if err != nil {
|
||||
err = errorsmod.Wrapf(errortypes.ErrInsufficientFunds, "fee collector account failed to refund fees: %s", err.Error())
|
||||
return errorsmod.Wrapf(err, "failed to refund %d leftover gas (%s)", leftoverGas, refundedCoins.String())
|
||||
}
|
||||
default:
|
||||
// no refund, consume gas and update the tx gas meter
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ResetGasMeterAndConsumeGas reset first the gas meter consumed value to zero and set it back to the new value
|
||||
// 'gasUsed'
|
||||
func (k *Keeper) ResetGasMeterAndConsumeGas(ctx sdk.Context, gasUsed uint64) {
|
||||
// reset the gas count
|
||||
ctx.GasMeter().RefundGas(ctx.GasMeter().GasConsumed(), "reset the gas count")
|
||||
ctx.GasMeter().ConsumeGas(gasUsed, "apply evm transaction")
|
||||
}
|
||||
|
||||
// GasToRefund calculates the amount of gas the state machine should refund to the sender. It is
|
||||
// capped by the refund quotient value.
|
||||
// Note: do not pass 0 to refundQuotient
|
||||
func GasToRefund(availableRefund, gasConsumed, refundQuotient uint64) uint64 {
|
||||
// Apply refund counter
|
||||
refund := gasConsumed / refundQuotient
|
||||
if refund > availableRefund {
|
||||
return availableRefund
|
||||
}
|
||||
return refund
|
||||
}
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package keeper
|
||||
|
||||
import (
|
||||
@@ -517,7 +532,7 @@ func (k Keeper) TraceBlock(c context.Context, req *types.QueryTraceBlockRequest)
|
||||
// traceTx do trace on one transaction, it returns a tuple: (traceResult, nextLogIndex, error).
|
||||
func (k *Keeper) traceTx(
|
||||
ctx sdk.Context,
|
||||
cfg *types.EVMConfig,
|
||||
cfg *statedb.EVMConfig,
|
||||
txConfig statedb.TxConfig,
|
||||
signer ethtypes.Signer,
|
||||
tx *ethtypes.Transaction,
|
||||
|
||||
@@ -540,7 +540,8 @@ func (suite *KeeperTestSuite) TestEstimateGas() {
|
||||
"enough balance",
|
||||
func() {
|
||||
args = types.TransactionArgs{To: &common.Address{}, From: &suite.address, Value: (*hexutil.Big)(big.NewInt(100))}
|
||||
}, false, 0, false},
|
||||
}, false, 0, false,
|
||||
},
|
||||
// should success, because gas limit lower than 21000 is ignored
|
||||
{
|
||||
"gas exceed allowance",
|
||||
@@ -1261,9 +1262,7 @@ func (suite *KeeperTestSuite) TestQueryBaseFee() {
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) TestEthCall() {
|
||||
var (
|
||||
req *types.EthCallRequest
|
||||
)
|
||||
var req *types.EthCallRequest
|
||||
|
||||
address := tests.GenerateAddress()
|
||||
suite.Require().Equal(uint64(0), suite.app.EvmKeeper.GetNonce(suite.ctx, address))
|
||||
@@ -1334,7 +1333,6 @@ func (suite *KeeperTestSuite) TestEthCall() {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) TestEmptyRequest() {
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package keeper
|
||||
|
||||
import (
|
||||
|
||||
+34
-10
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package keeper
|
||||
|
||||
import (
|
||||
@@ -8,7 +23,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/store/prefix"
|
||||
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core"
|
||||
ethtypes "github.com/ethereum/go-ethereum/core/types"
|
||||
@@ -36,8 +51,8 @@ type Keeper struct {
|
||||
// key to access the transient store, which is reset on every block during Commit
|
||||
transientKey storetypes.StoreKey
|
||||
|
||||
// module specific parameter space that can be configured through governance
|
||||
paramSpace paramtypes.Subspace
|
||||
// the address capable of executing a MsgUpdateParams message. Typically, this should be the x/gov module account.
|
||||
authority sdk.AccAddress
|
||||
// access to account state
|
||||
accountKeeper types.AccountKeeper
|
||||
// update balance and accounting operations with coins
|
||||
@@ -61,13 +76,15 @@ type Keeper struct {
|
||||
|
||||
// evm constructor function
|
||||
evmConstructor evm.Constructor
|
||||
// Legacy subspace
|
||||
ss paramstypes.Subspace
|
||||
}
|
||||
|
||||
// NewKeeper generates new evm module keeper
|
||||
func NewKeeper(
|
||||
cdc codec.BinaryCodec,
|
||||
storeKey, transientKey storetypes.StoreKey,
|
||||
paramSpace paramtypes.Subspace,
|
||||
authority sdk.AccAddress,
|
||||
ak types.AccountKeeper,
|
||||
bankKeeper types.BankKeeper,
|
||||
sk types.StakingKeeper,
|
||||
@@ -75,21 +92,22 @@ func NewKeeper(
|
||||
customPrecompiles evm.PrecompiledContracts,
|
||||
evmConstructor evm.Constructor,
|
||||
tracer string,
|
||||
ss paramstypes.Subspace,
|
||||
) *Keeper {
|
||||
// ensure evm module account is set
|
||||
if addr := ak.GetModuleAddress(types.ModuleName); addr == nil {
|
||||
panic("the EVM module account has not been set")
|
||||
}
|
||||
|
||||
// set KeyTable if it has not already been set
|
||||
if !paramSpace.HasKeyTable() {
|
||||
paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable())
|
||||
// ensure the authority account is correct
|
||||
if err := sdk.VerifyAddressFormat(authority); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// NOTE: we pass in the parameter space to the CommitStateDB in order to use custom denominations for the EVM operations
|
||||
return &Keeper{
|
||||
cdc: cdc,
|
||||
paramSpace: paramSpace,
|
||||
authority: authority,
|
||||
accountKeeper: ak,
|
||||
bankKeeper: bankKeeper,
|
||||
stakingKeeper: sk,
|
||||
@@ -99,6 +117,7 @@ func NewKeeper(
|
||||
customPrecompiles: customPrecompiles,
|
||||
evmConstructor: evmConstructor,
|
||||
tracer: tracer,
|
||||
ss: ss,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,6 +160,11 @@ func (k Keeper) EmitBlockBloomEvent(ctx sdk.Context, bloom ethtypes.Bloom) {
|
||||
)
|
||||
}
|
||||
|
||||
// GetAuthority returns the x/evm module authority address
|
||||
func (k Keeper) GetAuthority() sdk.AccAddress {
|
||||
return k.authority
|
||||
}
|
||||
|
||||
// GetBlockBloomTransient returns bloom bytes for the current block height
|
||||
func (k Keeper) GetBlockBloomTransient(ctx sdk.Context) *big.Int {
|
||||
store := prefix.NewStore(ctx.TransientStore(k.transientKey), types.KeyPrefixTransientBloom)
|
||||
@@ -297,8 +321,8 @@ 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())
|
||||
evmDenom := ""
|
||||
k.paramSpace.GetIfExists(ctx, types.ParamStoreKeyEVMDenom, &evmDenom)
|
||||
evmParams := k.GetParams(ctx)
|
||||
evmDenom := evmParams.GetEvmDenom()
|
||||
// if node is pruned, params is empty. Return invalid value
|
||||
if evmDenom == "" {
|
||||
return big.NewInt(-1)
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"math"
|
||||
"math/big"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -77,6 +78,9 @@ type KeeperTestSuite struct {
|
||||
var s *KeeperTestSuite
|
||||
|
||||
func TestKeeperTestSuite(t *testing.T) {
|
||||
if os.Getenv("benchmark") != "" {
|
||||
t.Skip("Skipping Gingko Test")
|
||||
}
|
||||
s = new(KeeperTestSuite)
|
||||
s.enableFeemarket = false
|
||||
s.enableLondonHF = true
|
||||
@@ -93,9 +97,18 @@ func (suite *KeeperTestSuite) SetupTest() {
|
||||
suite.SetupApp(checkTx)
|
||||
}
|
||||
|
||||
// SetupApp setup test environment, it uses`require.TestingT` to support both `testing.T` and `testing.B`.
|
||||
func (suite *KeeperTestSuite) SetupTestWithT(t require.TestingT) {
|
||||
checkTx := false
|
||||
suite.app = app.Setup(checkTx, nil)
|
||||
suite.SetupAppWithT(checkTx, t)
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) SetupApp(checkTx bool) {
|
||||
t := suite.T()
|
||||
suite.SetupAppWithT(checkTx, suite.T())
|
||||
}
|
||||
|
||||
// SetupApp setup test environment, it uses`require.TestingT` to support both `testing.T` and `testing.B`.
|
||||
func (suite *KeeperTestSuite) SetupAppWithT(checkTx bool, t require.TestingT) {
|
||||
// account key, use a constant account to keep unit test deterministic.
|
||||
ecdsaPriv, err := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
||||
require.NoError(t, err)
|
||||
@@ -480,10 +493,8 @@ func (suite *KeeperTestSuite) TestGetAccountStorage() {
|
||||
i++
|
||||
return false
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) TestGetAccountOrEmpty() {
|
||||
@@ -520,7 +531,6 @@ func (suite *KeeperTestSuite) TestGetAccountOrEmpty() {
|
||||
} else {
|
||||
suite.Require().NotEqual(empty, res)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
+29
-11
@@ -1,29 +1,47 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package keeper
|
||||
|
||||
import (
|
||||
v2 "github.com/cerc-io/laconicd/x/evm/migrations/v2"
|
||||
v3 "github.com/cerc-io/laconicd/x/evm/migrations/v3"
|
||||
v4 "github.com/cerc-io/laconicd/x/evm/migrations/v4"
|
||||
v5 "github.com/cerc-io/laconicd/x/evm/migrations/v5"
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
// Migrator is a struct for handling in-place store migrations.
|
||||
type Migrator struct {
|
||||
keeper Keeper
|
||||
keeper Keeper
|
||||
legacySubspace types.Subspace
|
||||
}
|
||||
|
||||
// NewMigrator returns a new Migrator.
|
||||
func NewMigrator(keeper Keeper) Migrator {
|
||||
func NewMigrator(keeper Keeper, legacySubspace types.Subspace) Migrator {
|
||||
return Migrator{
|
||||
keeper: keeper,
|
||||
keeper: keeper,
|
||||
legacySubspace: legacySubspace,
|
||||
}
|
||||
}
|
||||
|
||||
// Migrate1to2 migrates the store from consensus version v1 to v2
|
||||
func (m Migrator) Migrate1to2(ctx sdk.Context) error {
|
||||
return v2.MigrateStore(ctx, &m.keeper.paramSpace)
|
||||
// Migrate3to4 migrates the store from consensus version 3 to 4
|
||||
func (m Migrator) Migrate3to4(ctx sdk.Context) error {
|
||||
return v4.MigrateStore(ctx, m.keeper.storeKey, m.legacySubspace, m.keeper.cdc)
|
||||
}
|
||||
|
||||
// Migrate2to3 migrates the store from consensus version v2 to v3
|
||||
func (m Migrator) Migrate2to3(ctx sdk.Context) error {
|
||||
return v3.MigrateStore(ctx, &m.keeper.paramSpace)
|
||||
// Migrate4to5 migrates the store from consensus version 4 to 5
|
||||
func (m Migrator) Migrate4to5(ctx sdk.Context) error {
|
||||
return v5.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package keeper
|
||||
|
||||
import (
|
||||
@@ -6,6 +21,8 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
|
||||
tmbytes "github.com/tendermint/tendermint/libs/bytes"
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
|
||||
@@ -125,3 +142,20 @@ func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*t
|
||||
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// UpdateParams implements the gRPC MsgServer interface. When an UpdateParams
|
||||
// proposal passes, it updates the module parameters. The update can only be
|
||||
// performed if the requested authority is the Cosmos SDK governance module
|
||||
// account.
|
||||
func (k *Keeper) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
|
||||
if k.authority.String() != req.Authority {
|
||||
return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority, expected %s, got %s", k.authority.String(), req.Authority)
|
||||
}
|
||||
|
||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
if err := k.SetParams(ctx, req.Params); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &types.MsgUpdateParamsResponse{}, nil
|
||||
}
|
||||
|
||||
@@ -5,6 +5,9 @@ import (
|
||||
|
||||
"github.com/cerc-io/laconicd/x/evm/statedb"
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
|
||||
ethtypes "github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
)
|
||||
@@ -78,3 +81,37 @@ func (suite *KeeperTestSuite) TestEthereumTx() {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) TestUpdateParams() {
|
||||
testCases := []struct {
|
||||
name string
|
||||
request *types.MsgUpdateParams
|
||||
expectErr bool
|
||||
}{
|
||||
{
|
||||
name: "fail - invalid authority",
|
||||
request: &types.MsgUpdateParams{Authority: "foobar"},
|
||||
expectErr: true,
|
||||
},
|
||||
{
|
||||
name: "pass - valid Update msg",
|
||||
request: &types.MsgUpdateParams{
|
||||
Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||
Params: types.DefaultParams(),
|
||||
},
|
||||
expectErr: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
suite.Run("MsgUpdateParams", func() {
|
||||
_, err := suite.app.EvmKeeper.UpdateParams(suite.ctx, tc.request)
|
||||
if tc.expectErr {
|
||||
suite.Require().Error(err)
|
||||
} else {
|
||||
suite.Require().NoError(err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
+42
-44
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package keeper
|
||||
|
||||
import (
|
||||
@@ -8,51 +23,34 @@ import (
|
||||
|
||||
// GetParams returns the total set of evm parameters.
|
||||
func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
|
||||
// TODO: update once https://github.com/cosmos/cosmos-sdk/pull/12615 is merged
|
||||
// and released
|
||||
for _, pair := range params.ParamSetPairs() {
|
||||
k.paramSpace.GetIfExists(ctx, pair.Key, pair.Value)
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
bz := store.Get(types.KeyPrefixParams)
|
||||
if len(bz) == 0 {
|
||||
return k.GetLegacyParams(ctx)
|
||||
}
|
||||
k.cdc.MustUnmarshal(bz, ¶ms)
|
||||
return
|
||||
}
|
||||
|
||||
// SetParams sets the EVM params each in their individual key for better get performance
|
||||
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error {
|
||||
if err := params.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
bz, err := k.cdc.Marshal(¶ms)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
store.Set(types.KeyPrefixParams, bz)
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetLegacyParams returns param set for version before migrate
|
||||
func (k Keeper) GetLegacyParams(ctx sdk.Context) types.Params {
|
||||
var params types.Params
|
||||
k.ss.GetParamSetIfExists(ctx, ¶ms)
|
||||
return params
|
||||
}
|
||||
|
||||
// SetParams sets the evm parameters to the param space.
|
||||
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
|
||||
k.paramSpace.SetParamSet(ctx, ¶ms)
|
||||
}
|
||||
|
||||
// GetChainConfig returns the chain configuration parameter.
|
||||
func (k Keeper) GetChainConfig(ctx sdk.Context) types.ChainConfig {
|
||||
var chainCfg types.ChainConfig
|
||||
k.paramSpace.GetIfExists(ctx, types.ParamStoreKeyChainConfig, &chainCfg)
|
||||
return chainCfg
|
||||
}
|
||||
|
||||
// GetEVMDenom returns the EVM denom.
|
||||
func (k Keeper) GetEVMDenom(ctx sdk.Context) string {
|
||||
var evmDenom string
|
||||
k.paramSpace.GetIfExists(ctx, types.ParamStoreKeyEVMDenom, &evmDenom)
|
||||
return evmDenom
|
||||
}
|
||||
|
||||
// GetEnableCall returns true if the EVM Call operation is enabled.
|
||||
func (k Keeper) GetEnableCall(ctx sdk.Context) bool {
|
||||
var enableCall bool
|
||||
k.paramSpace.GetIfExists(ctx, types.ParamStoreKeyEnableCall, &enableCall)
|
||||
return enableCall
|
||||
}
|
||||
|
||||
// GetEnableCreate returns true if the EVM Create contract operation is enabled.
|
||||
func (k Keeper) GetEnableCreate(ctx sdk.Context) bool {
|
||||
var enableCreate bool
|
||||
k.paramSpace.GetIfExists(ctx, types.ParamStoreKeyEnableCreate, &enableCreate)
|
||||
return enableCreate
|
||||
}
|
||||
|
||||
// GetAllowUnprotectedTxs returns true if unprotected txs (i.e non-replay protected as per EIP-155) are supported by the chain.
|
||||
func (k Keeper) GetAllowUnprotectedTxs(ctx sdk.Context) bool {
|
||||
var allowUnprotectedTx bool
|
||||
k.paramSpace.GetIfExists(ctx, types.ParamStoreKeyAllowUnprotectedTxs, &allowUnprotectedTx)
|
||||
return allowUnprotectedTx
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package keeper_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
)
|
||||
|
||||
func BenchmarkSetParams(b *testing.B) {
|
||||
suite := KeeperTestSuite{}
|
||||
suite.SetupTestWithT(b)
|
||||
params := types.DefaultParams()
|
||||
|
||||
b.ReportAllocs()
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
_ = suite.app.EvmKeeper.SetParams(suite.ctx, params)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkGetParams(b *testing.B) {
|
||||
suite := KeeperTestSuite{}
|
||||
suite.SetupTestWithT(b)
|
||||
|
||||
b.ReportAllocs()
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
_ = suite.app.EvmKeeper.GetParams(suite.ctx)
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,8 @@ func (suite *KeeperTestSuite) TestParams() {
|
||||
return params.EvmDenom
|
||||
},
|
||||
func() interface{} {
|
||||
return suite.app.EvmKeeper.GetEVMDenom(suite.ctx)
|
||||
evmParams := suite.app.EvmKeeper.GetParams(suite.ctx)
|
||||
return evmParams.GetEvmDenom()
|
||||
},
|
||||
true,
|
||||
},
|
||||
@@ -45,7 +46,8 @@ func (suite *KeeperTestSuite) TestParams() {
|
||||
return params.EnableCreate
|
||||
},
|
||||
func() interface{} {
|
||||
return suite.app.EvmKeeper.GetEnableCreate(suite.ctx)
|
||||
evmParams := suite.app.EvmKeeper.GetParams(suite.ctx)
|
||||
return evmParams.GetEnableCreate()
|
||||
},
|
||||
true,
|
||||
},
|
||||
@@ -57,7 +59,8 @@ func (suite *KeeperTestSuite) TestParams() {
|
||||
return params.EnableCall
|
||||
},
|
||||
func() interface{} {
|
||||
return suite.app.EvmKeeper.GetEnableCall(suite.ctx)
|
||||
evmParams := suite.app.EvmKeeper.GetParams(suite.ctx)
|
||||
return evmParams.GetEnableCall()
|
||||
},
|
||||
true,
|
||||
},
|
||||
@@ -69,7 +72,8 @@ func (suite *KeeperTestSuite) TestParams() {
|
||||
return params.AllowUnprotectedTxs
|
||||
},
|
||||
func() interface{} {
|
||||
return suite.app.EvmKeeper.GetAllowUnprotectedTxs(suite.ctx)
|
||||
evmParams := suite.app.EvmKeeper.GetParams(suite.ctx)
|
||||
return evmParams.GetAllowUnprotectedTxs()
|
||||
},
|
||||
true,
|
||||
},
|
||||
@@ -81,7 +85,8 @@ func (suite *KeeperTestSuite) TestParams() {
|
||||
return params.ChainConfig
|
||||
},
|
||||
func() interface{} {
|
||||
return suite.app.EvmKeeper.GetChainConfig(suite.ctx)
|
||||
evmParams := suite.app.EvmKeeper.GetParams(suite.ctx)
|
||||
return evmParams.GetChainConfig()
|
||||
},
|
||||
true,
|
||||
},
|
||||
@@ -92,5 +97,4 @@ func (suite *KeeperTestSuite) TestParams() {
|
||||
suite.Require().Equal(tc.expected, outcome)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +1,27 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package keeper
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
|
||||
sdkmath "cosmossdk.io/math"
|
||||
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
|
||||
ethermint "github.com/cerc-io/laconicd/types"
|
||||
"github.com/cerc-io/laconicd/x/evm/statedb"
|
||||
@@ -26,61 +36,19 @@ import (
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
)
|
||||
|
||||
// GasToRefund calculates the amount of gas the state machine should refund to the sender. It is
|
||||
// capped by the refund quotient value.
|
||||
// Note: do not pass 0 to refundQuotient
|
||||
func GasToRefund(availableRefund, gasConsumed, refundQuotient uint64) uint64 {
|
||||
// Apply refund counter
|
||||
refund := gasConsumed / refundQuotient
|
||||
if refund > availableRefund {
|
||||
return availableRefund
|
||||
}
|
||||
return refund
|
||||
}
|
||||
|
||||
// EVMConfig creates the EVMConfig based on current state
|
||||
func (k *Keeper) EVMConfig(ctx sdk.Context, proposerAddress sdk.ConsAddress, chainID *big.Int) (*types.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 &types.EVMConfig{
|
||||
Params: params,
|
||||
ChainConfig: ethCfg,
|
||||
CoinBase: coinbase,
|
||||
BaseFee: baseFee,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// TxConfig loads `TxConfig` from current transient storage
|
||||
func (k *Keeper) TxConfig(ctx sdk.Context, txHash common.Hash) statedb.TxConfig {
|
||||
return statedb.NewTxConfig(
|
||||
common.BytesToHash(ctx.HeaderHash()), // BlockHash
|
||||
txHash, // TxHash
|
||||
uint(k.GetTxIndexTransient(ctx)), // TxIndex
|
||||
uint(k.GetLogSizeTransient(ctx)), // LogIndex
|
||||
)
|
||||
}
|
||||
|
||||
// NewEVM generates a go-ethereum VM from the provided Message fields and the chain parameters
|
||||
// (ChainConfig and module Params). It additionally sets the validator operator address as the
|
||||
// coinbase address to make it available for the COINBASE opcode, even though there is no
|
||||
// beneficiary of the coinbase transaction (since we're not mining).
|
||||
//
|
||||
// NOTE: the RANDOM opcode is currently not supported since it requires
|
||||
// RANDAO implementation. See https://github.com/cerc-io/laconicd/pull/1520#pullrequestreview-1200504697
|
||||
// RANDAO implementation. See https://github.com/evmos/ethermint/pull/1520#pullrequestreview-1200504697
|
||||
// for more information.
|
||||
|
||||
func (k *Keeper) NewEVM(
|
||||
ctx sdk.Context,
|
||||
msg core.Message,
|
||||
cfg *types.EVMConfig,
|
||||
cfg *statedb.EVMConfig,
|
||||
tracer vm.EVMLogger,
|
||||
stateDB vm.StateDB,
|
||||
) evm.EVM {
|
||||
@@ -105,27 +73,6 @@ func (k *Keeper) NewEVM(
|
||||
return k.evmConstructor(blockCtx, txCtx, stateDB, cfg.ChainConfig, vmConfig, k.customPrecompiles)
|
||||
}
|
||||
|
||||
// VMConfig creates an EVM configuration from the debug setting and the extra EIPs enabled on the
|
||||
// module parameters. The config generated uses the default JumpTable from the EVM.
|
||||
func (k Keeper) VMConfig(ctx sdk.Context, msg core.Message, cfg *types.EVMConfig, tracer vm.EVMLogger) vm.Config {
|
||||
noBaseFee := true
|
||||
if types.IsLondon(cfg.ChainConfig, ctx.BlockHeight()) {
|
||||
noBaseFee = k.feeMarketKeeper.GetParams(ctx).NoBaseFee
|
||||
}
|
||||
|
||||
var debug bool
|
||||
if _, ok := tracer.(types.NoOpTracer); !ok {
|
||||
debug = true
|
||||
}
|
||||
|
||||
return vm.Config{
|
||||
Debug: debug,
|
||||
Tracer: tracer,
|
||||
NoBaseFee: noBaseFee,
|
||||
ExtraEips: cfg.Params.EIPs(),
|
||||
}
|
||||
}
|
||||
|
||||
// GetHashFn implements vm.GetHashFunc for Ethermint. It handles 3 cases:
|
||||
// 1. The requested height matches the current height from context (and thus same epoch number)
|
||||
// 2. The requested height is from an previous height from the same chain epoch
|
||||
@@ -285,7 +232,7 @@ func (k *Keeper) ApplyTransaction(ctx sdk.Context, tx *ethtypes.Transaction) (*t
|
||||
} else if commit != nil {
|
||||
// PostTxProcessing is successful, commit the tmpCtx
|
||||
commit()
|
||||
// Since the post processing can alter the log, we need to update the result
|
||||
// Since the post-processing can alter the log, we need to update the result
|
||||
res.Logs = types.NewLogsFromEth(receipt.Logs)
|
||||
ctx.EventManager().EmitEvents(tmpCtx.EventManager().Events())
|
||||
}
|
||||
@@ -314,6 +261,17 @@ func (k *Keeper) ApplyTransaction(ctx sdk.Context, tx *ethtypes.Transaction) (*t
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// ApplyMessage calls ApplyMessageWithConfig with an empty TxConfig.
|
||||
func (k *Keeper) ApplyMessage(ctx sdk.Context, msg core.Message, tracer vm.EVMLogger, commit bool) (*types.MsgEthereumTxResponse, error) {
|
||||
cfg, err := k.EVMConfig(ctx, sdk.ConsAddress(ctx.BlockHeader().ProposerAddress), k.eip155ChainID)
|
||||
if err != nil {
|
||||
return nil, errorsmod.Wrap(err, "failed to load evm config")
|
||||
}
|
||||
|
||||
txConfig := statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash()))
|
||||
return k.ApplyMessageWithConfig(ctx, msg, tracer, commit, cfg, txConfig)
|
||||
}
|
||||
|
||||
// ApplyMessageWithConfig computes the new state by applying the given message against the existing state.
|
||||
// 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.
|
||||
@@ -356,7 +314,7 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context,
|
||||
msg core.Message,
|
||||
tracer vm.EVMLogger,
|
||||
commit bool,
|
||||
cfg *types.EVMConfig,
|
||||
cfg *statedb.EVMConfig,
|
||||
txConfig statedb.TxConfig,
|
||||
) (*types.MsgEthereumTxResponse, error) {
|
||||
var (
|
||||
@@ -470,83 +428,3 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context,
|
||||
Hash: txConfig.TxHash.Hex(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ApplyMessage calls ApplyMessageWithConfig with default EVMConfig
|
||||
func (k *Keeper) ApplyMessage(ctx sdk.Context, msg core.Message, tracer vm.EVMLogger, commit bool) (*types.MsgEthereumTxResponse, error) {
|
||||
cfg, err := k.EVMConfig(ctx, sdk.ConsAddress(ctx.BlockHeader().ProposerAddress), k.eip155ChainID)
|
||||
if err != nil {
|
||||
return nil, errorsmod.Wrap(err, "failed to load evm config")
|
||||
}
|
||||
txConfig := statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash()))
|
||||
return k.ApplyMessageWithConfig(ctx, msg, tracer, commit, cfg, txConfig)
|
||||
}
|
||||
|
||||
// GetEthIntrinsicGas returns the intrinsic gas cost for the transaction
|
||||
func (k *Keeper) GetEthIntrinsicGas(ctx sdk.Context, msg core.Message, cfg *params.ChainConfig, isContractCreation bool) (uint64, error) {
|
||||
height := big.NewInt(ctx.BlockHeight())
|
||||
homestead := cfg.IsHomestead(height)
|
||||
istanbul := cfg.IsIstanbul(height)
|
||||
|
||||
return core.IntrinsicGas(msg.Data(), msg.AccessList(), isContractCreation, homestead, istanbul)
|
||||
}
|
||||
|
||||
// RefundGas transfers the leftover gas to the sender of the message, caped to half of the total gas
|
||||
// consumed in the transaction. Additionally, the function sets the total gas consumed to the value
|
||||
// returned by the EVM execution, thus ignoring the previous intrinsic gas consumed during in the
|
||||
// AnteHandler.
|
||||
func (k *Keeper) RefundGas(ctx sdk.Context, msg core.Message, leftoverGas uint64, denom string) error {
|
||||
// Return EVM tokens for remaining gas, exchanged at the original rate.
|
||||
remaining := new(big.Int).Mul(new(big.Int).SetUint64(leftoverGas), msg.GasPrice())
|
||||
|
||||
switch remaining.Sign() {
|
||||
case -1:
|
||||
// negative refund errors
|
||||
return errorsmod.Wrapf(types.ErrInvalidRefund, "refunded amount value cannot be negative %d", remaining.Int64())
|
||||
case 1:
|
||||
// positive amount refund
|
||||
refundedCoins := sdk.Coins{sdk.NewCoin(denom, sdkmath.NewIntFromBigInt(remaining))}
|
||||
|
||||
// refund to sender from the fee collector module account, which is the escrow account in charge of collecting tx fees
|
||||
|
||||
err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, authtypes.FeeCollectorName, msg.From().Bytes(), refundedCoins)
|
||||
if err != nil {
|
||||
err = errorsmod.Wrapf(errortypes.ErrInsufficientFunds, "fee collector account failed to refund fees: %s", err.Error())
|
||||
return errorsmod.Wrapf(err, "failed to refund %d leftover gas (%s)", leftoverGas, refundedCoins.String())
|
||||
}
|
||||
default:
|
||||
// no refund, consume gas and update the tx gas meter
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ResetGasMeterAndConsumeGas reset first the gas meter consumed value to zero and set it back to the new value
|
||||
// 'gasUsed'
|
||||
func (k *Keeper) ResetGasMeterAndConsumeGas(ctx sdk.Context, gasUsed uint64) {
|
||||
// reset the gas count
|
||||
ctx.GasMeter().RefundGas(ctx.GasMeter().GasConsumed(), "reset the gas count")
|
||||
ctx.GasMeter().ConsumeGas(gasUsed, "apply evm transaction")
|
||||
}
|
||||
|
||||
// GetProposerAddress returns current block proposer's address when provided proposer address is empty.
|
||||
func GetProposerAddress(ctx sdk.Context, proposerAddress sdk.ConsAddress) sdk.ConsAddress {
|
||||
if len(proposerAddress) == 0 {
|
||||
proposerAddress = ctx.BlockHeader().ProposerAddress
|
||||
}
|
||||
return proposerAddress
|
||||
}
|
||||
|
||||
// GetCoinbaseAddress returns the block proposer's validator operator address.
|
||||
func (k Keeper) GetCoinbaseAddress(ctx sdk.Context, proposerAddress sdk.ConsAddress) (common.Address, error) {
|
||||
validator, found := k.stakingKeeper.GetValidatorByConsAddr(ctx, GetProposerAddress(ctx, proposerAddress))
|
||||
if !found {
|
||||
return common.Address{}, errorsmod.Wrapf(
|
||||
stakingtypes.ErrNoValidatorFound,
|
||||
"failed to retrieve validator from block proposer address %s",
|
||||
proposerAddress.String(),
|
||||
)
|
||||
}
|
||||
|
||||
coinbase := common.BytesToAddress(validator.GetOperator())
|
||||
return coinbase, nil
|
||||
}
|
||||
|
||||
@@ -143,7 +143,6 @@ func newNativeMessage(
|
||||
msgSigner := ethtypes.MakeSigner(cfg, big.NewInt(blockHeight))
|
||||
|
||||
msg, baseFee, err := newEthMsgTx(nonce, blockHeight, address, cfg, krSigner, ethSigner, txType, data, accessList)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -158,7 +157,7 @@ func newNativeMessage(
|
||||
|
||||
func BenchmarkApplyTransaction(b *testing.B) {
|
||||
suite := KeeperTestSuite{enableLondonHF: true}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
|
||||
ethSigner := ethtypes.LatestSignerForChainID(suite.app.EvmKeeper.ChainID())
|
||||
|
||||
@@ -185,7 +184,7 @@ func BenchmarkApplyTransaction(b *testing.B) {
|
||||
|
||||
func BenchmarkApplyTransactionWithLegacyTx(b *testing.B) {
|
||||
suite := KeeperTestSuite{enableLondonHF: true}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
|
||||
ethSigner := ethtypes.LatestSignerForChainID(suite.app.EvmKeeper.ChainID())
|
||||
|
||||
@@ -212,7 +211,7 @@ func BenchmarkApplyTransactionWithLegacyTx(b *testing.B) {
|
||||
|
||||
func BenchmarkApplyTransactionWithDynamicFeeTx(b *testing.B) {
|
||||
suite := KeeperTestSuite{enableFeemarket: true, enableLondonHF: true}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
|
||||
ethSigner := ethtypes.LatestSignerForChainID(suite.app.EvmKeeper.ChainID())
|
||||
|
||||
@@ -239,7 +238,7 @@ func BenchmarkApplyTransactionWithDynamicFeeTx(b *testing.B) {
|
||||
|
||||
func BenchmarkApplyMessage(b *testing.B) {
|
||||
suite := KeeperTestSuite{enableLondonHF: true}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
|
||||
params := suite.app.EvmKeeper.GetParams(suite.ctx)
|
||||
ethCfg := params.ChainConfig.EthereumConfig(suite.app.EvmKeeper.ChainID())
|
||||
@@ -274,7 +273,7 @@ func BenchmarkApplyMessage(b *testing.B) {
|
||||
|
||||
func BenchmarkApplyMessageWithLegacyTx(b *testing.B) {
|
||||
suite := KeeperTestSuite{enableLondonHF: true}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
|
||||
params := suite.app.EvmKeeper.GetParams(suite.ctx)
|
||||
ethCfg := params.ChainConfig.EthereumConfig(suite.app.EvmKeeper.ChainID())
|
||||
@@ -309,7 +308,7 @@ func BenchmarkApplyMessageWithLegacyTx(b *testing.B) {
|
||||
|
||||
func BenchmarkApplyMessageWithDynamicFeeTx(b *testing.B) {
|
||||
suite := KeeperTestSuite{enableFeemarket: true, enableLondonHF: true}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
|
||||
params := suite.app.EvmKeeper.GetParams(suite.ctx)
|
||||
ethCfg := params.ChainConfig.EthereumConfig(suite.app.EvmKeeper.ChainID())
|
||||
|
||||
@@ -571,7 +571,7 @@ func (suite *KeeperTestSuite) TestApplyMessageWithConfig() {
|
||||
msg core.Message
|
||||
err error
|
||||
expectedGasUsed uint64
|
||||
config *types.EVMConfig
|
||||
config *statedb.EVMConfig
|
||||
keeperParams types.Params
|
||||
signer ethtypes.Signer
|
||||
vmdb *statedb.StateDB
|
||||
@@ -660,13 +660,10 @@ func (suite *KeeperTestSuite) TestApplyMessageWithConfig() {
|
||||
suite.Require().Equal(expectedGasUsed, res.GasUsed)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) createContractGethMsg(nonce uint64, signer ethtypes.Signer, cfg *params.ChainConfig, gasPrice *big.Int) (core.Message, error) {
|
||||
|
||||
ethMsg, err := suite.createContractMsgTx(nonce, signer, cfg, gasPrice)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -676,7 +673,6 @@ func (suite *KeeperTestSuite) createContractGethMsg(nonce uint64, signer ethtype
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) createContractMsgTx(nonce uint64, signer ethtypes.Signer, cfg *params.ChainConfig, gasPrice *big.Int) (*types.MsgEthereumTx, error) {
|
||||
|
||||
contractCreateTx := ðtypes.AccessListTx{
|
||||
GasPrice: gasPrice,
|
||||
Gas: params.TxGasContractCreation,
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package keeper
|
||||
|
||||
import (
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
|
||||
func BenchmarkCreateAccountNew(b *testing.B) {
|
||||
suite := KeeperTestSuite{}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
vmdb := suite.StateDB()
|
||||
|
||||
b.ResetTimer()
|
||||
@@ -31,7 +31,7 @@ func BenchmarkCreateAccountNew(b *testing.B) {
|
||||
|
||||
func BenchmarkCreateAccountExisting(b *testing.B) {
|
||||
suite := KeeperTestSuite{}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
vmdb := suite.StateDB()
|
||||
|
||||
b.ResetTimer()
|
||||
@@ -44,7 +44,7 @@ func BenchmarkCreateAccountExisting(b *testing.B) {
|
||||
|
||||
func BenchmarkAddBalance(b *testing.B) {
|
||||
suite := KeeperTestSuite{}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
vmdb := suite.StateDB()
|
||||
|
||||
amt := big.NewInt(10)
|
||||
@@ -59,7 +59,7 @@ func BenchmarkAddBalance(b *testing.B) {
|
||||
|
||||
func BenchmarkSetCode(b *testing.B) {
|
||||
suite := KeeperTestSuite{}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
vmdb := suite.StateDB()
|
||||
|
||||
hash := crypto.Keccak256Hash([]byte("code")).Bytes()
|
||||
@@ -74,7 +74,7 @@ func BenchmarkSetCode(b *testing.B) {
|
||||
|
||||
func BenchmarkSetState(b *testing.B) {
|
||||
suite := KeeperTestSuite{}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
vmdb := suite.StateDB()
|
||||
|
||||
hash := crypto.Keccak256Hash([]byte("topic")).Bytes()
|
||||
@@ -89,7 +89,7 @@ func BenchmarkSetState(b *testing.B) {
|
||||
|
||||
func BenchmarkAddLog(b *testing.B) {
|
||||
suite := KeeperTestSuite{}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
vmdb := suite.StateDB()
|
||||
|
||||
topic := crypto.Keccak256Hash([]byte("topic"))
|
||||
@@ -116,7 +116,7 @@ func BenchmarkAddLog(b *testing.B) {
|
||||
|
||||
func BenchmarkSnapshot(b *testing.B) {
|
||||
suite := KeeperTestSuite{}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
vmdb := suite.StateDB()
|
||||
|
||||
b.ResetTimer()
|
||||
@@ -136,7 +136,7 @@ func BenchmarkSnapshot(b *testing.B) {
|
||||
|
||||
func BenchmarkSubBalance(b *testing.B) {
|
||||
suite := KeeperTestSuite{}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
vmdb := suite.StateDB()
|
||||
|
||||
amt := big.NewInt(10)
|
||||
@@ -151,7 +151,7 @@ func BenchmarkSubBalance(b *testing.B) {
|
||||
|
||||
func BenchmarkSetNonce(b *testing.B) {
|
||||
suite := KeeperTestSuite{}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
vmdb := suite.StateDB()
|
||||
|
||||
b.ResetTimer()
|
||||
@@ -164,7 +164,7 @@ func BenchmarkSetNonce(b *testing.B) {
|
||||
|
||||
func BenchmarkAddRefund(b *testing.B) {
|
||||
suite := KeeperTestSuite{}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
vmdb := suite.StateDB()
|
||||
|
||||
b.ResetTimer()
|
||||
@@ -177,7 +177,7 @@ func BenchmarkAddRefund(b *testing.B) {
|
||||
|
||||
func BenchmarkSuicide(b *testing.B) {
|
||||
suite := KeeperTestSuite{}
|
||||
suite.SetupTest()
|
||||
suite.SetupTestWithT(b)
|
||||
vmdb := suite.StateDB()
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
@@ -897,7 +897,6 @@ func (suite *KeeperTestSuite) TestSetBalance() {
|
||||
suite.Require().NoError(err)
|
||||
suite.Require().Equal(amount, balance)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
+44
-4
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package keeper
|
||||
|
||||
import (
|
||||
@@ -9,13 +24,38 @@ import (
|
||||
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
authante "github.com/cosmos/cosmos-sdk/x/auth/ante"
|
||||
|
||||
evmtypes "github.com/cerc-io/laconicd/x/evm/types"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core"
|
||||
ethtypes "github.com/ethereum/go-ethereum/core/types"
|
||||
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
)
|
||||
|
||||
// GetCoinbaseAddress returns the block proposer's validator operator address.
|
||||
func (k Keeper) GetCoinbaseAddress(ctx sdk.Context, proposerAddress sdk.ConsAddress) (common.Address, error) {
|
||||
validator, found := k.stakingKeeper.GetValidatorByConsAddr(ctx, GetProposerAddress(ctx, proposerAddress))
|
||||
if !found {
|
||||
return common.Address{}, errorsmod.Wrapf(
|
||||
stakingtypes.ErrNoValidatorFound,
|
||||
"failed to retrieve validator from block proposer address %s",
|
||||
proposerAddress.String(),
|
||||
)
|
||||
}
|
||||
|
||||
coinbase := common.BytesToAddress(validator.GetOperator())
|
||||
return coinbase, nil
|
||||
}
|
||||
|
||||
// GetProposerAddress returns current block proposer's address when provided proposer address is empty.
|
||||
func GetProposerAddress(ctx sdk.Context, proposerAddress sdk.ConsAddress) sdk.ConsAddress {
|
||||
if len(proposerAddress) == 0 {
|
||||
proposerAddress = ctx.BlockHeader().ProposerAddress
|
||||
}
|
||||
return proposerAddress
|
||||
}
|
||||
|
||||
// DeductTxCostsFromUserBalance deducts the fees from the user balance. Returns an
|
||||
// error if the specified sender address does not exist or the account balance is not sufficient.
|
||||
func (k *Keeper) DeductTxCostsFromUserBalance(
|
||||
@@ -41,7 +81,7 @@ func (k *Keeper) DeductTxCostsFromUserBalance(
|
||||
// gas limit is not reached, the gas limit is higher than the intrinsic gas and that the
|
||||
// base fee is higher than the gas fee cap.
|
||||
func VerifyFee(
|
||||
txData evmtypes.TxData,
|
||||
txData types.TxData,
|
||||
denom string,
|
||||
baseFee *big.Int,
|
||||
homestead, istanbul, isCheckTx bool,
|
||||
@@ -92,7 +132,7 @@ func VerifyFee(
|
||||
// sender has enough funds to pay for the fees and value of the transaction.
|
||||
func CheckSenderBalance(
|
||||
balance sdkmath.Int,
|
||||
txData evmtypes.TxData,
|
||||
txData types.TxData,
|
||||
) error {
|
||||
cost := txData.Cost()
|
||||
|
||||
|
||||
@@ -475,7 +475,8 @@ func (suite *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() {
|
||||
|
||||
txData, _ := evmtypes.UnpackTxData(tx.Data)
|
||||
|
||||
ethCfg := suite.app.EvmKeeper.GetChainConfig(suite.ctx).EthereumConfig(nil)
|
||||
evmParams := suite.app.EvmKeeper.GetParams(suite.ctx)
|
||||
ethCfg := evmParams.GetChainConfig().EthereumConfig(nil)
|
||||
baseFee := suite.app.EvmKeeper.GetBaseFee(suite.ctx, ethCfg)
|
||||
priority := evmtypes.GetTxPriority(txData, baseFee)
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package v2
|
||||
|
||||
import (
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
)
|
||||
|
||||
// MigrateStore sets the default AllowUnprotectedTxs parameter.
|
||||
func MigrateStore(ctx sdk.Context, paramstore *paramtypes.Subspace) error {
|
||||
if !paramstore.HasKeyTable() {
|
||||
ps := paramstore.WithKeyTable(types.ParamKeyTable())
|
||||
paramstore = &ps
|
||||
}
|
||||
|
||||
// add RejectUnprotected
|
||||
paramstore.Set(ctx, types.ParamStoreKeyAllowUnprotectedTxs, types.DefaultAllowUnprotectedTxs)
|
||||
return nil
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package v2_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/testutil"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
|
||||
"github.com/cerc-io/laconicd/encoding"
|
||||
|
||||
"github.com/cerc-io/laconicd/app"
|
||||
v2 "github.com/cerc-io/laconicd/x/evm/migrations/v2"
|
||||
v2types "github.com/cerc-io/laconicd/x/evm/migrations/v2/types"
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
)
|
||||
|
||||
func TestMigrateStore(t *testing.T) {
|
||||
encCfg := encoding.MakeConfig(app.ModuleBasics)
|
||||
feemarketKey := sdk.NewKVStoreKey(types.StoreKey)
|
||||
tFeeMarketKey := sdk.NewTransientStoreKey(fmt.Sprintf("%s_test", types.StoreKey))
|
||||
ctx := testutil.DefaultContext(feemarketKey, tFeeMarketKey)
|
||||
paramstore := paramtypes.NewSubspace(
|
||||
encCfg.Codec, encCfg.Amino, feemarketKey, tFeeMarketKey, "evm",
|
||||
).WithKeyTable(v2types.ParamKeyTable())
|
||||
|
||||
params := v2types.DefaultParams()
|
||||
paramstore.SetParamSet(ctx, ¶ms)
|
||||
|
||||
require.Panics(t, func() {
|
||||
var result bool
|
||||
paramstore.Get(ctx, types.ParamStoreKeyAllowUnprotectedTxs, &result)
|
||||
})
|
||||
|
||||
paramstore = paramtypes.NewSubspace(
|
||||
encCfg.Codec, encCfg.Amino, feemarketKey, tFeeMarketKey, "evm",
|
||||
).WithKeyTable(types.ParamKeyTable())
|
||||
err := v2.MigrateStore(ctx, ¶mstore)
|
||||
require.NoError(t, err)
|
||||
|
||||
var result bool
|
||||
paramstore.Get(ctx, types.ParamStoreKeyAllowUnprotectedTxs, &result)
|
||||
require.Equal(t, types.DefaultAllowUnprotectedTxs, result)
|
||||
}
|
||||
@@ -1,167 +0,0 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
"strings"
|
||||
|
||||
sdkmath "cosmossdk.io/math"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
)
|
||||
|
||||
// EthereumConfig returns an Ethereum ChainConfig for EVM state transitions.
|
||||
// All the negative or nil values are converted to nil
|
||||
func (cc ChainConfig) EthereumConfig(chainID *big.Int) *params.ChainConfig {
|
||||
return ¶ms.ChainConfig{
|
||||
ChainID: chainID,
|
||||
HomesteadBlock: getBlockValue(cc.HomesteadBlock),
|
||||
DAOForkBlock: getBlockValue(cc.DAOForkBlock),
|
||||
DAOForkSupport: cc.DAOForkSupport,
|
||||
EIP150Block: getBlockValue(cc.EIP150Block),
|
||||
EIP150Hash: common.HexToHash(cc.EIP150Hash),
|
||||
EIP155Block: getBlockValue(cc.EIP155Block),
|
||||
EIP158Block: getBlockValue(cc.EIP158Block),
|
||||
ByzantiumBlock: getBlockValue(cc.ByzantiumBlock),
|
||||
ConstantinopleBlock: getBlockValue(cc.ConstantinopleBlock),
|
||||
PetersburgBlock: getBlockValue(cc.PetersburgBlock),
|
||||
IstanbulBlock: getBlockValue(cc.IstanbulBlock),
|
||||
MuirGlacierBlock: getBlockValue(cc.MuirGlacierBlock),
|
||||
BerlinBlock: getBlockValue(cc.BerlinBlock),
|
||||
LondonBlock: getBlockValue(cc.LondonBlock),
|
||||
ArrowGlacierBlock: getBlockValue(cc.ArrowGlacierBlock),
|
||||
MergeNetsplitBlock: getBlockValue(cc.MergeForkBlock),
|
||||
TerminalTotalDifficulty: nil,
|
||||
Ethash: nil,
|
||||
Clique: nil,
|
||||
}
|
||||
}
|
||||
|
||||
// DefaultChainConfig returns default evm parameters.
|
||||
func DefaultChainConfig() ChainConfig {
|
||||
homesteadBlock := sdk.ZeroInt()
|
||||
daoForkBlock := sdk.ZeroInt()
|
||||
eip150Block := sdk.ZeroInt()
|
||||
eip155Block := sdk.ZeroInt()
|
||||
eip158Block := sdk.ZeroInt()
|
||||
byzantiumBlock := sdk.ZeroInt()
|
||||
constantinopleBlock := sdk.ZeroInt()
|
||||
petersburgBlock := sdk.ZeroInt()
|
||||
istanbulBlock := sdk.ZeroInt()
|
||||
muirGlacierBlock := sdk.ZeroInt()
|
||||
berlinBlock := sdk.ZeroInt()
|
||||
londonBlock := sdk.ZeroInt()
|
||||
arrowGlacierBlock := sdk.ZeroInt()
|
||||
mergeForkBlock := sdk.ZeroInt()
|
||||
|
||||
return ChainConfig{
|
||||
HomesteadBlock: &homesteadBlock,
|
||||
DAOForkBlock: &daoForkBlock,
|
||||
DAOForkSupport: true,
|
||||
EIP150Block: &eip150Block,
|
||||
EIP150Hash: common.Hash{}.String(),
|
||||
EIP155Block: &eip155Block,
|
||||
EIP158Block: &eip158Block,
|
||||
ByzantiumBlock: &byzantiumBlock,
|
||||
ConstantinopleBlock: &constantinopleBlock,
|
||||
PetersburgBlock: &petersburgBlock,
|
||||
IstanbulBlock: &istanbulBlock,
|
||||
MuirGlacierBlock: &muirGlacierBlock,
|
||||
BerlinBlock: &berlinBlock,
|
||||
LondonBlock: &londonBlock,
|
||||
ArrowGlacierBlock: &arrowGlacierBlock,
|
||||
MergeForkBlock: &mergeForkBlock,
|
||||
}
|
||||
}
|
||||
|
||||
func getBlockValue(block *sdkmath.Int) *big.Int {
|
||||
if block == nil || block.IsNegative() {
|
||||
return nil
|
||||
}
|
||||
|
||||
return block.BigInt()
|
||||
}
|
||||
|
||||
// Validate performs a basic validation of the ChainConfig params. The function will return an error
|
||||
// if any of the block values is uninitialized (i.e nil) or if the EIP150Hash is an invalid hash.
|
||||
func (cc ChainConfig) Validate() error {
|
||||
if err := validateBlock(cc.HomesteadBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "homesteadBlock")
|
||||
}
|
||||
if err := validateBlock(cc.DAOForkBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "daoForkBlock")
|
||||
}
|
||||
if err := validateBlock(cc.EIP150Block); err != nil {
|
||||
return sdkerrors.Wrap(err, "eip150Block")
|
||||
}
|
||||
if err := validateHash(cc.EIP150Hash); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := validateBlock(cc.EIP155Block); err != nil {
|
||||
return sdkerrors.Wrap(err, "eip155Block")
|
||||
}
|
||||
if err := validateBlock(cc.EIP158Block); err != nil {
|
||||
return sdkerrors.Wrap(err, "eip158Block")
|
||||
}
|
||||
if err := validateBlock(cc.ByzantiumBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "byzantiumBlock")
|
||||
}
|
||||
if err := validateBlock(cc.ConstantinopleBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "constantinopleBlock")
|
||||
}
|
||||
if err := validateBlock(cc.PetersburgBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "petersburgBlock")
|
||||
}
|
||||
if err := validateBlock(cc.IstanbulBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "istanbulBlock")
|
||||
}
|
||||
if err := validateBlock(cc.MuirGlacierBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "muirGlacierBlock")
|
||||
}
|
||||
if err := validateBlock(cc.BerlinBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "berlinBlock")
|
||||
}
|
||||
if err := validateBlock(cc.LondonBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "londonBlock")
|
||||
}
|
||||
if err := validateBlock(cc.ArrowGlacierBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "arrowGlacierBlock")
|
||||
}
|
||||
if err := validateBlock(cc.MergeForkBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "mergeForkBlock")
|
||||
}
|
||||
|
||||
// NOTE: chain ID is not needed to check config order
|
||||
if err := cc.EthereumConfig(nil).CheckConfigForkOrder(); err != nil {
|
||||
return sdkerrors.Wrap(err, "invalid config fork order")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateHash(hex string) error {
|
||||
if hex != "" && strings.TrimSpace(hex) == "" {
|
||||
return sdkerrors.Wrap(types.ErrInvalidChainConfig, "hash cannot be blank")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateBlock(block *sdkmath.Int) error {
|
||||
// nil value means that the fork has not yet been applied
|
||||
if block == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if block.IsNegative() {
|
||||
return sdkerrors.Wrapf(
|
||||
types.ErrInvalidChainConfig, "block value cannot be negative: %s", block,
|
||||
)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Generated
-3781
File diff suppressed because it is too large
Load Diff
@@ -1,145 +0,0 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
|
||||
"github.com/cerc-io/laconicd/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
)
|
||||
|
||||
var _ paramtypes.ParamSet = &Params{}
|
||||
|
||||
const (
|
||||
DefaultEVMDenom = types.AttoPhoton
|
||||
)
|
||||
|
||||
// DefaultMinGasMultiplier is 0.5 or 50%
|
||||
var DefaultMinGasMultiplier = sdk.NewDecWithPrec(50, 2)
|
||||
|
||||
// Parameter keys
|
||||
var (
|
||||
ParamStoreKeyEVMDenom = []byte("EVMDenom")
|
||||
ParamStoreKeyEnableCreate = []byte("EnableCreate")
|
||||
ParamStoreKeyEnableCall = []byte("EnableCall")
|
||||
ParamStoreKeyExtraEIPs = []byte("EnableExtraEIPs")
|
||||
ParamStoreKeyChainConfig = []byte("ChainConfig")
|
||||
|
||||
// AvailableExtraEIPs define the list of all EIPs that can be enabled by the
|
||||
// EVM interpreter. These EIPs are applied in order and can override the
|
||||
// instruction sets from the latest hard fork enabled by the ChainConfig. For
|
||||
// more info check:
|
||||
// https://github.com/ethereum/go-ethereum/blob/master/core/vm/interpreter.go#L97
|
||||
AvailableExtraEIPs = []int64{1344, 1884, 2200, 2929, 3198, 3529}
|
||||
)
|
||||
|
||||
// ParamKeyTable returns the parameter key table.
|
||||
func ParamKeyTable() paramtypes.KeyTable {
|
||||
return paramtypes.NewKeyTable().RegisterParamSet(&Params{})
|
||||
}
|
||||
|
||||
// NewParams creates a new Params instance
|
||||
func NewParams(evmDenom string, enableCreate, enableCall bool, config ChainConfig, extraEIPs ...int64) Params {
|
||||
return Params{
|
||||
EvmDenom: evmDenom,
|
||||
EnableCreate: enableCreate,
|
||||
EnableCall: enableCall,
|
||||
ExtraEIPs: extraEIPs,
|
||||
ChainConfig: config,
|
||||
}
|
||||
}
|
||||
|
||||
// DefaultParams returns default evm parameters
|
||||
// ExtraEIPs is empty to prevent overriding the latest hard fork instruction set
|
||||
func DefaultParams() Params {
|
||||
return Params{
|
||||
EvmDenom: DefaultEVMDenom,
|
||||
EnableCreate: true,
|
||||
EnableCall: true,
|
||||
ChainConfig: DefaultChainConfig(),
|
||||
ExtraEIPs: nil,
|
||||
}
|
||||
}
|
||||
|
||||
// ParamSetPairs returns the parameter set pairs.
|
||||
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
|
||||
return paramtypes.ParamSetPairs{
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyEVMDenom, &p.EvmDenom, validateEVMDenom),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyEnableCreate, &p.EnableCreate, validateBool),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyEnableCall, &p.EnableCall, validateBool),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyExtraEIPs, &p.ExtraEIPs, validateEIPs),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyChainConfig, &p.ChainConfig, validateChainConfig),
|
||||
}
|
||||
}
|
||||
|
||||
// Validate performs basic validation on evm parameters.
|
||||
func (p Params) Validate() error {
|
||||
if err := sdk.ValidateDenom(p.EvmDenom); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validateEIPs(p.ExtraEIPs); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return p.ChainConfig.Validate()
|
||||
}
|
||||
|
||||
// EIPs returns the ExtraEips as a int slice
|
||||
func (p Params) EIPs() []int {
|
||||
eips := make([]int, len(p.ExtraEIPs))
|
||||
for i, eip := range p.ExtraEIPs {
|
||||
eips[i] = int(eip)
|
||||
}
|
||||
return eips
|
||||
}
|
||||
|
||||
func validateEVMDenom(i interface{}) error {
|
||||
denom, ok := i.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("invalid parameter EVM denom type: %T", i)
|
||||
}
|
||||
|
||||
return sdk.ValidateDenom(denom)
|
||||
}
|
||||
|
||||
func validateBool(i interface{}) error {
|
||||
_, ok := i.(bool)
|
||||
if !ok {
|
||||
return fmt.Errorf("invalid parameter type: %T", i)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateEIPs(i interface{}) error {
|
||||
eips, ok := i.([]int64)
|
||||
if !ok {
|
||||
return fmt.Errorf("invalid EIP slice type: %T", i)
|
||||
}
|
||||
|
||||
for _, eip := range eips {
|
||||
if !vm.ValidEip(int(eip)) {
|
||||
return fmt.Errorf("EIP %d is not activateable, valid EIPS are: %s", eip, vm.ActivateableEips())
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateChainConfig(i interface{}) error {
|
||||
cfg, ok := i.(ChainConfig)
|
||||
if !ok {
|
||||
return fmt.Errorf("invalid chain config type: %T", i)
|
||||
}
|
||||
|
||||
return cfg.Validate()
|
||||
}
|
||||
|
||||
// IsLondon returns if london hardfork is enabled.
|
||||
func IsLondon(ethConfig *params.ChainConfig, height int64) bool {
|
||||
return ethConfig.IsLondon(big.NewInt(height))
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
)
|
||||
|
||||
// MigrateStore sets the default for GrayGlacierBlock and MergeNetsplitBlock in ChainConfig parameter.
|
||||
func MigrateStore(ctx sdk.Context, paramstore *paramtypes.Subspace) error {
|
||||
if !paramstore.HasKeyTable() {
|
||||
ps := paramstore.WithKeyTable(types.ParamKeyTable())
|
||||
paramstore = &ps
|
||||
}
|
||||
prevConfig := &types.ChainConfig{}
|
||||
paramstore.GetIfExists(ctx, types.ParamStoreKeyChainConfig, prevConfig)
|
||||
|
||||
defaultConfig := types.DefaultChainConfig()
|
||||
|
||||
prevConfig.GrayGlacierBlock = defaultConfig.GrayGlacierBlock
|
||||
prevConfig.MergeNetsplitBlock = defaultConfig.MergeNetsplitBlock
|
||||
|
||||
paramstore.Set(ctx, types.ParamStoreKeyChainConfig, prevConfig)
|
||||
return nil
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package v3_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
v3 "github.com/cerc-io/laconicd/x/evm/migrations/v3"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/testutil"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
|
||||
"github.com/cerc-io/laconicd/encoding"
|
||||
|
||||
"github.com/cerc-io/laconicd/app"
|
||||
v3types "github.com/cerc-io/laconicd/x/evm/migrations/v3/types"
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
)
|
||||
|
||||
func TestMigrateStore(t *testing.T) {
|
||||
encCfg := encoding.MakeConfig(app.ModuleBasics)
|
||||
evmKey := sdk.NewKVStoreKey(types.StoreKey)
|
||||
tEvmKey := sdk.NewTransientStoreKey(fmt.Sprintf("%s_test", types.StoreKey))
|
||||
ctx := testutil.DefaultContext(evmKey, tEvmKey)
|
||||
paramstore := paramtypes.NewSubspace(
|
||||
encCfg.Codec, encCfg.Amino, evmKey, tEvmKey, "evm",
|
||||
).WithKeyTable(v3types.ParamKeyTable())
|
||||
|
||||
params := v3types.DefaultParams()
|
||||
paramstore.SetParamSet(ctx, ¶ms)
|
||||
|
||||
require.Panics(t, func() {
|
||||
var preMigrationConfig types.ChainConfig
|
||||
paramstore.Get(ctx, types.ParamStoreKeyChainConfig, &preMigrationConfig)
|
||||
})
|
||||
var preMigrationConfig v3types.ChainConfig
|
||||
paramstore.Get(ctx, types.ParamStoreKeyChainConfig, &preMigrationConfig)
|
||||
require.NotNil(t, preMigrationConfig.MergeForkBlock)
|
||||
|
||||
paramstore = paramtypes.NewSubspace(
|
||||
encCfg.Codec, encCfg.Amino, evmKey, tEvmKey, "evm",
|
||||
).WithKeyTable(types.ParamKeyTable())
|
||||
err := v3.MigrateStore(ctx, ¶mstore)
|
||||
require.NoError(t, err)
|
||||
|
||||
updatedDefaultConfig := types.DefaultChainConfig()
|
||||
|
||||
var postMigrationConfig types.ChainConfig
|
||||
paramstore.Get(ctx, types.ParamStoreKeyChainConfig, &postMigrationConfig)
|
||||
require.Equal(t, postMigrationConfig.GrayGlacierBlock, updatedDefaultConfig.GrayGlacierBlock)
|
||||
require.Equal(t, postMigrationConfig.MergeNetsplitBlock, updatedDefaultConfig.MergeNetsplitBlock)
|
||||
require.Panics(t, func() {
|
||||
var preMigrationConfig v3types.ChainConfig
|
||||
paramstore.Get(ctx, types.ParamStoreKeyChainConfig, &preMigrationConfig)
|
||||
})
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
"strings"
|
||||
|
||||
sdkmath "cosmossdk.io/math"
|
||||
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
)
|
||||
|
||||
// EthereumConfig returns an Ethereum ChainConfig for EVM state transitions.
|
||||
// All the negative or nil values are converted to nil
|
||||
func (cc ChainConfig) EthereumConfig(chainID *big.Int) *params.ChainConfig {
|
||||
return ¶ms.ChainConfig{
|
||||
ChainID: chainID,
|
||||
HomesteadBlock: getBlockValue(cc.HomesteadBlock),
|
||||
DAOForkBlock: getBlockValue(cc.DAOForkBlock),
|
||||
DAOForkSupport: cc.DAOForkSupport,
|
||||
EIP150Block: getBlockValue(cc.EIP150Block),
|
||||
EIP150Hash: common.HexToHash(cc.EIP150Hash),
|
||||
EIP155Block: getBlockValue(cc.EIP155Block),
|
||||
EIP158Block: getBlockValue(cc.EIP158Block),
|
||||
ByzantiumBlock: getBlockValue(cc.ByzantiumBlock),
|
||||
ConstantinopleBlock: getBlockValue(cc.ConstantinopleBlock),
|
||||
PetersburgBlock: getBlockValue(cc.PetersburgBlock),
|
||||
IstanbulBlock: getBlockValue(cc.IstanbulBlock),
|
||||
MuirGlacierBlock: getBlockValue(cc.MuirGlacierBlock),
|
||||
BerlinBlock: getBlockValue(cc.BerlinBlock),
|
||||
LondonBlock: getBlockValue(cc.LondonBlock),
|
||||
ArrowGlacierBlock: getBlockValue(cc.ArrowGlacierBlock),
|
||||
TerminalTotalDifficulty: nil,
|
||||
Ethash: nil,
|
||||
Clique: nil,
|
||||
}
|
||||
}
|
||||
|
||||
// DefaultChainConfig returns default evm parameters.
|
||||
func DefaultChainConfig() ChainConfig {
|
||||
homesteadBlock := sdk.ZeroInt()
|
||||
daoForkBlock := sdk.ZeroInt()
|
||||
eip150Block := sdk.ZeroInt()
|
||||
eip155Block := sdk.ZeroInt()
|
||||
eip158Block := sdk.ZeroInt()
|
||||
byzantiumBlock := sdk.ZeroInt()
|
||||
constantinopleBlock := sdk.ZeroInt()
|
||||
petersburgBlock := sdk.ZeroInt()
|
||||
istanbulBlock := sdk.ZeroInt()
|
||||
muirGlacierBlock := sdk.ZeroInt()
|
||||
berlinBlock := sdk.ZeroInt()
|
||||
londonBlock := sdk.ZeroInt()
|
||||
arrowGlacierBlock := sdk.ZeroInt()
|
||||
mergeForkBlock := sdk.ZeroInt()
|
||||
|
||||
return ChainConfig{
|
||||
HomesteadBlock: &homesteadBlock,
|
||||
DAOForkBlock: &daoForkBlock,
|
||||
DAOForkSupport: true,
|
||||
EIP150Block: &eip150Block,
|
||||
EIP150Hash: common.Hash{}.String(),
|
||||
EIP155Block: &eip155Block,
|
||||
EIP158Block: &eip158Block,
|
||||
ByzantiumBlock: &byzantiumBlock,
|
||||
ConstantinopleBlock: &constantinopleBlock,
|
||||
PetersburgBlock: &petersburgBlock,
|
||||
IstanbulBlock: &istanbulBlock,
|
||||
MuirGlacierBlock: &muirGlacierBlock,
|
||||
BerlinBlock: &berlinBlock,
|
||||
LondonBlock: &londonBlock,
|
||||
ArrowGlacierBlock: &arrowGlacierBlock,
|
||||
MergeForkBlock: &mergeForkBlock,
|
||||
}
|
||||
}
|
||||
|
||||
func getBlockValue(block *sdkmath.Int) *big.Int {
|
||||
if block == nil || block.IsNegative() {
|
||||
return nil
|
||||
}
|
||||
|
||||
return block.BigInt()
|
||||
}
|
||||
|
||||
// Validate performs a basic validation of the ChainConfig params. The function will return an error
|
||||
// if any of the block values is uninitialized (i.e nil) or if the EIP150Hash is an invalid hash.
|
||||
func (cc ChainConfig) Validate() error {
|
||||
if err := validateBlock(cc.HomesteadBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "homesteadBlock")
|
||||
}
|
||||
if err := validateBlock(cc.DAOForkBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "daoForkBlock")
|
||||
}
|
||||
if err := validateBlock(cc.EIP150Block); err != nil {
|
||||
return sdkerrors.Wrap(err, "eip150Block")
|
||||
}
|
||||
if err := validateHash(cc.EIP150Hash); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := validateBlock(cc.EIP155Block); err != nil {
|
||||
return sdkerrors.Wrap(err, "eip155Block")
|
||||
}
|
||||
if err := validateBlock(cc.EIP158Block); err != nil {
|
||||
return sdkerrors.Wrap(err, "eip158Block")
|
||||
}
|
||||
if err := validateBlock(cc.ByzantiumBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "byzantiumBlock")
|
||||
}
|
||||
if err := validateBlock(cc.ConstantinopleBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "constantinopleBlock")
|
||||
}
|
||||
if err := validateBlock(cc.PetersburgBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "petersburgBlock")
|
||||
}
|
||||
if err := validateBlock(cc.IstanbulBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "istanbulBlock")
|
||||
}
|
||||
if err := validateBlock(cc.MuirGlacierBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "muirGlacierBlock")
|
||||
}
|
||||
if err := validateBlock(cc.BerlinBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "berlinBlock")
|
||||
}
|
||||
if err := validateBlock(cc.LondonBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "londonBlock")
|
||||
}
|
||||
if err := validateBlock(cc.ArrowGlacierBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "arrowGlacierBlock")
|
||||
}
|
||||
if err := validateBlock(cc.MergeForkBlock); err != nil {
|
||||
return sdkerrors.Wrap(err, "mergeForkBlock")
|
||||
}
|
||||
|
||||
// NOTE: chain ID is not needed to check config order
|
||||
if err := cc.EthereumConfig(nil).CheckConfigForkOrder(); err != nil {
|
||||
return sdkerrors.Wrap(err, "invalid config fork order")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateHash(hex string) error {
|
||||
if hex != "" && strings.TrimSpace(hex) == "" {
|
||||
return sdkerrors.Wrap(types.ErrInvalidChainConfig, "hash cannot be blank")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateBlock(block *sdkmath.Int) error {
|
||||
// nil value means that the fork has not yet been applied
|
||||
if block == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if block.IsNegative() {
|
||||
return sdkerrors.Wrapf(
|
||||
types.ErrInvalidChainConfig, "block value cannot be negative: %s", block,
|
||||
)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -1,150 +0,0 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
|
||||
"github.com/cerc-io/laconicd/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
)
|
||||
|
||||
var _ paramtypes.ParamSet = &Params{}
|
||||
|
||||
var (
|
||||
// DefaultEVMDenom defines the default EVM denomination on Ethermint
|
||||
DefaultEVMDenom = types.AttoPhoton
|
||||
// DefaultMinGasMultiplier is 0.5 or 50%
|
||||
DefaultMinGasMultiplier = sdk.NewDecWithPrec(50, 2)
|
||||
// DefaultAllowUnprotectedTxs rejects all unprotected txs (i.e false)
|
||||
DefaultAllowUnprotectedTxs = false
|
||||
)
|
||||
|
||||
// Parameter keys
|
||||
var (
|
||||
ParamStoreKeyEVMDenom = []byte("EVMDenom")
|
||||
ParamStoreKeyEnableCreate = []byte("EnableCreate")
|
||||
ParamStoreKeyEnableCall = []byte("EnableCall")
|
||||
ParamStoreKeyExtraEIPs = []byte("EnableExtraEIPs")
|
||||
ParamStoreKeyChainConfig = []byte("ChainConfig")
|
||||
ParamStoreKeyAllowUnprotectedTxs = []byte("AllowUnprotectedTxs")
|
||||
|
||||
// AvailableExtraEIPs define the list of all EIPs that can be enabled by the
|
||||
// EVM interpreter. These EIPs are applied in order and can override the
|
||||
// instruction sets from the latest hard fork enabled by the ChainConfig. For
|
||||
// more info check:
|
||||
// https://github.com/ethereum/go-ethereum/blob/master/core/vm/interpreter.go#L97
|
||||
AvailableExtraEIPs = []int64{1344, 1884, 2200, 2929, 3198, 3529}
|
||||
)
|
||||
|
||||
// ParamKeyTable returns the parameter key table.
|
||||
func ParamKeyTable() paramtypes.KeyTable {
|
||||
return paramtypes.NewKeyTable().RegisterParamSet(&Params{})
|
||||
}
|
||||
|
||||
// NewParams creates a new Params instance
|
||||
func NewParams(evmDenom string, enableCreate, enableCall bool, config ChainConfig, extraEIPs ...int64) Params {
|
||||
return Params{
|
||||
EvmDenom: evmDenom,
|
||||
EnableCreate: enableCreate,
|
||||
EnableCall: enableCall,
|
||||
ExtraEIPs: extraEIPs,
|
||||
ChainConfig: config,
|
||||
}
|
||||
}
|
||||
|
||||
// DefaultParams returns default evm parameters
|
||||
// ExtraEIPs is empty to prevent overriding the latest hard fork instruction set
|
||||
func DefaultParams() Params {
|
||||
return Params{
|
||||
EvmDenom: DefaultEVMDenom,
|
||||
EnableCreate: true,
|
||||
EnableCall: true,
|
||||
ChainConfig: DefaultChainConfig(),
|
||||
ExtraEIPs: nil,
|
||||
AllowUnprotectedTxs: DefaultAllowUnprotectedTxs,
|
||||
}
|
||||
}
|
||||
|
||||
// ParamSetPairs returns the parameter set pairs.
|
||||
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
|
||||
return paramtypes.ParamSetPairs{
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyEVMDenom, &p.EvmDenom, validateEVMDenom),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyEnableCreate, &p.EnableCreate, validateBool),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyEnableCall, &p.EnableCall, validateBool),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyExtraEIPs, &p.ExtraEIPs, validateEIPs),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyChainConfig, &p.ChainConfig, validateChainConfig),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyAllowUnprotectedTxs, &p.AllowUnprotectedTxs, validateBool),
|
||||
}
|
||||
}
|
||||
|
||||
// Validate performs basic validation on evm parameters.
|
||||
func (p Params) Validate() error {
|
||||
if err := sdk.ValidateDenom(p.EvmDenom); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validateEIPs(p.ExtraEIPs); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return p.ChainConfig.Validate()
|
||||
}
|
||||
|
||||
// EIPs returns the ExtraEips as a int slice
|
||||
func (p Params) EIPs() []int {
|
||||
eips := make([]int, len(p.ExtraEIPs))
|
||||
for i, eip := range p.ExtraEIPs {
|
||||
eips[i] = int(eip)
|
||||
}
|
||||
return eips
|
||||
}
|
||||
|
||||
func validateEVMDenom(i interface{}) error {
|
||||
denom, ok := i.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("invalid parameter EVM denom type: %T", i)
|
||||
}
|
||||
|
||||
return sdk.ValidateDenom(denom)
|
||||
}
|
||||
|
||||
func validateBool(i interface{}) error {
|
||||
_, ok := i.(bool)
|
||||
if !ok {
|
||||
return fmt.Errorf("invalid parameter type: %T", i)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateEIPs(i interface{}) error {
|
||||
eips, ok := i.([]int64)
|
||||
if !ok {
|
||||
return fmt.Errorf("invalid EIP slice type: %T", i)
|
||||
}
|
||||
|
||||
for _, eip := range eips {
|
||||
if !vm.ValidEip(int(eip)) {
|
||||
return fmt.Errorf("EIP %d is not activateable, valid EIPS are: %s", eip, vm.ActivateableEips())
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateChainConfig(i interface{}) error {
|
||||
cfg, ok := i.(ChainConfig)
|
||||
if !ok {
|
||||
return fmt.Errorf("invalid chain config type: %T", i)
|
||||
}
|
||||
|
||||
return cfg.Validate()
|
||||
}
|
||||
|
||||
// IsLondon returns if london hardfork is enabled.
|
||||
func IsLondon(ethConfig *params.ChainConfig, height int64) bool {
|
||||
return ethConfig.IsLondon(big.NewInt(height))
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package v4
|
||||
|
||||
import (
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
v4types "github.com/cerc-io/laconicd/x/evm/migrations/v4/types"
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
)
|
||||
|
||||
// MigrateStore migrates the x/evm module state from the consensus version 3 to
|
||||
// version 4. Specifically, it takes the parameters that are currently stored
|
||||
// and managed by the Cosmos SDK params module and stores them directly into the x/evm module state.
|
||||
func MigrateStore(
|
||||
ctx sdk.Context,
|
||||
storeKey storetypes.StoreKey,
|
||||
legacySubspace types.Subspace,
|
||||
cdc codec.BinaryCodec,
|
||||
) error {
|
||||
var params types.Params
|
||||
|
||||
legacySubspace.GetParamSetIfExists(ctx, ¶ms)
|
||||
|
||||
if err := params.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
chainCfgBz := cdc.MustMarshal(¶ms.ChainConfig)
|
||||
extraEIPsBz := cdc.MustMarshal(&v4types.ExtraEIPs{EIPs: params.ExtraEIPs})
|
||||
|
||||
store := ctx.KVStore(storeKey)
|
||||
|
||||
store.Set(types.ParamStoreKeyEVMDenom, []byte(params.EvmDenom))
|
||||
store.Set(types.ParamStoreKeyExtraEIPs, extraEIPsBz)
|
||||
store.Set(types.ParamStoreKeyChainConfig, chainCfgBz)
|
||||
|
||||
if params.AllowUnprotectedTxs {
|
||||
store.Set(types.ParamStoreKeyAllowUnprotectedTxs, []byte{0x01})
|
||||
}
|
||||
|
||||
if params.EnableCall {
|
||||
store.Set(types.ParamStoreKeyEnableCall, []byte{0x01})
|
||||
}
|
||||
|
||||
if params.EnableCreate {
|
||||
store.Set(types.ParamStoreKeyEnableCreate, []byte{0x01})
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package v4_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
|
||||
"github.com/cerc-io/laconicd/app"
|
||||
"github.com/cerc-io/laconicd/encoding"
|
||||
v4 "github.com/cerc-io/laconicd/x/evm/migrations/v4"
|
||||
v4types "github.com/cerc-io/laconicd/x/evm/migrations/v4/types"
|
||||
"github.com/cosmos/cosmos-sdk/testutil"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
type mockSubspace struct {
|
||||
ps types.Params
|
||||
}
|
||||
|
||||
func newMockSubspace(ps types.Params) mockSubspace {
|
||||
return mockSubspace{ps: ps}
|
||||
}
|
||||
|
||||
func (ms mockSubspace) GetParamSetIfExists(ctx sdk.Context, ps types.LegacyParams) {
|
||||
*ps.(*types.Params) = ms.ps
|
||||
}
|
||||
|
||||
func TestMigrate(t *testing.T) {
|
||||
encCfg := encoding.MakeConfig(app.ModuleBasics)
|
||||
cdc := encCfg.Codec
|
||||
|
||||
storeKey := sdk.NewKVStoreKey(types.ModuleName)
|
||||
tKey := sdk.NewTransientStoreKey(types.TransientKey)
|
||||
ctx := testutil.DefaultContext(storeKey, tKey)
|
||||
kvStore := ctx.KVStore(storeKey)
|
||||
|
||||
legacySubspace := newMockSubspace(types.DefaultParams())
|
||||
require.NoError(t, v4.MigrateStore(ctx, storeKey, legacySubspace, cdc))
|
||||
|
||||
// Get all the new parameters from the kvStore
|
||||
var evmDenom string
|
||||
bz := kvStore.Get(types.ParamStoreKeyEVMDenom)
|
||||
evmDenom = string(bz)
|
||||
|
||||
allowUnprotectedTx := kvStore.Has(types.ParamStoreKeyAllowUnprotectedTxs)
|
||||
enableCreate := kvStore.Has(types.ParamStoreKeyEnableCreate)
|
||||
enableCall := kvStore.Has(types.ParamStoreKeyEnableCall)
|
||||
|
||||
var chainCfg v4types.V4ChainConfig
|
||||
bz = kvStore.Get(types.ParamStoreKeyChainConfig)
|
||||
cdc.MustUnmarshal(bz, &chainCfg)
|
||||
|
||||
var extraEIPs v4types.ExtraEIPs
|
||||
bz = kvStore.Get(types.ParamStoreKeyExtraEIPs)
|
||||
cdc.MustUnmarshal(bz, &extraEIPs)
|
||||
require.Equal(t, []int64(nil), extraEIPs.EIPs)
|
||||
|
||||
params := v4types.V4Params{
|
||||
EvmDenom: evmDenom,
|
||||
AllowUnprotectedTxs: allowUnprotectedTx,
|
||||
EnableCreate: enableCreate,
|
||||
EnableCall: enableCall,
|
||||
V4ChainConfig: chainCfg,
|
||||
ExtraEIPs: extraEIPs,
|
||||
}
|
||||
|
||||
require.Equal(t, legacySubspace.ps.EnableCall, params.EnableCall)
|
||||
require.Equal(t, legacySubspace.ps.EnableCreate, params.EnableCreate)
|
||||
require.Equal(t, legacySubspace.ps.AllowUnprotectedTxs, params.AllowUnprotectedTxs)
|
||||
require.Equal(t, legacySubspace.ps.ExtraEIPs, params.ExtraEIPs.EIPs)
|
||||
require.EqualValues(t, legacySubspace.ps.ChainConfig, params.V4ChainConfig)
|
||||
}
|
||||
+969
-546
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,64 @@
|
||||
package v5
|
||||
|
||||
import (
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
v5types "github.com/cerc-io/laconicd/x/evm/migrations/v5/types"
|
||||
)
|
||||
|
||||
// MigrateStore migrates the x/evm module state from the consensus version 4 to
|
||||
// version 5. Specifically, it takes the parameters that are currently stored
|
||||
// in separate keys and stores them directly into the x/evm module state using
|
||||
// a single params key.
|
||||
func MigrateStore(
|
||||
ctx sdk.Context,
|
||||
storeKey storetypes.StoreKey,
|
||||
cdc codec.BinaryCodec,
|
||||
) error {
|
||||
var (
|
||||
extraEIPs v5types.V5ExtraEIPs
|
||||
chainConfig types.ChainConfig
|
||||
params types.Params
|
||||
)
|
||||
|
||||
store := ctx.KVStore(storeKey)
|
||||
|
||||
denom := string(store.Get(types.ParamStoreKeyEVMDenom))
|
||||
|
||||
extraEIPsBz := store.Get(types.ParamStoreKeyExtraEIPs)
|
||||
cdc.MustUnmarshal(extraEIPsBz, &extraEIPs)
|
||||
|
||||
// revert ExtraEIP change for Evmos testnet
|
||||
if ctx.ChainID() == "evmos_9000-4" {
|
||||
extraEIPs.EIPs = []int64{}
|
||||
}
|
||||
|
||||
chainCfgBz := store.Get(types.ParamStoreKeyChainConfig)
|
||||
cdc.MustUnmarshal(chainCfgBz, &chainConfig)
|
||||
|
||||
params.EvmDenom = denom
|
||||
params.ExtraEIPs = extraEIPs.EIPs
|
||||
params.ChainConfig = chainConfig
|
||||
params.EnableCreate = store.Has(types.ParamStoreKeyEnableCreate)
|
||||
params.EnableCall = store.Has(types.ParamStoreKeyEnableCall)
|
||||
params.AllowUnprotectedTxs = store.Has(types.ParamStoreKeyAllowUnprotectedTxs)
|
||||
|
||||
store.Delete(types.ParamStoreKeyChainConfig)
|
||||
store.Delete(types.ParamStoreKeyExtraEIPs)
|
||||
store.Delete(types.ParamStoreKeyEVMDenom)
|
||||
store.Delete(types.ParamStoreKeyEnableCreate)
|
||||
store.Delete(types.ParamStoreKeyEnableCall)
|
||||
store.Delete(types.ParamStoreKeyAllowUnprotectedTxs)
|
||||
|
||||
if err := params.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
bz := cdc.MustMarshal(¶ms)
|
||||
|
||||
store.Set(types.KeyPrefixParams, bz)
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package v5_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/testutil"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/cerc-io/laconicd/app"
|
||||
"github.com/cerc-io/laconicd/encoding"
|
||||
v5 "github.com/cerc-io/laconicd/x/evm/migrations/v5"
|
||||
v5types "github.com/cerc-io/laconicd/x/evm/migrations/v5/types"
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
)
|
||||
|
||||
func TestMigrate(t *testing.T) {
|
||||
encCfg := encoding.MakeConfig(app.ModuleBasics)
|
||||
cdc := encCfg.Codec
|
||||
|
||||
storeKey := sdk.NewKVStoreKey(types.ModuleName)
|
||||
tKey := sdk.NewTransientStoreKey("transient_test")
|
||||
ctx := testutil.DefaultContext(storeKey, tKey)
|
||||
kvStore := ctx.KVStore(storeKey)
|
||||
|
||||
extraEIPs := v5types.V5ExtraEIPs{EIPs: types.AvailableExtraEIPs}
|
||||
extraEIPsBz := cdc.MustMarshal(&extraEIPs)
|
||||
chainConfig := types.DefaultChainConfig()
|
||||
chainConfigBz := cdc.MustMarshal(&chainConfig)
|
||||
|
||||
// Set the params in the store
|
||||
kvStore.Set(types.ParamStoreKeyEVMDenom, []byte("aphoton"))
|
||||
kvStore.Set(types.ParamStoreKeyEnableCreate, []byte{0x01})
|
||||
kvStore.Set(types.ParamStoreKeyEnableCall, []byte{0x01})
|
||||
kvStore.Set(types.ParamStoreKeyAllowUnprotectedTxs, []byte{0x01})
|
||||
kvStore.Set(types.ParamStoreKeyExtraEIPs, extraEIPsBz)
|
||||
kvStore.Set(types.ParamStoreKeyChainConfig, chainConfigBz)
|
||||
|
||||
err := v5.MigrateStore(ctx, storeKey, cdc)
|
||||
require.NoError(t, err)
|
||||
|
||||
paramsBz := kvStore.Get(types.KeyPrefixParams)
|
||||
var params types.Params
|
||||
cdc.MustUnmarshal(paramsBz, ¶ms)
|
||||
|
||||
// test that the params have been migrated correctly
|
||||
require.Equal(t, "aphoton", params.EvmDenom)
|
||||
require.True(t, params.EnableCreate)
|
||||
require.True(t, params.EnableCall)
|
||||
require.True(t, params.AllowUnprotectedTxs)
|
||||
require.Equal(t, chainConfig, params.ChainConfig)
|
||||
require.Equal(t, extraEIPs.EIPs, params.ExtraEIPs)
|
||||
|
||||
// check that the keys are deleted
|
||||
require.False(t, kvStore.Has(types.ParamStoreKeyEVMDenom))
|
||||
require.False(t, kvStore.Has(types.ParamStoreKeyEnableCreate))
|
||||
require.False(t, kvStore.Has(types.ParamStoreKeyEnableCall))
|
||||
require.False(t, kvStore.Has(types.ParamStoreKeyAllowUnprotectedTxs))
|
||||
require.False(t, kvStore.Has(types.ParamStoreKeyExtraEIPs))
|
||||
require.False(t, kvStore.Has(types.ParamStoreKeyChainConfig))
|
||||
}
|
||||
Generated
+479
@@ -0,0 +1,479 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: ethermint/evm/v1/evm.proto
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
|
||||
// V5ExtraEIPs represents extra EIPs for the vm.Config
|
||||
type V5ExtraEIPs struct {
|
||||
// eips defines the additional EIPs for the vm.Config
|
||||
EIPs []int64 `protobuf:"varint,1,rep,packed,name=eips,proto3" json:"eips,omitempty" yaml:"eips"`
|
||||
}
|
||||
|
||||
func (m *V5ExtraEIPs) Reset() { *m = V5ExtraEIPs{} }
|
||||
func (m *V5ExtraEIPs) String() string { return proto.CompactTextString(m) }
|
||||
func (*V5ExtraEIPs) ProtoMessage() {}
|
||||
func (*V5ExtraEIPs) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_d21ecc92c8c8583e, []int{1}
|
||||
}
|
||||
func (m *V5ExtraEIPs) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *V5ExtraEIPs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_V5ExtraEIPs.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *V5ExtraEIPs) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_V5ExtraEIPs.Merge(m, src)
|
||||
}
|
||||
func (m *V5ExtraEIPs) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *V5ExtraEIPs) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_V5ExtraEIPs.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_V5ExtraEIPs proto.InternalMessageInfo
|
||||
|
||||
func (m *V5ExtraEIPs) GetEIPs() []int64 {
|
||||
if m != nil {
|
||||
return m.EIPs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*V5ExtraEIPs)(nil), "ethermint.evm.v1.V5ExtraEIPs")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("ethermint/evm/v1/evm.proto", fileDescriptor_d21ecc92c8c8583e) }
|
||||
|
||||
var fileDescriptor_d21ecc92c8c8583e = []byte{
|
||||
// 1644 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0x4f, 0x6f, 0xe3, 0xc6,
|
||||
0x15, 0xb7, 0x2d, 0xda, 0xa6, 0x46, 0xb2, 0x44, 0x8f, 0xb5, 0x5e, 0x65, 0x17, 0x35, 0x5d, 0x1e,
|
||||
0x02, 0x17, 0x4d, 0xec, 0xd8, 0x81, 0xd1, 0x45, 0x82, 0x16, 0x5d, 0xed, 0x3a, 0x89, 0xdd, 0x6d,
|
||||
0x6a, 0x8c, 0x1d, 0x14, 0x28, 0x50, 0x10, 0x23, 0x72, 0x42, 0x31, 0x26, 0x39, 0xc2, 0xcc, 0x50,
|
||||
0x2b, 0xb5, 0xfd, 0x00, 0x05, 0x7a, 0xe9, 0x27, 0x28, 0x72, 0xee, 0x27, 0x09, 0x7a, 0xda, 0x63,
|
||||
0xd1, 0x03, 0x51, 0x78, 0x6f, 0x3e, 0xea, 0x13, 0x14, 0xf3, 0x47, 0xd4, 0x1f, 0x1b, 0x6d, 0xad,
|
||||
0x93, 0xe7, 0xf7, 0xde, 0x9b, 0xdf, 0x6f, 0xde, 0x9b, 0x37, 0x9e, 0xa1, 0xc0, 0x33, 0x22, 0x7a,
|
||||
0x84, 0xa5, 0x71, 0x26, 0x8e, 0xc8, 0x20, 0x3d, 0x1a, 0x1c, 0xcb, 0x3f, 0x87, 0x7d, 0x46, 0x05,
|
||||
0x85, 0x4e, 0xe9, 0x3b, 0x94, 0xc6, 0xc1, 0xf1, 0xb3, 0x56, 0x44, 0x23, 0xaa, 0x9c, 0x47, 0x72,
|
||||
0xa4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d7,
|
||||
0x0c, 0x67, 0x1c, 0x07, 0x22, 0xa6, 0xd9, 0x1b, 0x1a, 0x71, 0x08, 0x81, 0xa5, 0x6e, 0x45, 0x3d,
|
||||
0x57, 0x8d, 0xe1, 0x4f, 0x80, 0x95, 0xd0, 0x88, 0xb7, 0xd7, 0xf6, 0x2b, 0x07, 0xb5, 0x93, 0x27,
|
||||
0xf7, 0x5f, 0x6f, 0x6f, 0x68, 0x84, 0x54, 0x88, 0xf7, 0x8f, 0x35, 0x50, 0x79, 0x43, 0x23, 0xd8,
|
||||
0x06, 0x9b, 0x38, 0x0c, 0x19, 0xe1, 0xdc, 0x30, 0x4d, 0x20, 0xdc, 0x05, 0x1b, 0x82, 0xf6, 0xe3,
|
||||
0x40, 0xd3, 0x55, 0x91, 0x41, 0x52, 0x38, 0xc4, 0x02, 0xab, 0x77, 0x45, 0x1d, 0xa9, 0x31, 0x3c,
|
||||
0x01, 0x75, 0x95, 0x99, 0x9f, 0xe5, 0x69, 0x97, 0x30, 0xf5, 0x3c, 0xb0, 0x3a, 0xcd, 0xbb, 0xc2,
|
||||
0xad, 0x29, 0xfb, 0xd7, 0xca, 0x8c, 0x66, 0x01, 0xfc, 0x08, 0x6c, 0x8a, 0xe1, 0xec, 0xcd, 0xbe,
|
||||
0x73, 0x57, 0xb8, 0x4d, 0x31, 0x4d, 0x53, 0x5e, 0xdc, 0x68, 0x43, 0x0c, 0xd5, 0x05, 0x7e, 0x04,
|
||||
0x6c, 0x31, 0xf4, 0xe3, 0x2c, 0x24, 0x43, 0x75, 0x79, 0x5b, 0x9d, 0xd6, 0x5d, 0xe1, 0x3a, 0x33,
|
||||
0xe1, 0xe7, 0xd2, 0x87, 0x36, 0xc5, 0x50, 0x0d, 0xe0, 0x47, 0x00, 0xe8, 0x25, 0x29, 0x05, 0x7d,
|
||||
0xf5, 0x6e, 0xdd, 0x15, 0x6e, 0x55, 0x59, 0x15, 0xf7, 0x74, 0x08, 0x3d, 0xb0, 0xae, 0xb9, 0x6d,
|
||||
0xc5, 0x5d, 0xbf, 0x2b, 0x5c, 0x3b, 0xa1, 0x91, 0xe6, 0xd4, 0x2e, 0x59, 0x2a, 0x46, 0x52, 0x3a,
|
||||
0x20, 0xa1, 0xba, 0xdd, 0x6c, 0x34, 0x81, 0xde, 0x5f, 0xd6, 0x80, 0x7d, 0x3d, 0x44, 0x84, 0xe7,
|
||||
0x89, 0x80, 0x5f, 0x00, 0x27, 0xa0, 0x99, 0x60, 0x38, 0x10, 0xfe, 0x5c, 0x69, 0x3b, 0xcf, 0xa7,
|
||||
0x37, 0xcd, 0x62, 0x84, 0x87, 0x9a, 0x13, 0xd3, 0x4b, 0x53, 0xff, 0x16, 0x58, 0xef, 0x26, 0x94,
|
||||
0xa6, 0xaa, 0x13, 0xea, 0x48, 0x03, 0x88, 0x54, 0xd5, 0xd4, 0x2e, 0x57, 0xd4, 0x1b, 0xfd, 0xc7,
|
||||
0xf7, 0x77, 0x79, 0xa1, 0x55, 0x3a, 0xbb, 0xe6, 0x9d, 0xde, 0xd0, 0xda, 0x66, 0xbe, 0x27, 0x6b,
|
||||
0xab, 0x5a, 0xc9, 0x01, 0x15, 0x46, 0x84, 0xda, 0xb4, 0x3a, 0x92, 0x43, 0xf8, 0x0c, 0xd8, 0x8c,
|
||||
0x0c, 0x08, 0x13, 0x24, 0x54, 0x9b, 0x63, 0xa3, 0x12, 0xc3, 0x0f, 0x80, 0x1d, 0x61, 0xee, 0xe7,
|
||||
0x9c, 0x84, 0x7a, 0x27, 0xd0, 0x66, 0x84, 0xf9, 0x37, 0x9c, 0x84, 0x9f, 0x59, 0x7f, 0xfe, 0xde,
|
||||
0x5d, 0xf1, 0x30, 0xa8, 0xbd, 0x0c, 0x02, 0xc2, 0xf9, 0x75, 0xde, 0x4f, 0xc8, 0x7f, 0xe9, 0xb0,
|
||||
0x13, 0x50, 0xe7, 0x82, 0x32, 0x1c, 0x11, 0xff, 0x86, 0x8c, 0x4c, 0x9f, 0xe9, 0xae, 0x31, 0xf6,
|
||||
0x5f, 0x91, 0x11, 0x47, 0xb3, 0xc0, 0x48, 0x7c, 0x6f, 0x81, 0xda, 0x35, 0xc3, 0x01, 0x31, 0x2f,
|
||||
0x7c, 0xd9, 0xab, 0x12, 0x32, 0x23, 0x61, 0x90, 0xd4, 0x16, 0x71, 0x4a, 0x68, 0x2e, 0xcc, 0x79,
|
||||
0x9a, 0x40, 0x39, 0x83, 0x11, 0x32, 0x24, 0x81, 0x2a, 0xa3, 0x85, 0x0c, 0x82, 0xa7, 0x60, 0x2b,
|
||||
0x8c, 0xb9, 0xfa, 0x12, 0xe3, 0x02, 0x07, 0x37, 0x3a, 0xfd, 0x8e, 0x73, 0x57, 0xb8, 0x75, 0xe3,
|
||||
0xb8, 0x92, 0x76, 0x34, 0x87, 0xe0, 0xe7, 0xa0, 0x39, 0x9d, 0xa6, 0x56, 0xab, 0x3f, 0x6d, 0x3a,
|
||||
0xf0, 0xae, 0x70, 0x1b, 0x65, 0xa8, 0xf2, 0xa0, 0x05, 0x2c, 0x77, 0x3a, 0x24, 0xdd, 0x3c, 0x52,
|
||||
0xcd, 0x67, 0x23, 0x0d, 0xa4, 0x35, 0x89, 0xd3, 0x58, 0xa8, 0x66, 0x5b, 0x47, 0x1a, 0xc0, 0xcf,
|
||||
0x41, 0x95, 0x0e, 0x08, 0x63, 0x71, 0x48, 0xb8, 0x7a, 0xea, 0xfc, 0xaf, 0xaf, 0x34, 0x34, 0x8d,
|
||||
0x97, 0xc9, 0x99, 0xaf, 0xcc, 0x94, 0xa4, 0x94, 0x8d, 0xd4, 0xdb, 0xc5, 0x24, 0xa7, 0x1d, 0xbf,
|
||||
0x56, 0x76, 0x34, 0x87, 0x60, 0x07, 0x40, 0x33, 0x8d, 0x11, 0x91, 0xb3, 0xcc, 0x57, 0xe7, 0xbf,
|
||||
0xae, 0xe6, 0xaa, 0x53, 0xa8, 0xbd, 0x48, 0x39, 0x5f, 0x63, 0x81, 0xd1, 0x3d, 0x0b, 0xfc, 0x05,
|
||||
0x80, 0x7a, 0x4f, 0xfc, 0xef, 0x38, 0x2d, 0x3f, 0x33, 0xf5, 0xd3, 0x42, 0xe9, 0x6b, 0xaf, 0x59,
|
||||
0xb3, 0xa3, 0xd1, 0x05, 0xa7, 0x26, 0x8b, 0x0b, 0xcb, 0xb6, 0x9c, 0xf5, 0x0b, 0xcb, 0xde, 0x74,
|
||||
0xec, 0xb2, 0x7e, 0x26, 0x0b, 0xb4, 0x33, 0xc1, 0x33, 0xcb, 0xeb, 0xfc, 0xf2, 0x87, 0xdb, 0xbd,
|
||||
0xd5, 0x77, 0xb7, 0x7b, 0xab, 0xff, 0xbe, 0xdd, 0x5b, 0xfd, 0xeb, 0xfb, 0xbd, 0x95, 0x77, 0xef,
|
||||
0xf7, 0x56, 0xfe, 0xf9, 0x7e, 0x6f, 0xe5, 0x77, 0xb3, 0xf7, 0x03, 0x19, 0xc8, 0xeb, 0x61, 0xfa,
|
||||
0xd3, 0xc2, 0x50, 0xfd, 0xb8, 0xa0, 0xee, 0x88, 0xee, 0x86, 0xfa, 0xd1, 0xe0, 0xd3, 0xff, 0x04,
|
||||
0x00, 0x00, 0xff, 0xff, 0x68, 0xce, 0x8e, 0x23, 0x7a, 0x10, 0x00, 0x00,
|
||||
}
|
||||
|
||||
|
||||
func (m *V5ExtraEIPs) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *V5ExtraEIPs) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *V5ExtraEIPs) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.EIPs) > 0 {
|
||||
dAtA4 := make([]byte, len(m.EIPs)*10)
|
||||
var j3 int
|
||||
for _, num1 := range m.EIPs {
|
||||
num := uint64(num1)
|
||||
for num >= 1<<7 {
|
||||
dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80)
|
||||
num >>= 7
|
||||
j3++
|
||||
}
|
||||
dAtA4[j3] = uint8(num)
|
||||
j3++
|
||||
}
|
||||
i -= j3
|
||||
copy(dAtA[i:], dAtA4[:j3])
|
||||
i = encodeVarintEvm(dAtA, i, uint64(j3))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
|
||||
func encodeVarintEvm(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovEvm(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return base
|
||||
}
|
||||
|
||||
func (m *V5ExtraEIPs) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.EIPs) > 0 {
|
||||
l = 0
|
||||
for _, e := range m.EIPs {
|
||||
l += sovEvm(uint64(e))
|
||||
}
|
||||
n += 1 + sovEvm(uint64(l)) + l
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
|
||||
func sovEvm(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozEvm(x uint64) (n int) {
|
||||
return sovEvm(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
|
||||
func (m *V5ExtraEIPs) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowEvm
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: V5ExtraEIPs: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: V5ExtraEIPs: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType == 0 {
|
||||
var v int64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowEvm
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
v |= int64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
m.EIPs = append(m.EIPs, v)
|
||||
} else if wireType == 2 {
|
||||
var packedLen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowEvm
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
packedLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if packedLen < 0 {
|
||||
return ErrInvalidLengthEvm
|
||||
}
|
||||
postIndex := iNdEx + packedLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthEvm
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
var elementCount int
|
||||
var count int
|
||||
for _, integer := range dAtA[iNdEx:postIndex] {
|
||||
if integer < 128 {
|
||||
count++
|
||||
}
|
||||
}
|
||||
elementCount = count
|
||||
if elementCount != 0 && len(m.EIPs) == 0 {
|
||||
m.EIPs = make([]int64, 0, elementCount)
|
||||
}
|
||||
for iNdEx < postIndex {
|
||||
var v int64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowEvm
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
v |= int64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
m.EIPs = append(m.EIPs, v)
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field EIPs", wireType)
|
||||
}
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipEvm(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthEvm
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func skipEvm(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
depth := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowEvm
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
wireType := int(wire & 0x7)
|
||||
switch wireType {
|
||||
case 0:
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowEvm
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx++
|
||||
if dAtA[iNdEx-1] < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowEvm
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
length |= (int(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if length < 0 {
|
||||
return 0, ErrInvalidLengthEvm
|
||||
}
|
||||
iNdEx += length
|
||||
case 3:
|
||||
depth++
|
||||
case 4:
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupEvm
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthEvm
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthEvm = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowEvm = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupEvm = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
||||
+33
-5
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package evm
|
||||
|
||||
import (
|
||||
@@ -37,13 +52,14 @@ func (AppModuleBasic) Name() string {
|
||||
return types.ModuleName
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec performs a no-op as the evm module doesn't support amino.
|
||||
func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {
|
||||
// RegisterLegacyAminoCodec registers the module's types with the given codec.
|
||||
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||
types.RegisterLegacyAminoCodec(cdc)
|
||||
}
|
||||
|
||||
// ConsensusVersion returns the consensus state-breaking version for the module.
|
||||
func (AppModuleBasic) ConsensusVersion() uint64 {
|
||||
return 3
|
||||
return 5
|
||||
}
|
||||
|
||||
// DefaultGenesis returns default genesis state as raw bytes for the evm
|
||||
@@ -95,14 +111,17 @@ type AppModule struct {
|
||||
AppModuleBasic
|
||||
keeper *keeper.Keeper
|
||||
ak types.AccountKeeper
|
||||
// legacySubspace is used solely for migration of x/params managed parameters
|
||||
legacySubspace types.Subspace
|
||||
}
|
||||
|
||||
// NewAppModule creates a new AppModule object
|
||||
func NewAppModule(k *keeper.Keeper, ak types.AccountKeeper) AppModule {
|
||||
func NewAppModule(k *keeper.Keeper, ak types.AccountKeeper, ss types.Subspace) AppModule {
|
||||
return AppModule{
|
||||
AppModuleBasic: AppModuleBasic{},
|
||||
keeper: k,
|
||||
ak: ak,
|
||||
legacySubspace: ss,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,6 +140,16 @@ func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {
|
||||
func (am AppModule) RegisterServices(cfg module.Configurator) {
|
||||
types.RegisterMsgServer(cfg.MsgServer(), am.keeper)
|
||||
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
|
||||
|
||||
m := keeper.NewMigrator(*am.keeper, am.legacySubspace)
|
||||
err := cfg.RegisterMigration(types.ModuleName, 3, m.Migrate3to4)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if err := cfg.RegisterMigration(types.ModuleName, 4, m.Migrate4to5); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Route returns the message routing key for the evm module.
|
||||
@@ -152,7 +181,6 @@ func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.V
|
||||
// no validator updates.
|
||||
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate {
|
||||
var genesisState types.GenesisState
|
||||
|
||||
cdc.MustUnmarshalJSON(data, &genesisState)
|
||||
InitGenesis(ctx, am.keeper, am.ak, genesisState)
|
||||
return []abci.ValidatorUpdate{}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
package simulation
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/kv"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
)
|
||||
|
||||
// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's
|
||||
// value to the corresponding EVM type.
|
||||
func NewDecodeStore() func(kvA, kvB kv.Pair) string {
|
||||
return func(kvA, kvB kv.Pair) string {
|
||||
switch {
|
||||
case bytes.Equal(kvA.Key[:1], types.KeyPrefixStorage):
|
||||
storageA := common.BytesToHash(kvA.Value).Hex()
|
||||
storageB := common.BytesToHash(kvB.Value).Hex()
|
||||
|
||||
return fmt.Sprintf("%v\n%v", storageA, storageB)
|
||||
case bytes.Equal(kvA.Key[:1], types.KeyPrefixCode):
|
||||
codeHashA := common.Bytes2Hex(kvA.Value)
|
||||
codeHashB := common.Bytes2Hex(kvB.Value)
|
||||
|
||||
return fmt.Sprintf("%v\n%v", codeHashA, codeHashB)
|
||||
default:
|
||||
panic(fmt.Sprintf("invalid evm key prefix %X", kvA.Key[:1]))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package simulation
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/kv"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
)
|
||||
|
||||
// TestDecodeStore tests that evm simulation decoder decodes the key value pairs as expected.
|
||||
func TestDecodeStore(t *testing.T) {
|
||||
dec := NewDecodeStore()
|
||||
|
||||
hash := common.BytesToHash([]byte("hash"))
|
||||
code := common.Bytes2Hex([]byte{1, 2, 3})
|
||||
|
||||
kvPairs := kv.Pairs{
|
||||
Pairs: []kv.Pair{
|
||||
{Key: types.KeyPrefixCode, Value: common.FromHex(code)},
|
||||
{Key: types.KeyPrefixStorage, Value: hash.Bytes()},
|
||||
},
|
||||
}
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
expectedLog string
|
||||
}{
|
||||
{"Code", fmt.Sprintf("%v\n%v", code, code)},
|
||||
{"Storage", fmt.Sprintf("%v\n%v", hash, hash)},
|
||||
{"other", ""},
|
||||
}
|
||||
for i, tt := range tests {
|
||||
i, tt := i, tt
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
switch i {
|
||||
case len(tests) - 1:
|
||||
require.Panics(t, func() { dec(kvPairs.Pairs[i], kvPairs.Pairs[i]) }, tt.name)
|
||||
default:
|
||||
require.Equal(t, tt.expectedLog, dec(kvPairs.Pairs[i], kvPairs.Pairs[i]), tt.name)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package simulation
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/types/module"
|
||||
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
)
|
||||
|
||||
const (
|
||||
extraEIPsKey = "extra_eips"
|
||||
)
|
||||
|
||||
// GenExtraEIPs defines a set of extra EIPs with 50% probability
|
||||
func GenExtraEIPs(r *rand.Rand) []int64 {
|
||||
var extraEIPs []int64
|
||||
// 50% chance of having extra EIPs
|
||||
if r.Intn(2) == 0 {
|
||||
extraEIPs = []int64{1344, 1884, 2200, 2929, 3198, 3529}
|
||||
}
|
||||
return extraEIPs
|
||||
}
|
||||
|
||||
// GenEnableCreate enables the EnableCreate param with 80% probability
|
||||
func GenEnableCreate(r *rand.Rand) bool {
|
||||
// 80% chance of enabling create contract
|
||||
enableCreate := r.Intn(100) < 80
|
||||
return enableCreate
|
||||
}
|
||||
|
||||
// GenEnableCall enables the EnableCall param with 80% probability
|
||||
func GenEnableCall(r *rand.Rand) bool {
|
||||
// 80% chance of enabling evm account transfer and calling contract
|
||||
enableCall := r.Intn(100) < 80
|
||||
return enableCall
|
||||
}
|
||||
|
||||
// RandomizedGenState generates a random GenesisState for the EVM module
|
||||
func RandomizedGenState(simState *module.SimulationState) {
|
||||
// evm params
|
||||
var extraEIPs []int64
|
||||
|
||||
simState.AppParams.GetOrGenerate(
|
||||
simState.Cdc, extraEIPsKey, &extraEIPs, simState.Rand,
|
||||
func(r *rand.Rand) { extraEIPs = GenExtraEIPs(r) },
|
||||
)
|
||||
|
||||
params := types.NewParams(types.DefaultEVMDenom, true, true, types.DefaultChainConfig(), extraEIPs...)
|
||||
evmGenesis := types.NewGenesisState(params, []types.GenesisAccount{})
|
||||
|
||||
bz, err := json.MarshalIndent(evmGenesis, "", " ")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("Selected randomly generated %s parameters:\n%s\n", types.ModuleName, bz)
|
||||
|
||||
simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(evmGenesis)
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package simulation_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"math/rand"
|
||||
"testing"
|
||||
|
||||
sdkmath "cosmossdk.io/math"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/cerc-io/laconicd/x/evm/simulation"
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/module"
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
)
|
||||
|
||||
// TestRandomizedGenState tests the normal scenario of applying RandomizedGenState.
|
||||
// Abonormal scenarios are not tested here.
|
||||
func TestRandomizedGenState(t *testing.T) {
|
||||
registry := codectypes.NewInterfaceRegistry()
|
||||
types.RegisterInterfaces(registry)
|
||||
cdc := codec.NewProtoCodec(registry)
|
||||
|
||||
s := rand.NewSource(1)
|
||||
r := rand.New(s)
|
||||
|
||||
simState := module.SimulationState{
|
||||
AppParams: make(simtypes.AppParams),
|
||||
Cdc: cdc,
|
||||
Rand: r,
|
||||
NumBonded: 3,
|
||||
Accounts: simtypes.RandomAccounts(r, 3),
|
||||
InitialStake: sdkmath.NewInt(1000),
|
||||
GenState: make(map[string]json.RawMessage),
|
||||
}
|
||||
|
||||
simulation.RandomizedGenState(&simState)
|
||||
|
||||
var evmGenesis types.GenesisState
|
||||
simState.Cdc.MustUnmarshalJSON(simState.GenState[types.ModuleName], &evmGenesis)
|
||||
|
||||
require.Equal(t, true, evmGenesis.Params.GetEnableCreate())
|
||||
require.Equal(t, true, evmGenesis.Params.GetEnableCall())
|
||||
require.Equal(t, types.DefaultEVMDenom, evmGenesis.Params.GetEvmDenom())
|
||||
require.Equal(t, simulation.GenExtraEIPs(r), evmGenesis.Params.GetExtraEIPs())
|
||||
require.Equal(t, types.DefaultChainConfig(), evmGenesis.Params.GetChainConfig())
|
||||
|
||||
require.Equal(t, len(evmGenesis.Accounts), 0)
|
||||
}
|
||||
@@ -1,311 +0,0 @@
|
||||
package simulation
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"math/big"
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
sdkmath "cosmossdk.io/math"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/module"
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
sdktx "github.com/cosmos/cosmos-sdk/types/tx"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/tx"
|
||||
"github.com/cosmos/cosmos-sdk/x/simulation"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
ethtypes "github.com/ethereum/go-ethereum/core/types"
|
||||
|
||||
"github.com/cerc-io/laconicd/encoding"
|
||||
"github.com/cerc-io/laconicd/tests"
|
||||
"github.com/cerc-io/laconicd/x/evm/keeper"
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/signing"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
)
|
||||
|
||||
// #nosec 101
|
||||
const (
|
||||
OpWeightMsgEthSimpleTransfer = "op_weight_msg_eth_simple_transfer"
|
||||
OpWeightMsgEthCreateContract = "op_weight_msg_eth_create_contract"
|
||||
OpWeightMsgEthCallContract = "op_weight_msg_eth_call_contract"
|
||||
)
|
||||
|
||||
const (
|
||||
WeightMsgEthSimpleTransfer = 50
|
||||
WeightMsgEthCreateContract = 50
|
||||
)
|
||||
|
||||
var ErrNoEnoughBalance = fmt.Errorf("no enough balance")
|
||||
|
||||
var maxWaitSeconds = 10
|
||||
|
||||
type simulateContext struct {
|
||||
context sdk.Context
|
||||
bapp *baseapp.BaseApp
|
||||
rand *rand.Rand
|
||||
keeper *keeper.Keeper
|
||||
}
|
||||
|
||||
// WeightedOperations generate Two kinds of operations: SimulateEthSimpleTransfer, SimulateEthCreateContract.
|
||||
// Contract call operations work as the future operations of SimulateEthCreateContract.
|
||||
func WeightedOperations(
|
||||
appParams simtypes.AppParams, cdc codec.JSONCodec, ak types.AccountKeeper, k *keeper.Keeper,
|
||||
) simulation.WeightedOperations {
|
||||
var (
|
||||
weightMsgEthSimpleTransfer int
|
||||
weightMsgEthCreateContract int
|
||||
)
|
||||
|
||||
appParams.GetOrGenerate(cdc, OpWeightMsgEthSimpleTransfer, &weightMsgEthSimpleTransfer, nil,
|
||||
func(_ *rand.Rand) {
|
||||
weightMsgEthSimpleTransfer = WeightMsgEthSimpleTransfer
|
||||
},
|
||||
)
|
||||
|
||||
appParams.GetOrGenerate(cdc, OpWeightMsgEthCreateContract, &weightMsgEthCreateContract, nil,
|
||||
func(_ *rand.Rand) {
|
||||
weightMsgEthCreateContract = WeightMsgEthCreateContract
|
||||
},
|
||||
)
|
||||
|
||||
return simulation.WeightedOperations{
|
||||
simulation.NewWeightedOperation(
|
||||
weightMsgEthSimpleTransfer,
|
||||
SimulateEthSimpleTransfer(ak, k),
|
||||
),
|
||||
simulation.NewWeightedOperation(
|
||||
weightMsgEthCreateContract,
|
||||
SimulateEthCreateContract(ak, k),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
// SimulateEthSimpleTransfer simulate simple eth account transferring gas token.
|
||||
// It randomly choose sender, recipient and transferable amount.
|
||||
// Other tx details like nonce, gasprice, gaslimit are calculated to get valid value.
|
||||
func SimulateEthSimpleTransfer(ak types.AccountKeeper, k *keeper.Keeper) simtypes.Operation {
|
||||
return func(
|
||||
r *rand.Rand, bapp *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string,
|
||||
) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
|
||||
simAccount, _ := simtypes.RandomAcc(r, accs)
|
||||
var recipient simtypes.Account
|
||||
if r.Intn(2) == 1 {
|
||||
recipient, _ = simtypes.RandomAcc(r, accs)
|
||||
} else {
|
||||
recipient = simtypes.RandomAccounts(r, 1)[0]
|
||||
}
|
||||
from := common.BytesToAddress(simAccount.Address)
|
||||
to := common.BytesToAddress(recipient.Address)
|
||||
|
||||
simulateContext := &simulateContext{ctx, bapp, r, k}
|
||||
|
||||
return SimulateEthTx(simulateContext, &from, &to, nil, (*hexutil.Bytes)(&[]byte{}), simAccount.PrivKey, nil)
|
||||
}
|
||||
}
|
||||
|
||||
// SimulateEthCreateContract simulate create an ERC20 contract.
|
||||
// It makes operationSimulateEthCallContract the future operations of SimulateEthCreateContract
|
||||
// to ensure valid contract call.
|
||||
func SimulateEthCreateContract(ak types.AccountKeeper, k *keeper.Keeper) simtypes.Operation {
|
||||
return func(
|
||||
r *rand.Rand, bapp *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string,
|
||||
) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
|
||||
simAccount, _ := simtypes.RandomAcc(r, accs)
|
||||
|
||||
from := common.BytesToAddress(simAccount.Address)
|
||||
nonce := k.GetNonce(ctx, from)
|
||||
|
||||
ctorArgs, err := types.ERC20Contract.ABI.Pack("", from, sdkmath.NewIntWithDecimal(1000, 18).BigInt())
|
||||
if err != nil {
|
||||
return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgEthereumTx, "can not pack owner and supply"), nil, err
|
||||
}
|
||||
data := types.ERC20Contract.Bin
|
||||
data = append(data, ctorArgs...)
|
||||
|
||||
simulateContext := &simulateContext{ctx, bapp, r, k}
|
||||
|
||||
fops := make([]simtypes.FutureOperation, 1)
|
||||
whenCall := ctx.BlockHeader().Time.Add(time.Duration(r.Intn(maxWaitSeconds)+1) * time.Second)
|
||||
contractAddr := crypto.CreateAddress(from, nonce)
|
||||
var tokenReceipient simtypes.Account
|
||||
if r.Intn(2) == 1 {
|
||||
tokenReceipient, _ = simtypes.RandomAcc(r, accs)
|
||||
} else {
|
||||
tokenReceipient = simtypes.RandomAccounts(r, 1)[0]
|
||||
}
|
||||
receipientAddr := common.BytesToAddress(tokenReceipient.Address)
|
||||
fops[0] = simtypes.FutureOperation{
|
||||
BlockTime: whenCall,
|
||||
Op: operationSimulateEthCallContract(k, &contractAddr, &receipientAddr, nil),
|
||||
}
|
||||
return SimulateEthTx(simulateContext, &from, nil, nil, (*hexutil.Bytes)(&data), simAccount.PrivKey, fops)
|
||||
}
|
||||
}
|
||||
|
||||
// operationSimulateEthCallContract simulate calling an contract.
|
||||
// It is always calling an ERC20 contract.
|
||||
func operationSimulateEthCallContract(k *keeper.Keeper, contractAddr, to *common.Address, amount *big.Int) simtypes.Operation {
|
||||
return func(
|
||||
r *rand.Rand, bapp *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string,
|
||||
) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
|
||||
simAccount, _ := simtypes.RandomAcc(r, accs)
|
||||
|
||||
from := common.BytesToAddress(simAccount.Address)
|
||||
|
||||
ctorArgs, err := types.ERC20Contract.ABI.Pack("transfer", to, amount)
|
||||
if err != nil {
|
||||
return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgEthereumTx, "can not pack method and args"), nil, err
|
||||
}
|
||||
data := types.ERC20Contract.Bin
|
||||
data = append(data, ctorArgs...)
|
||||
|
||||
simulateContext := &simulateContext{ctx, bapp, r, k}
|
||||
|
||||
return SimulateEthTx(simulateContext, &from, contractAddr, nil, (*hexutil.Bytes)(&data), simAccount.PrivKey, nil)
|
||||
}
|
||||
}
|
||||
|
||||
// SimulateEthTx creates valid ethereum tx and pack it as cosmos tx, and deliver it.
|
||||
func SimulateEthTx(
|
||||
ctx *simulateContext, from, to *common.Address, amount *big.Int, data *hexutil.Bytes, prv cryptotypes.PrivKey, fops []simtypes.FutureOperation,
|
||||
) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
|
||||
ethTx, err := CreateRandomValidEthTx(ctx, from, nil, nil, data)
|
||||
if err == ErrNoEnoughBalance {
|
||||
return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgEthereumTx, "no enough balance"), nil, nil
|
||||
}
|
||||
if err != nil {
|
||||
return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgEthereumTx, "can not create valid eth tx"), nil, err
|
||||
}
|
||||
|
||||
txConfig := encoding.MakeConfig(module.NewBasicManager()).TxConfig
|
||||
txBuilder := txConfig.NewTxBuilder()
|
||||
signedTx, err := GetSignedTx(ctx, txBuilder, ethTx, prv)
|
||||
if err != nil {
|
||||
return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgEthereumTx, "can not sign ethereum tx"), nil, err
|
||||
}
|
||||
|
||||
_, _, err = ctx.bapp.SimDeliver(txConfig.TxEncoder(), signedTx)
|
||||
if err != nil {
|
||||
return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgEthereumTx, "failed to deliver tx"), nil, err
|
||||
}
|
||||
|
||||
return simtypes.OperationMsg{}, fops, nil
|
||||
}
|
||||
|
||||
// CreateRandomValidEthTx create the ethereum tx with valid random values
|
||||
func CreateRandomValidEthTx(ctx *simulateContext,
|
||||
from,
|
||||
to *common.Address,
|
||||
amount *big.Int,
|
||||
data *hexutil.Bytes,
|
||||
) (ethTx *types.MsgEthereumTx, err error) {
|
||||
gasCap := ctx.rand.Uint64()
|
||||
estimateGas, err := EstimateGas(ctx, from, to, data, gasCap)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// we suppose that gasLimit should be larger than estimateGas to ensure tx validity
|
||||
gasLimit := estimateGas + uint64(ctx.rand.Intn(int(sdktx.MaxGasWanted-estimateGas)))
|
||||
ethChainID := ctx.keeper.ChainID()
|
||||
chainConfig := ctx.keeper.GetParams(ctx.context).ChainConfig.EthereumConfig(ethChainID)
|
||||
gasPrice := ctx.keeper.GetBaseFee(ctx.context, chainConfig)
|
||||
gasFeeCap := new(big.Int).Add(gasPrice, big.NewInt(int64(ctx.rand.Int())))
|
||||
gasTipCap := big.NewInt(int64(ctx.rand.Int()))
|
||||
nonce := ctx.keeper.GetNonce(ctx.context, *from)
|
||||
|
||||
if amount == nil {
|
||||
amount, err = RandomTransferableAmount(ctx, *from, estimateGas, gasFeeCap)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
ethTx = types.NewTx(ethChainID, nonce, to, amount, gasLimit, gasPrice, gasFeeCap, gasTipCap, *data, nil)
|
||||
ethTx.From = from.String()
|
||||
return ethTx, nil
|
||||
}
|
||||
|
||||
// EstimateGas estimates the gas used by quering the keeper.
|
||||
func EstimateGas(ctx *simulateContext, from, to *common.Address, data *hexutil.Bytes, gasCap uint64) (gas uint64, err error) {
|
||||
args, err := json.Marshal(&types.TransactionArgs{To: to, From: from, Data: data})
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
res, err := ctx.keeper.EstimateGas(sdk.WrapSDKContext(ctx.context), &types.EthCallRequest{
|
||||
Args: args,
|
||||
GasCap: gasCap,
|
||||
})
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return res.Gas, nil
|
||||
}
|
||||
|
||||
// RandomTransferableAmount generates a random valid transferable amount.
|
||||
// Transferable amount is between the range [0, spendable), spendable = balance - gasFeeCap * GasLimit.
|
||||
func RandomTransferableAmount(ctx *simulateContext, address common.Address, estimateGas uint64, gasFeeCap *big.Int) (amount *big.Int, err error) {
|
||||
balance := ctx.keeper.GetBalance(ctx.context, address)
|
||||
feeLimit := new(big.Int).Mul(gasFeeCap, big.NewInt(int64(estimateGas)))
|
||||
if (feeLimit.Cmp(balance)) > 0 {
|
||||
return nil, ErrNoEnoughBalance
|
||||
}
|
||||
spendable := new(big.Int).Sub(balance, feeLimit)
|
||||
if spendable.Cmp(big.NewInt(0)) == 0 {
|
||||
amount = new(big.Int).Set(spendable)
|
||||
return amount, nil
|
||||
}
|
||||
simAmount, err := simtypes.RandPositiveInt(ctx.rand, sdkmath.NewIntFromBigInt(spendable))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
amount = simAmount.BigInt()
|
||||
return amount, nil
|
||||
}
|
||||
|
||||
// GetSignedTx sign the ethereum tx and packs it as a signing.Tx .
|
||||
func GetSignedTx(
|
||||
ctx *simulateContext,
|
||||
txBuilder client.TxBuilder,
|
||||
msg *types.MsgEthereumTx,
|
||||
prv cryptotypes.PrivKey,
|
||||
) (signedTx signing.Tx, err error) {
|
||||
builder, ok := txBuilder.(tx.ExtensionOptionsTxBuilder)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("can not initiate ExtensionOptionsTxBuilder")
|
||||
}
|
||||
option, err := codectypes.NewAnyWithValue(&types.ExtensionOptionsEthereumTx{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
builder.SetExtensionOptions(option)
|
||||
|
||||
if err := msg.Sign(ethtypes.LatestSignerForChainID(ctx.keeper.ChainID()), tests.NewSigner(prv)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err = builder.SetMsgs(msg); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
txData, err := types.UnpackTxData(msg.Data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
fees := sdk.NewCoins(sdk.NewCoin(ctx.keeper.GetParams(ctx.context).EvmDenom, sdkmath.NewIntFromBigInt(txData.Fee())))
|
||||
builder.SetFeeAmount(fees)
|
||||
builder.SetGasLimit(msg.GetGas())
|
||||
|
||||
signedTx = builder.GetTx()
|
||||
return signedTx, nil
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package simulation
|
||||
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
amino "github.com/cosmos/cosmos-sdk/codec"
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/simulation"
|
||||
)
|
||||
|
||||
// ParamChanges defines the parameters that can be modified by param change proposals
|
||||
// on the simulation.
|
||||
func ParamChanges(r *rand.Rand) []simtypes.ParamChange {
|
||||
return []simtypes.ParamChange{
|
||||
simulation.NewSimParamChange(types.ModuleName, string(types.ParamStoreKeyExtraEIPs),
|
||||
func(r *rand.Rand) string {
|
||||
extraEIPs := GenExtraEIPs(r)
|
||||
amino := amino.NewLegacyAmino()
|
||||
bz, err := amino.MarshalJSON(extraEIPs)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return string(bz)
|
||||
},
|
||||
),
|
||||
simulation.NewSimParamChange(types.ModuleName, string(types.ParamStoreKeyEnableCreate),
|
||||
func(r *rand.Rand) string {
|
||||
return fmt.Sprintf("%v", GenEnableCreate(r))
|
||||
},
|
||||
),
|
||||
simulation.NewSimParamChange(types.ModuleName, string(types.ParamStoreKeyEnableCall),
|
||||
func(r *rand.Rand) string {
|
||||
return fmt.Sprintf("%v", GenEnableCall(r))
|
||||
},
|
||||
),
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package simulation_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/cerc-io/laconicd/x/evm/simulation"
|
||||
)
|
||||
|
||||
// TestParamChanges tests the paramChanges are generated as expected.
|
||||
func TestParamChanges(t *testing.T) {
|
||||
s := rand.NewSource(1)
|
||||
r := rand.New(s)
|
||||
|
||||
extraEIPs := simulation.GenExtraEIPs(r)
|
||||
bz, err := json.Marshal(extraEIPs)
|
||||
require.NoError(t, err)
|
||||
|
||||
expected := []struct {
|
||||
composedKey string
|
||||
key string
|
||||
simValue string
|
||||
subspace string
|
||||
}{
|
||||
{"evm/EnableExtraEIPs", "EnableExtraEIPs", string(bz), "evm"},
|
||||
{"evm/EnableCreate", "EnableCreate", fmt.Sprintf("%v", simulation.GenEnableCreate(r)), "evm"},
|
||||
{"evm/EnableCall", "EnableCall", fmt.Sprintf("%v", simulation.GenEnableCall(r)), "evm"},
|
||||
}
|
||||
|
||||
paramChanges := simulation.ParamChanges(r)
|
||||
|
||||
require.Len(t, paramChanges, 3)
|
||||
|
||||
for i, p := range paramChanges {
|
||||
require.Equal(t, expected[i].composedKey, p.ComposedKey())
|
||||
require.Equal(t, expected[i].key, p.Key())
|
||||
require.Equal(t, expected[i].simValue, p.SimValue()(r))
|
||||
require.Equal(t, expected[i].subspace, p.Subspace())
|
||||
}
|
||||
}
|
||||
@@ -229,7 +229,7 @@ The `GenesisAccount` type corresponds to an adaptation of the Ethereum `GenesisA
|
||||
|
||||
Its main difference is that the one on Ethermint uses a custom `Storage` type that uses a slice instead of maps for the evm `State` (due to non-determinism), and that it doesn't contain the private key field.
|
||||
|
||||
It is also important to note that since the `auth` module on the Cosmos SDK manages the account state, the `Address` field must correspond to an existing `EthAccount` that is stored in the `auth`'s module `Keeper` (i.e `AccountKeeper`). Addresses use the **[EIP55](https://eips.ethereum.org/EIPS/eip-55)** hex **[format](https://evmos.dev/basics/accounts.html#address-formats-for-clients)** on `genesis.json`.
|
||||
It is also important to note that since the `auth` module on the Cosmos SDK manages the account state, the `Address` field must correspond to an existing `EthAccount` that is stored in the `auth`'s module `Keeper` (i.e `AccountKeeper`). Addresses use the **[EIP55](https://eips.ethereum.org/EIPS/eip-55)** hex **[format](https://docs.evmos.org/users/technical_concepts/accounts.html#address-formats-for-clients)** on `genesis.json`.
|
||||
|
||||
```go
|
||||
type GenesisAccount struct {
|
||||
|
||||
@@ -40,7 +40,7 @@ The error returned by the hooks is translated to a VM error `failed to process n
|
||||
|
||||
## Use Case: Call Native ERC20 Module on Evmos
|
||||
|
||||
Here is an example taken from the Evmos [erc20 module](https://evmos.dev/modules/erc20/) that shows how the `EVMHooks` supports a contract calling a native module to convert ERC-20 Tokens into Cosmos native Coins. Following the steps from above.
|
||||
Here is an example taken from the Evmos [erc20 module](https://docs.evmos.org/modules/erc20/) that shows how the `EVMHooks` supports a contract calling a native module to convert ERC-20 Tokens into Cosmos native Coins. Following the steps from above.
|
||||
|
||||
You can define and emit a `Transfer` log signature in the smart contract like this:
|
||||
|
||||
|
||||
+31
-1
@@ -1,6 +1,27 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package statedb
|
||||
|
||||
import "github.com/ethereum/go-ethereum/common"
|
||||
import (
|
||||
"math/big"
|
||||
|
||||
"github.com/cerc-io/laconicd/x/evm/types"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
)
|
||||
|
||||
// TxConfig encapulates the readonly information of current tx for `StateDB`.
|
||||
type TxConfig struct {
|
||||
@@ -30,3 +51,12 @@ func NewEmptyTxConfig(bhash common.Hash) TxConfig {
|
||||
LogIndex: 0,
|
||||
}
|
||||
}
|
||||
|
||||
// EVMConfig encapsulates common parameters needed to create an EVM to execute a message
|
||||
// It's mainly to reduce the number of method parameters
|
||||
type EVMConfig struct {
|
||||
Params types.Params
|
||||
ChainConfig *params.ChainConfig
|
||||
CoinBase common.Address
|
||||
BaseFee *big.Int
|
||||
}
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package statedb
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package statedb
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package statedb
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
+46
-6
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
@@ -11,18 +26,38 @@ import (
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
)
|
||||
|
||||
var ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
|
||||
var (
|
||||
amino = codec.NewLegacyAmino()
|
||||
// ModuleCdc references the global evm module codec. Note, the codec should
|
||||
// ONLY be used in certain instances of tests and for JSON encoding.
|
||||
ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
|
||||
|
||||
// AminoCdc is a amino codec created to support amino JSON compatible msgs.
|
||||
AminoCdc = codec.NewAminoCodec(amino)
|
||||
)
|
||||
|
||||
const (
|
||||
// Amino names
|
||||
updateParamsName = "ethermint/MsgUpdateParams"
|
||||
)
|
||||
|
||||
// NOTE: This is required for the GetSignBytes function
|
||||
func init() {
|
||||
RegisterLegacyAminoCodec(amino)
|
||||
amino.Seal()
|
||||
}
|
||||
|
||||
// RegisterInterfaces registers the client interfaces to protobuf Any.
|
||||
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
|
||||
registry.RegisterImplementations(
|
||||
(*sdk.Msg)(nil),
|
||||
&MsgEthereumTx{},
|
||||
)
|
||||
registry.RegisterImplementations(
|
||||
(*tx.TxExtensionOptionI)(nil),
|
||||
&ExtensionOptionsEthereumTx{},
|
||||
)
|
||||
registry.RegisterImplementations(
|
||||
(*sdk.Msg)(nil),
|
||||
&MsgEthereumTx{},
|
||||
&MsgUpdateParams{},
|
||||
)
|
||||
registry.RegisterInterface(
|
||||
"ethermint.evm.v1.TxData",
|
||||
(*TxData)(nil),
|
||||
@@ -34,7 +69,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
|
||||
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
||||
}
|
||||
|
||||
// PackClientState constructs a new Any packed with the given tx data value. It returns
|
||||
// PackTxData constructs a new Any packed with the given tx data value. It returns
|
||||
// an error if the client state can't be casted to a protobuf message or if the concrete
|
||||
// implementation is not registered to the protobuf codec.
|
||||
func PackTxData(txData TxData) (*codectypes.Any, error) {
|
||||
@@ -65,3 +100,8 @@ func UnpackTxData(any *codectypes.Any) (TxData, error) {
|
||||
|
||||
return txData, nil
|
||||
}
|
||||
|
||||
// RegisterLegacyAminoCodec required for EIP-712
|
||||
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||
cdc.RegisterConcrete(&MsgUpdateParams{}, updateParamsName, nil)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
)
|
||||
|
||||
// EVMConfig encapsulates common parameters needed to create an EVM to execute a message
|
||||
// It's mainly to reduce the number of method parameters
|
||||
type EVMConfig struct {
|
||||
Params Params
|
||||
ChainConfig *params.ChainConfig
|
||||
CoinBase common.Address
|
||||
BaseFee *big.Int
|
||||
}
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
// Evm module events
|
||||
|
||||
Generated
+1265
File diff suppressed because it is too large
Load Diff
Generated
+100
-100
@@ -689,108 +689,108 @@ func init() {
|
||||
func init() { proto.RegisterFile("ethermint/evm/v1/evm.proto", fileDescriptor_d21ecc92c8c8583e) }
|
||||
|
||||
var fileDescriptor_d21ecc92c8c8583e = []byte{
|
||||
// 1614 bytes of a gzipped FileDescriptorProto
|
||||
// 1608 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0xdd, 0x6e, 0xe3, 0xc6,
|
||||
0x15, 0xb6, 0x2d, 0xda, 0xa6, 0x46, 0xb2, 0x44, 0x8f, 0xb5, 0x8e, 0xb2, 0x8b, 0x9a, 0x2e, 0x2f,
|
||||
0x5a, 0x17, 0xc8, 0x5a, 0xb1, 0x03, 0xa3, 0x8b, 0x04, 0x2d, 0x60, 0xed, 0x3a, 0x89, 0xdd, 0x6d,
|
||||
0x6a, 0x8c, 0x1d, 0x14, 0x28, 0x50, 0x10, 0x23, 0x72, 0x42, 0x31, 0x26, 0x39, 0xc2, 0xcc, 0x50,
|
||||
0x2b, 0xb5, 0x7d, 0x80, 0x16, 0xbd, 0xe9, 0x13, 0x14, 0x79, 0x9c, 0xa0, 0x57, 0xb9, 0x2c, 0x7a,
|
||||
0x41, 0x14, 0xde, 0x3b, 0x5f, 0xfa, 0x09, 0x8a, 0xf9, 0x11, 0xf5, 0x63, 0xa3, 0xad, 0x75, 0xe5,
|
||||
0xf9, 0xce, 0x39, 0xf3, 0x7d, 0x33, 0x67, 0xce, 0x68, 0x0e, 0x0d, 0x9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, 0x09, 0xb4, 0x02, 0x9a, 0x71, 0x21, 0x6d, 0x19, 0x1d, 0x24, 0xc4, 0x68,
|
||||
0x56, 0x95, 0xe6, 0xf9, 0x93, 0x34, 0x5f, 0x98, 0x5f, 0x83, 0x47, 0xf8, 0x3c, 0xb4, 0x33, 0x6f,
|
||||
0xd6, 0xea, 0x03, 0xe0, 0x0c, 0x88, 0x20, 0x8c, 0xf7, 0x72, 0x16, 0x19, 0x65, 0xa0, 0x94, 0xcf,
|
||||
0x9e, 0xa4, 0x6c, 0xee, 0xc1, 0x22, 0x97, 0x87, 0x9a, 0x53, 0x93, 0x56, 0xfc, 0x16, 0x34, 0x62,
|
||||
0xb9, 0x8c, 0x5e, 0x9e, 0x18, 0xbd, 0x9a, 0xd2, 0x7b, 0xfd, 0x24, 0x3d, 0x73, 0x99, 0xe7, 0x99,
|
||||
0x3c, 0xb4, 0x35, 0x31, 0x68, 0xad, 0x1c, 0xc0, 0x34, 0x8f, 0x99, 0x1f, 0x25, 0x38, 0x88, 0x09,
|
||||
0x33, 0x7a, 0x75, 0xa5, 0xf7, 0xc5, 0x93, 0xf4, 0x3e, 0xd4, 0x7a, 0x0f, 0xd9, 0x3c, 0xe4, 0x48,
|
||||
0xe3, 0x17, 0xda, 0xa6, 0x65, 0x43, 0x50, 0xef, 0x11, 0x96, 0xc4, 0x99, 0x11, 0xdc, 0x52, 0x82,
|
||||
0xa7, 0x4f, 0x12, 0x34, 0x75, 0x3a, 0xcb, 0xe3, 0xa1, 0x9a, 0x86, 0xa5, 0x4a, 0x42, 0xb3, 0x90,
|
||||
0x4e, 0x54, 0xb6, 0x97, 0x57, 0x99, 0xe5, 0xf1, 0x50, 0x4d, 0x43, 0xad, 0x32, 0x02, 0x3b, 0x98,
|
||||
0x31, 0xfa, 0x6e, 0x21, 0x87, 0x50, 0x89, 0x7d, 0xf9, 0x24, 0xb1, 0xe7, 0x5a, 0xec, 0x11, 0x3a,
|
||||
0x0f, 0x6d, 0x2b, 0xeb, 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||
0x2c, 0x30, 0x12, 0xdf, 0x59, 0xa0, 0x76, 0xcd, 0x70, 0x40, 0x4c, 0x87, 0x2f, 0x6b, 0x55, 0x42,
|
||||
0x66, 0x24, 0x0c, 0x92, 0xda, 0x22, 0x4e, 0x09, 0xcd, 0x85, 0xb9, 0x4f, 0x13, 0x28, 0x67, 0x30,
|
||||
0x42, 0x46, 0x24, 0x50, 0x69, 0xb4, 0x90, 0x41, 0xf0, 0x04, 0x6c, 0x85, 0x31, 0x57, 0x9f, 0x4b,
|
||||
0x5c, 0xe0, 0xe0, 0x46, 0x6f, 0xbf, 0xeb, 0xdc, 0x15, 0x6e, 0xdd, 0x38, 0xae, 0xa4, 0x1d, 0xcd,
|
||||
0x21, 0xf8, 0x19, 0x68, 0x4e, 0xa7, 0xa9, 0xd5, 0xea, 0x0f, 0x94, 0x2e, 0xbc, 0x2b, 0xdc, 0x46,
|
||||
0x19, 0xaa, 0x3c, 0x68, 0x01, 0xcb, 0x93, 0x0e, 0x49, 0x2f, 0x8f, 0x54, 0xf1, 0xd9, 0x48, 0x03,
|
||||
0x69, 0x4d, 0xe2, 0x34, 0x16, 0xaa, 0xd8, 0xd6, 0x91, 0x06, 0xf0, 0x33, 0x50, 0xa5, 0x43, 0xc2,
|
||||
0x58, 0x1c, 0x12, 0xae, 0x5a, 0x9d, 0xff, 0xf5, 0xad, 0x85, 0xa6, 0xf1, 0x72, 0x73, 0xe6, 0x53,
|
||||
0x30, 0x25, 0x29, 0x65, 0x63, 0xd5, 0xbb, 0x98, 0xcd, 0x69, 0xc7, 0xaf, 0x95, 0x1d, 0xcd, 0x21,
|
||||
0xd8, 0x05, 0xd0, 0x4c, 0x63, 0x44, 0xe4, 0x2c, 0xf3, 0xd5, 0xfd, 0xaf, 0xab, 0xb9, 0xea, 0x16,
|
||||
0x6a, 0x2f, 0x52, 0xce, 0x37, 0x58, 0x60, 0xf4, 0xc0, 0x02, 0x7f, 0x09, 0xa0, 0x3e, 0x13, 0xff,
|
||||
0x5b, 0x4e, 0xcb, 0x8f, 0x45, 0xdd, 0x5a, 0x28, 0x7d, 0xed, 0x35, 0x6b, 0x76, 0x34, 0xba, 0xe0,
|
||||
0xd4, 0xec, 0xe2, 0xc2, 0xb2, 0x2d, 0x67, 0xfd, 0xc2, 0xb2, 0x37, 0x1d, 0xbb, 0xcc, 0x9f, 0xd9,
|
||||
0x05, 0xda, 0x99, 0xe0, 0x99, 0xe5, 0x75, 0x4f, 0xbf, 0xbf, 0xdd, 0x5b, 0xfd, 0xe1, 0x76, 0x6f,
|
||||
0xf5, 0xdf, 0xb7, 0x7b, 0xab, 0x7f, 0x7b, 0xbf, 0xb7, 0xf2, 0xc3, 0xfb, 0xbd, 0x95, 0x7f, 0xbe,
|
||||
0xdf, 0x5b, 0xf9, 0xdd, 0x4f, 0x67, 0xdf, 0x07, 0xc2, 0x82, 0x97, 0x31, 0xed, 0x24, 0x38, 0xa0,
|
||||
0x59, 0x1c, 0x84, 0x9d, 0x91, 0xfa, 0x17, 0x80, 0x7a, 0x24, 0x7a, 0x1b, 0xea, 0xd3, 0xfe, 0x93,
|
||||
0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x56, 0x5d, 0x52, 0xcc, 0x20, 0x10, 0x00, 0x00,
|
||||
0x0a, 0x17, 0x48, 0xec, 0xd8, 0x81, 0xd1, 0x45, 0x82, 0x16, 0xb5, 0x76, 0x9d, 0xc4, 0xee, 0x36,
|
||||
0x35, 0xc6, 0x0e, 0x0a, 0x14, 0x28, 0x88, 0x11, 0x39, 0xa1, 0x18, 0x93, 0x1c, 0x61, 0x66, 0xa8,
|
||||
0x95, 0xda, 0x3e, 0x40, 0x8b, 0xde, 0xf4, 0x09, 0x8a, 0x3c, 0x4e, 0xd0, 0xab, 0xbd, 0x2c, 0x7a,
|
||||
0x41, 0x14, 0xde, 0x3b, 0x5f, 0xea, 0x09, 0x8a, 0xf9, 0x11, 0xf5, 0x63, 0xa3, 0xad, 0x75, 0xe5,
|
||||
0xf9, 0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x07, 0x38, 0xc9, 0x75, 0x07, 0x58, 0x45, 0x1a, 0x78, 0x57, 0xa0, 0x79, 0xc3, 0x70, 0xc6, 0x71,
|
||||
0x20, 0x62, 0x9a, 0xbd, 0xa1, 0x11, 0x87, 0x10, 0x58, 0xea, 0x55, 0xd4, 0x73, 0xd5, 0x18, 0xfe,
|
||||
0x14, 0x58, 0x09, 0x8d, 0x78, 0x7b, 0x6d, 0xbf, 0x72, 0x50, 0x3b, 0x79, 0xf6, 0xb0, 0x07, 0x7b,
|
||||
0x43, 0x23, 0xa4, 0x42, 0xbc, 0x7f, 0xac, 0x81, 0xca, 0x1b, 0x1a, 0xc1, 0x36, 0xd8, 0xc4, 0x61,
|
||||
0xc8, 0x08, 0xe7, 0x86, 0x69, 0x02, 0xe1, 0x2e, 0xd8, 0x10, 0xb4, 0x1f, 0x07, 0x9a, 0xae, 0x8a,
|
||||
0x0c, 0x92, 0xc2, 0x21, 0x16, 0x58, 0xf5, 0x15, 0x75, 0xa4, 0xc6, 0xf0, 0x04, 0xd4, 0xd5, 0xce,
|
||||
0xfc, 0x2c, 0x4f, 0xbb, 0x84, 0xa9, 0xf6, 0xc0, 0xea, 0x34, 0xef, 0x0b, 0xb7, 0xa6, 0xec, 0x5f,
|
||||
0x2b, 0x33, 0x9a, 0x05, 0xf0, 0x23, 0xb0, 0x29, 0x86, 0xb3, 0x2f, 0xfb, 0xce, 0x7d, 0xe1, 0x36,
|
||||
0xc5, 0x74, 0x9b, 0xf2, 0xe1, 0x46, 0x1b, 0x62, 0xa8, 0x1e, 0xf0, 0x23, 0x60, 0x8b, 0xa1, 0x1f,
|
||||
0x67, 0x21, 0x19, 0xaa, 0xc7, 0xdb, 0xea, 0xb4, 0xee, 0x0b, 0xd7, 0x99, 0x09, 0xbf, 0x90, 0x3e,
|
||||
0xb4, 0x29, 0x86, 0x6a, 0x00, 0x3f, 0x02, 0x40, 0x2f, 0x49, 0x29, 0xe8, 0xa7, 0x77, 0xeb, 0xbe,
|
||||
0x70, 0xab, 0xca, 0xaa, 0xb8, 0xa7, 0x43, 0xe8, 0x81, 0x75, 0xcd, 0x6d, 0x2b, 0xee, 0xfa, 0x7d,
|
||||
0xe1, 0xda, 0x09, 0x8d, 0x34, 0xa7, 0x76, 0xc9, 0x54, 0x31, 0x92, 0xd2, 0x01, 0x09, 0xd5, 0xeb,
|
||||
0x66, 0xa3, 0x09, 0xf4, 0xfe, 0xba, 0x06, 0xec, 0x9b, 0x21, 0x22, 0x3c, 0x4f, 0x04, 0xfc, 0x02,
|
||||
0x38, 0x01, 0xcd, 0x04, 0xc3, 0x81, 0xf0, 0xe7, 0x52, 0xdb, 0x79, 0x31, 0x7d, 0x69, 0x16, 0x23,
|
||||
0x3c, 0xd4, 0x9c, 0x98, 0xce, 0x4c, 0xfe, 0x5b, 0x60, 0xbd, 0x9b, 0x50, 0x9a, 0xaa, 0x4a, 0xa8,
|
||||
0x23, 0x0d, 0x20, 0x52, 0x59, 0x53, 0xa7, 0x5c, 0x51, 0x9d, 0xf6, 0x8f, 0x1f, 0x9e, 0xf2, 0x42,
|
||||
0xa9, 0x74, 0x76, 0x4d, 0xb7, 0xdd, 0xd0, 0xda, 0x66, 0xbe, 0x27, 0x73, 0xab, 0x4a, 0xc9, 0x01,
|
||||
0x15, 0x46, 0x84, 0x3a, 0xb4, 0x3a, 0x92, 0x43, 0xf8, 0x1c, 0xd8, 0x8c, 0x0c, 0x08, 0x13, 0x24,
|
||||
0x54, 0x87, 0x63, 0xa3, 0x12, 0xc3, 0x0f, 0x81, 0x1d, 0x61, 0xee, 0xe7, 0x9c, 0x84, 0xfa, 0x24,
|
||||
0xd0, 0x66, 0x84, 0xf9, 0x37, 0x9c, 0x84, 0x9f, 0x59, 0x7f, 0xfe, 0xde, 0x5d, 0xf1, 0x30, 0xa8,
|
||||
0x9d, 0x05, 0x01, 0xe1, 0xfc, 0x26, 0xef, 0x27, 0xe4, 0xbf, 0x54, 0xd8, 0x09, 0xa8, 0x73, 0x41,
|
||||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0x2d,
|
||||
0xd4, 0x5e, 0xa4, 0x9c, 0xaf, 0xb1, 0xc0, 0xe8, 0x81, 0x05, 0xfe, 0x02, 0x40, 0x7d, 0x26, 0xfe,
|
||||
0x77, 0x9c, 0x96, 0x1f, 0x8b, 0xba, 0xb5, 0x50, 0xfa, 0xda, 0x6b, 0xd6, 0xec, 0x68, 0x74, 0xc9,
|
||||
0xa9, 0xd9, 0xc5, 0xa5, 0x65, 0x5b, 0xce, 0xfa, 0xa5, 0x65, 0x6f, 0x3a, 0x76, 0x99, 0x3f, 0xb3,
|
||||
0x0b, 0xb4, 0x33, 0xc1, 0x33, 0xcb, 0xeb, 0xfc, 0xf2, 0x87, 0xbb, 0xbd, 0xd5, 0x77, 0x77, 0x7b,
|
||||
0xab, 0xff, 0xbe, 0xdb, 0x5b, 0xfd, 0xdb, 0xfb, 0xbd, 0x95, 0x77, 0xef, 0xf7, 0x56, 0xfe, 0xf9,
|
||||
0x7e, 0x6f, 0xe5, 0x77, 0xb3, 0xef, 0x03, 0x19, 0xc8, 0xe7, 0x61, 0xfa, 0xfd, 0x3f, 0x54, 0xff,
|
||||
0x01, 0x50, 0x6f, 0x44, 0x77, 0x43, 0x7d, 0xd9, 0x7f, 0xfa, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff,
|
||||
0xe2, 0xe1, 0x18, 0x7a, 0x1f, 0x10, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Params) Marshal() (dAtA []byte, err error) {
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
Generated
+20
-21
@@ -152,27 +152,26 @@ func init() {
|
||||
func init() { proto.RegisterFile("ethermint/evm/v1/genesis.proto", fileDescriptor_9bcdec50cc9d156d) }
|
||||
|
||||
var fileDescriptor_9bcdec50cc9d156d = []byte{
|
||||
// 306 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x50, 0xbd, 0x4e, 0xeb, 0x30,
|
||||
0x14, 0x8e, 0x6f, 0xab, 0xf6, 0xd6, 0x45, 0x80, 0x2c, 0x24, 0xa2, 0x0e, 0x6e, 0xd5, 0x85, 0x2e,
|
||||
0xd8, 0x6a, 0x91, 0xd8, 0x9b, 0x85, 0x15, 0xa5, 0x1b, 0x9b, 0xeb, 0x1c, 0xa5, 0x91, 0x48, 0x5c,
|
||||
0xd9, 0x6e, 0x04, 0x2b, 0x23, 0x13, 0xcf, 0xc1, 0x93, 0x74, 0xec, 0xc8, 0x04, 0xa8, 0x79, 0x11,
|
||||
0x14, 0x27, 0xad, 0x04, 0xd9, 0x3e, 0xfb, 0xfb, 0x3b, 0xe7, 0x60, 0x0a, 0x76, 0x05, 0x3a, 0x4d,
|
||||
0x32, 0xcb, 0x21, 0x4f, 0x79, 0x3e, 0xe5, 0x31, 0x64, 0x60, 0x12, 0xc3, 0xd6, 0x5a, 0x59, 0x45,
|
||||
0xce, 0x8f, 0x3c, 0x83, 0x3c, 0x65, 0xf9, 0x74, 0x30, 0x68, 0x38, 0x4a, 0xc2, 0xa9, 0x07, 0x17,
|
||||
0xb1, 0x8a, 0x95, 0x83, 0xbc, 0x44, 0xd5, 0xef, 0xf8, 0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 0x00, 0x00, 0xff, 0xff, 0x40, 0x85, 0xb0, 0xbb, 0xc1, 0x01,
|
||||
0x00, 0x00,
|
||||
// 297 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x50, 0xbf, 0x4e, 0x83, 0x40,
|
||||
0x1c, 0xe6, 0x6c, 0x53, 0xec, 0xd5, 0xa8, 0xb9, 0x98, 0x48, 0x18, 0xae, 0xa4, 0x83, 0x61, 0x3a,
|
||||
0xd2, 0x9a, 0x38, 0x2b, 0x8b, 0xab, 0xa1, 0x9b, 0xdb, 0x15, 0x7e, 0xa1, 0x0c, 0x70, 0x84, 0xbb,
|
||||
0x12, 0x5d, 0x1d, 0x9d, 0x7c, 0x0e, 0x9f, 0xa4, 0x63, 0x47, 0x27, 0x35, 0xf0, 0x22, 0x86, 0x83,
|
||||
0xd6, 0x28, 0xdb, 0x07, 0xdf, 0xbf, 0xdf, 0x7d, 0x98, 0x82, 0x5a, 0x43, 0x91, 0x26, 0x99, 0xf2,
|
||||
0xa0, 0x4c, 0xbd, 0x72, 0xee, 0xc5, 0x90, 0x81, 0x4c, 0x24, 0xcb, 0x0b, 0xa1, 0x04, 0x39, 0x3f,
|
||||
0xf0, 0x0c, 0xca, 0x94, 0x95, 0x73, 0xdb, 0xee, 0x39, 0x1a, 0x42, 0xab, 0xed, 0x8b, 0x58, 0xc4,
|
||||
0x42, 0x43, 0xaf, 0x41, 0xed, 0xdf, 0xd9, 0x2b, 0xc2, 0x27, 0xf7, 0x6d, 0xea, 0x52, 0x71, 0x05,
|
||||
0xc4, 0xc7, 0xc7, 0x3c, 0x0c, 0xc5, 0x26, 0x53, 0xd2, 0x42, 0xce, 0xc0, 0x9d, 0x2c, 0x1c, 0xf6,
|
||||
0xbf, 0x87, 0x75, 0x8e, 0xbb, 0x56, 0xe8, 0x0f, 0xb7, 0x9f, 0x53, 0x23, 0x38, 0xf8, 0xc8, 0x0d,
|
||||
0x1e, 0xe5, 0xbc, 0xe0, 0xa9, 0xb4, 0x8e, 0x1c, 0xe4, 0x4e, 0x16, 0x56, 0x3f, 0xe1, 0x41, 0xf3,
|
||||
0x9d, 0xb3, 0x53, 0xcf, 0x5e, 0x10, 0x3e, 0xfd, 0x1b, 0x4d, 0x2c, 0x6c, 0xf2, 0x28, 0x2a, 0x40,
|
||||
0x36, 0xd7, 0x20, 0x77, 0x1c, 0xec, 0x3f, 0x09, 0xc1, 0xc3, 0x50, 0x44, 0xa0, 0x2b, 0xc6, 0x81,
|
||||
0xc6, 0xc4, 0xc7, 0xa6, 0x54, 0xa2, 0xe0, 0x31, 0x58, 0x03, 0x7d, 0xfb, 0x65, 0xbf, 0x59, 0x3f,
|
||||
0xd3, 0x3f, 0x6b, 0x8a, 0xdf, 0xbf, 0xa6, 0xe6, 0xb2, 0xd5, 0x07, 0x7b, 0xa3, 0x7f, 0xbb, 0xad,
|
||||
0x28, 0xda, 0x55, 0x14, 0x7d, 0x57, 0x14, 0xbd, 0xd5, 0xd4, 0xd8, 0xd5, 0xd4, 0xf8, 0xa8, 0xa9,
|
||||
0xf1, 0x78, 0x15, 0x27, 0x6a, 0xbd, 0x59, 0xb1, 0x50, 0xa4, 0xcd, 0xae, 0x42, 0x7a, 0xbf, 0x73,
|
||||
0x3f, 0xe9, 0xc1, 0xd5, 0x73, 0x0e, 0x72, 0x35, 0xd2, 0xd3, 0x5e, 0xff, 0x04, 0x00, 0x00, 0xff,
|
||||
0xff, 0xe3, 0x61, 0xf0, 0x9f, 0xc0, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
|
||||
|
||||
@@ -1,8 +1,25 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
@@ -55,3 +72,12 @@ type EvmHooks interface {
|
||||
// Must be called after tx is processed successfully, if return an error, the whole transaction is reverted.
|
||||
PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error
|
||||
}
|
||||
|
||||
type (
|
||||
LegacyParams = paramtypes.ParamSet
|
||||
// Subspace defines an interface that implements the legacy Cosmos SDK x/params Subspace type.
|
||||
// NOTE: This is used solely for migration of the Cosmos SDK x/params managed parameters.
|
||||
Subspace interface {
|
||||
GetParamSetIfExists(ctx sdk.Context, ps LegacyParams)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
@@ -25,6 +40,7 @@ const (
|
||||
const (
|
||||
prefixCode = iota + 1
|
||||
prefixStorage
|
||||
prefixParams
|
||||
)
|
||||
|
||||
// prefix bytes for the EVM transient store
|
||||
@@ -39,6 +55,7 @@ const (
|
||||
var (
|
||||
KeyPrefixCode = []byte{prefixCode}
|
||||
KeyPrefixStorage = []byte{prefixStorage}
|
||||
KeyPrefixParams = []byte{prefixParams}
|
||||
)
|
||||
|
||||
// Transient Store key prefixes
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
@@ -28,6 +43,7 @@ var (
|
||||
_ sdk.Msg = &MsgEthereumTx{}
|
||||
_ sdk.Tx = &MsgEthereumTx{}
|
||||
_ ante.GasTx = &MsgEthereumTx{}
|
||||
_ sdk.Msg = &MsgUpdateParams{}
|
||||
|
||||
_ codectypes.UnpackInterfacesMessage = MsgEthereumTx{}
|
||||
)
|
||||
@@ -374,3 +390,24 @@ func (msg *MsgEthereumTx) BuildTx(b client.TxBuilder, evmDenom string) (signing.
|
||||
tx := builder.GetTx()
|
||||
return tx, nil
|
||||
}
|
||||
|
||||
// GetSigners returns the expected signers for a MsgUpdateParams message.
|
||||
func (m MsgUpdateParams) GetSigners() []sdk.AccAddress {
|
||||
//#nosec G703 -- gosec raises a warning about a non-handled error which we deliberately ignore here
|
||||
addr, _ := sdk.AccAddressFromBech32(m.Authority)
|
||||
return []sdk.AccAddress{addr}
|
||||
}
|
||||
|
||||
// ValidateBasic does a sanity check of the provided data
|
||||
func (m *MsgUpdateParams) ValidateBasic() error {
|
||||
if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil {
|
||||
return errortypes.Wrap(err, "invalid authority address")
|
||||
}
|
||||
|
||||
return m.Params.Validate()
|
||||
}
|
||||
|
||||
// GetSignBytes implements the LegacyMsg interface.
|
||||
func (m MsgUpdateParams) GetSignBytes() []byte {
|
||||
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&m))
|
||||
}
|
||||
|
||||
+49
-49
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
@@ -8,51 +23,36 @@ import (
|
||||
|
||||
"github.com/cerc-io/laconicd/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
)
|
||||
|
||||
var _ paramtypes.ParamSet = &Params{}
|
||||
|
||||
var (
|
||||
// DefaultEVMDenom defines the default EVM denomination on Ethermint
|
||||
DefaultEVMDenom = types.AttoPhoton
|
||||
// DefaultMinGasMultiplier is 0.5 or 50%
|
||||
DefaultMinGasMultiplier = sdk.NewDecWithPrec(50, 2)
|
||||
// DefaultAllowUnprotectedTxs rejects all unprotected txs (i.e false)
|
||||
DefaultAllowUnprotectedTxs = false
|
||||
// DefaultEnableCreate enables contract creation (i.e true)
|
||||
DefaultEnableCreate = true
|
||||
// DefaultEnableCall enables contract calls (i.e true)
|
||||
DefaultEnableCall = true
|
||||
)
|
||||
|
||||
// Parameter keys
|
||||
var (
|
||||
ParamStoreKeyEVMDenom = []byte("EVMDenom")
|
||||
ParamStoreKeyEnableCreate = []byte("EnableCreate")
|
||||
ParamStoreKeyEnableCall = []byte("EnableCall")
|
||||
ParamStoreKeyExtraEIPs = []byte("EnableExtraEIPs")
|
||||
ParamStoreKeyChainConfig = []byte("ChainConfig")
|
||||
ParamStoreKeyAllowUnprotectedTxs = []byte("AllowUnprotectedTxs")
|
||||
|
||||
// AvailableExtraEIPs define the list of all EIPs that can be enabled by the
|
||||
// EVM interpreter. These EIPs are applied in order and can override the
|
||||
// instruction sets from the latest hard fork enabled by the ChainConfig. For
|
||||
// more info check:
|
||||
// https://github.com/ethereum/go-ethereum/blob/master/core/vm/interpreter.go#L97
|
||||
AvailableExtraEIPs = []int64{1344, 1884, 2200, 2929, 3198, 3529}
|
||||
)
|
||||
|
||||
// ParamKeyTable returns the parameter key table.
|
||||
func ParamKeyTable() paramtypes.KeyTable {
|
||||
return paramtypes.NewKeyTable().RegisterParamSet(&Params{})
|
||||
}
|
||||
// AvailableExtraEIPs define the list of all EIPs that can be enabled by the
|
||||
// EVM interpreter. These EIPs are applied in order and can override the
|
||||
// instruction sets from the latest hard fork enabled by the ChainConfig. For
|
||||
// more info check:
|
||||
// https://github.com/ethereum/go-ethereum/blob/master/core/vm/interpreter.go#L97
|
||||
var AvailableExtraEIPs = []int64{1344, 1884, 2200, 2929, 3198, 3529}
|
||||
|
||||
// NewParams creates a new Params instance
|
||||
func NewParams(evmDenom string, enableCreate, enableCall bool, config ChainConfig, extraEIPs ...int64) Params {
|
||||
func NewParams(evmDenom string, allowUnprotectedTxs, enableCreate, enableCall bool, config ChainConfig, extraEIPs []int64) Params {
|
||||
return Params{
|
||||
EvmDenom: evmDenom,
|
||||
EnableCreate: enableCreate,
|
||||
EnableCall: enableCall,
|
||||
ExtraEIPs: extraEIPs,
|
||||
ChainConfig: config,
|
||||
EvmDenom: evmDenom,
|
||||
AllowUnprotectedTxs: allowUnprotectedTxs,
|
||||
EnableCreate: enableCreate,
|
||||
EnableCall: enableCall,
|
||||
ExtraEIPs: extraEIPs,
|
||||
ChainConfig: config,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,29 +61,17 @@ func NewParams(evmDenom string, enableCreate, enableCall bool, config ChainConfi
|
||||
func DefaultParams() Params {
|
||||
return Params{
|
||||
EvmDenom: DefaultEVMDenom,
|
||||
EnableCreate: true,
|
||||
EnableCall: true,
|
||||
EnableCreate: DefaultEnableCreate,
|
||||
EnableCall: DefaultEnableCall,
|
||||
ChainConfig: DefaultChainConfig(),
|
||||
ExtraEIPs: nil,
|
||||
AllowUnprotectedTxs: DefaultAllowUnprotectedTxs,
|
||||
}
|
||||
}
|
||||
|
||||
// ParamSetPairs returns the parameter set pairs.
|
||||
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
|
||||
return paramtypes.ParamSetPairs{
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyEVMDenom, &p.EvmDenom, validateEVMDenom),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyEnableCreate, &p.EnableCreate, validateBool),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyEnableCall, &p.EnableCall, validateBool),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyExtraEIPs, &p.ExtraEIPs, validateEIPs),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyChainConfig, &p.ChainConfig, validateChainConfig),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyAllowUnprotectedTxs, &p.AllowUnprotectedTxs, validateBool),
|
||||
}
|
||||
}
|
||||
|
||||
// Validate performs basic validation on evm parameters.
|
||||
func (p Params) Validate() error {
|
||||
if err := sdk.ValidateDenom(p.EvmDenom); err != nil {
|
||||
if err := validateEVMDenom(p.EvmDenom); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -91,10 +79,22 @@ func (p Params) Validate() error {
|
||||
return err
|
||||
}
|
||||
|
||||
return p.ChainConfig.Validate()
|
||||
if err := validateBool(p.EnableCall); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validateBool(p.EnableCreate); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validateBool(p.AllowUnprotectedTxs); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return validateChainConfig(p.ChainConfig)
|
||||
}
|
||||
|
||||
// EIPs returns the ExtraEips as a int slice
|
||||
// EIPs returns the ExtraEIPS as a int slice
|
||||
func (p Params) EIPs() []int {
|
||||
eips := make([]int, len(p.ExtraEIPs))
|
||||
for i, eip := range p.ExtraEIPs {
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
|
||||
// Parameter keys
|
||||
var (
|
||||
ParamStoreKeyEVMDenom = []byte("EVMDenom")
|
||||
ParamStoreKeyEnableCreate = []byte("EnableCreate")
|
||||
ParamStoreKeyEnableCall = []byte("EnableCall")
|
||||
ParamStoreKeyExtraEIPs = []byte("EnableExtraEIPs")
|
||||
ParamStoreKeyChainConfig = []byte("ChainConfig")
|
||||
ParamStoreKeyAllowUnprotectedTxs = []byte("AllowUnprotectedTxs")
|
||||
)
|
||||
|
||||
// Deprecated: ParamKeyTable returns the parameter key table.
|
||||
// Usage of x/params to manage parameters is deprecated in favor of x/gov
|
||||
// controlled execution of MsgUpdateParams messages. These types remain solely
|
||||
// for migration purposes and will be removed in a future release.
|
||||
func ParamKeyTable() paramtypes.KeyTable {
|
||||
return paramtypes.NewKeyTable().RegisterParamSet(&Params{})
|
||||
}
|
||||
|
||||
// Deprecated: ParamSetPairs returns the parameter set pairs.
|
||||
// Usage of x/params to manage parameters is deprecated in favor of x/gov
|
||||
// controlled execution of MsgUpdateParams messages. These types remain solely
|
||||
// for migration purposes and will be removed in a future release.
|
||||
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
|
||||
return paramtypes.ParamSetPairs{
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyEVMDenom, &p.EvmDenom, validateEVMDenom),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyEnableCreate, &p.EnableCreate, validateBool),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyEnableCall, &p.EnableCall, validateBool),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyExtraEIPs, &p.ExtraEIPs, validateEIPs),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyChainConfig, &p.ChainConfig, validateChainConfig),
|
||||
paramtypes.NewParamSetPair(ParamStoreKeyAllowUnprotectedTxs, &p.AllowUnprotectedTxs, validateBool),
|
||||
}
|
||||
}
|
||||
@@ -5,15 +5,11 @@ import (
|
||||
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestParamKeyTable(t *testing.T) {
|
||||
require.IsType(t, paramtypes.KeyTable{}, ParamKeyTable())
|
||||
}
|
||||
|
||||
func TestParamsValidate(t *testing.T) {
|
||||
extraEips := []int64{2929, 1884, 1344}
|
||||
testCases := []struct {
|
||||
name string
|
||||
params Params
|
||||
@@ -22,7 +18,7 @@ func TestParamsValidate(t *testing.T) {
|
||||
{"default", DefaultParams(), false},
|
||||
{
|
||||
"valid",
|
||||
NewParams("ara", true, true, DefaultChainConfig(), 2929, 1884, 1344),
|
||||
NewParams("ara", false, true, true, DefaultChainConfig(), extraEips),
|
||||
false,
|
||||
},
|
||||
{
|
||||
@@ -59,7 +55,8 @@ func TestParamsValidate(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestParamsEIPs(t *testing.T) {
|
||||
params := NewParams("ara", true, true, DefaultChainConfig(), 2929, 1884, 1344)
|
||||
extraEips := []int64{2929, 1884, 1344}
|
||||
params := NewParams("ara", false, true, true, DefaultChainConfig(), extraEips)
|
||||
actual := params.EIPs()
|
||||
|
||||
require.Equal(t, []int([]int{2929, 1884, 1344}), actual)
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
Generated
+91
-92
@@ -1314,98 +1314,97 @@ func init() {
|
||||
func init() { proto.RegisterFile("ethermint/evm/v1/query.proto", fileDescriptor_e15a877459347994) }
|
||||
|
||||
var fileDescriptor_e15a877459347994 = []byte{
|
||||
// 1443 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0xcf, 0x6f, 0x13, 0xc7,
|
||||
0x17, 0xcf, 0xc6, 0x4e, 0xec, 0x8c, 0x03, 0xf8, 0x3b, 0x84, 0x2f, 0x66, 0x9b, 0xd8, 0x61, 0x21,
|
||||
0x3f, 0x09, 0xbb, 0x8d, 0x5b, 0x21, 0x95, 0x4b, 0x1b, 0x5b, 0x81, 0x52, 0xa0, 0xa2, 0x6e, 0xd4,
|
||||
0x43, 0x25, 0x64, 0x8d, 0xd7, 0xc3, 0x7a, 0x15, 0x7b, 0xc7, 0xec, 0x8c, 0x5d, 0x07, 0x4a, 0x0f,
|
||||
0x95, 0x8a, 0xa8, 0x90, 0x2a, 0xa4, 0xde, 0x2b, 0xfe, 0x83, 0x1e, 0xfb, 0x2f, 0x70, 0x44, 0xea,
|
||||
0xa5, 0xea, 0x81, 0x22, 0xd2, 0x43, 0x6f, 0xbd, 0xf7, 0x54, 0xcd, 0xec, 0x8c, 0x7f, 0xad, 0xd7,
|
||||
0x0e, 0x15, 0x3d, 0xf5, 0xb4, 0x3b, 0x33, 0x6f, 0xde, 0xfb, 0xbc, 0x1f, 0xf3, 0xde, 0x07, 0x2c,
|
||||
0x62, 0x56, 0xc3, 0x7e, 0xc3, 0xf5, 0x98, 0x85, 0xdb, 0x0d, 0xab, 0xbd, 0x6d, 0xdd, 0x6d, 0x61,
|
||||
0xff, 0xc0, 0x6c, 0xfa, 0x84, 0x11, 0x98, 0xee, 0x9e, 0x9a, 0xb8, 0xdd, 0x30, 0xdb, 0xdb, 0xfa,
|
||||
0xa6, 0x4d, 0x68, 0x83, 0x50, 0xab, 0x82, 0x28, 0x0e, 0x44, 0xad, 0xf6, 0x76, 0x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50, 0x3e, 0xd4, 0x80, 0x3e,
|
||||
0x4a, 0x83, 0x04, 0xbb, 0x02, 0x8e, 0x07, 0x99, 0x2b, 0x0f, 0x6a, 0x3a, 0x16, 0xec, 0xee, 0x04,
|
||||
0x9b, 0x50, 0x07, 0x49, 0xca, 0x8d, 0x72, 0x7c, 0xd3, 0x02, 0x5f, 0x77, 0xcd, 0x55, 0xa0, 0x40,
|
||||
0x6b, 0xd9, 0x6b, 0x35, 0x2a, 0xd8, 0x97, 0x1e, 0x1c, 0x93, 0xbb, 0x1f, 0x8b, 0x4d, 0xe3, 0x3a,
|
||||
0x58, 0x14, 0x38, 0x3e, 0x43, 0x75, 0xb7, 0x8a, 0x18, 0xf1, 0x87, 0x9c, 0x39, 0x0b, 0xe6, 0x6d,
|
||||
0xe2, 0x0d, 0xe3, 0x48, 0xf1, 0xbd, 0x9d, 0x90, 0x57, 0x8f, 0x35, 0xb0, 0x14, 0xa1, 0x4d, 0x3a,
|
||||
0xb6, 0x06, 0x4e, 0x28, 0x54, 0x83, 0x1a, 0x15, 0xd8, 0x37, 0xe8, 0x9a, 0x2a, 0xa2, 0x42, 0x90,
|
||||
0xe7, 0xd7, 0x49, 0xcf, 0xdb, 0xb2, 0x88, 0xba, 0x57, 0x27, 0x15, 0x91, 0x71, 0x5d, 0x1a, 0xfb,
|
||||
0x94, 0x11, 0x1f, 0x39, 0x93, 0x8d, 0xc1, 0x34, 0x88, 0xed, 0xe3, 0x03, 0x59, 0x6f, 0xfc, 0xb7,
|
||||
0xcf, 0xfc, 0x96, 0x34, 0xdf, 0x55, 0x26, 0xcd, 0x2f, 0x80, 0x99, 0x36, 0xaa, 0xb7, 0x94, 0xf1,
|
||||
0x60, 0x61, 0x5c, 0x02, 0x69, 0x59, 0x4a, 0xd5, 0xd7, 0x72, 0x72, 0x0d, 0xfc, 0xaf, 0xef, 0x9e,
|
||||
0x34, 0x01, 0x41, 0x9c, 0xd7, 0xbe, 0xb8, 0x35, 0x5f, 0x12, 0xff, 0xc6, 0x3d, 0x00, 0x85, 0xe0,
|
||||
0x5e, 0xe7, 0x06, 0x71, 0xa8, 0x32, 0x01, 0x41, 0x5c, 0xbc, 0x98, 0x40, 0xbf, 0xf8, 0x87, 0x57,
|
||||
0x00, 0xe8, 0xf5, 0x15, 0xe1, 0x5b, 0x2a, 0xbf, 0x6a, 0x06, 0x45, 0x6b, 0xf2, 0x26, 0x64, 0x06,
|
||||
0xfd, 0x4a, 0x36, 0x21, 0xf3, 0x56, 0x2f, 0x54, 0xa5, 0xbe, 0x9b, 0x7d, 0x20, 0xbf, 0xd5, 0x64,
|
||||
0x60, 0x95, 0x71, 0x89, 0x73, 0x03, 0xc4, 0xeb, 0xc4, 0xe1, 0xde, 0xc5, 0xd6, 0x53, 0xf9, 0x53,
|
||||
0xe6, 0x70, 0xeb, 0x33, 0x6f, 0x10, 0xa7, 0x24, 0x44, 0xe0, 0xd5, 0x11, 0xa0, 0xd6, 0x26, 0x82,
|
||||
0x0a, 0xec, 0xf4, 0xa3, 0x32, 0x16, 0x64, 0x1c, 0x6e, 0x21, 0x1f, 0x35, 0x54, 0x1c, 0x8c, 0x9b,
|
||||
0x12, 0xa0, 0xda, 0x95, 0x00, 0x2f, 0x81, 0xd9, 0xa6, 0xd8, 0x11, 0x01, 0x4a, 0xe5, 0x33, 0x61,
|
||||
0x88, 0xc1, 0x8d, 0x42, 0xfc, 0xd9, 0x8b, 0xdc, 0x54, 0x49, 0x4a, 0x1b, 0x3f, 0x69, 0xe0, 0xf8,
|
||||
0x2e, 0xab, 0x15, 0x51, 0xbd, 0xde, 0x17, 0x69, 0xe4, 0x3b, 0x54, 0xe5, 0x84, 0xff, 0xc3, 0xd3,
|
||||
0x20, 0xe1, 0x20, 0x5a, 0xb6, 0x51, 0x53, 0x3e, 0x8f, 0x59, 0x07, 0xd1, 0x22, 0x6a, 0xc2, 0xdb,
|
||||
0x20, 0xdd, 0xf4, 0x49, 0x93, 0x50, 0xec, 0x77, 0x9f, 0x18, 0x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2, 0x0c, 0xb8, 0x12, 0xce, 0xf3, 0x08, 0x22, 0xa9,
|
||||
0xaf, 0x4e, 0x12, 0x0b, 0xb0, 0x1a, 0x17, 0xbe, 0xfe, 0xf9, 0xf7, 0xef, 0xa7, 0x57, 0xe0, 0x39,
|
||||
0x2b, 0x44, 0x80, 0x25, 0xd7, 0xb0, 0xee, 0xcb, 0xdc, 0x3c, 0x80, 0x3f, 0x68, 0xe0, 0xd8, 0x00,
|
||||
0x9d, 0x83, 0x17, 0x22, 0xcc, 0x8c, 0xa2, 0x8d, 0xfa, 0xd6, 0xd1, 0x84, 0x25, 0xb2, 0xbc, 0x40,
|
||||
0xb6, 0x05, 0x37, 0xc3, 0xc8, 0x14, 0x73, 0x0c, 0x01, 0xfc, 0x51, 0x03, 0xe9, 0x61, 0x66, 0x06,
|
||||
0xcd, 0x08, 0xb3, 0x11, 0x84, 0x50, 0xb7, 0x8e, 0x2c, 0x2f, 0x91, 0x5e, 0x16, 0x48, 0xdf, 0x85,
|
||||
0xf9, 0x30, 0xd2, 0xb6, 0xba, 0xd3, 0x03, 0xdb, 0x4f, 0x36, 0x1f, 0xc0, 0x87, 0x1a, 0x48, 0x48,
|
||||
0x0e, 0x16, 0x99, 0xda, 0x41, 0x7a, 0x17, 0x99, 0xda, 0x21, 0x2a, 0x67, 0x6c, 0x09, 0x58, 0xab,
|
||||
0xf0, 0x7c, 0x18, 0x96, 0xe4, 0x74, 0xb4, 0x2f, 0x74, 0x8f, 0x35, 0x90, 0x90, 0x6c, 0x2c, 0x12,
|
||||
0xc8, 0x20, 0xf5, 0x8b, 0x04, 0x32, 0x44, 0xea, 0x8c, 0x6d, 0x01, 0xe4, 0x02, 0xdc, 0x08, 0x03,
|
||||
0xa1, 0x81, 0x68, 0x0f, 0x87, 0x75, 0x7f, 0x1f, 0x1f, 0x3c, 0x80, 0xf7, 0x40, 0x9c, 0x93, 0x36,
|
||||
0x68, 0x44, 0x96, 0x4c, 0x97, 0x09, 0xea, 0xe7, 0xc6, 0xca, 0x48, 0x0c, 0x1b, 0x02, 0xc3, 0x39,
|
||||
0x78, 0x76, 0x54, 0x35, 0x55, 0x07, 0x22, 0xf1, 0x05, 0x98, 0x0d, 0x78, 0x0b, 0x3c, 0x1f, 0xa1,
|
||||
0x79, 0x80, 0x1e, 0xe9, 0x2b, 0x13, 0xa4, 0x24, 0x82, 0x65, 0x81, 0x40, 0x87, 0x99, 0x30, 0x82,
|
||||
0x80, 0x18, 0xc1, 0x0e, 0x48, 0x48, 0x5e, 0x04, 0x97, 0xc3, 0x3a, 0x07, 0x29, 0x93, 0xbe, 0x36,
|
||||
0x69, 0x56, 0x28, 0xbb, 0x86, 0xb0, 0xbb, 0x08, 0xf5, 0xb0, 0x5d, 0xcc, 0x6a, 0x65, 0x9b, 0x9b,
|
||||
0xfb, 0x0a, 0xa4, 0xfa, 0x88, 0xcd, 0x11, 0xac, 0x8f, 0xf0, 0x79, 0x04, 0x33, 0x32, 0x56, 0x85,
|
||||
0xed, 0x65, 0x98, 0x1d, 0x61, 0x5b, 0x8a, 0x97, 0x1d, 0x44, 0xe1, 0x97, 0x20, 0x21, 0xe7, 0x68,
|
||||
0x64, 0xed, 0x0d, 0x32, 0xa9, 0xc8, 0xda, 0x1b, 0x1a, 0xc7, 0xe3, 0xbc, 0x0f, 0x86, 0x28, 0xeb,
|
||||
0xc0, 0x47, 0x1a, 0x00, 0xbd, 0x49, 0x00, 0xd7, 0xc7, 0xa9, 0xee, 0x1f, 0xde, 0xfa, 0xc6, 0x11,
|
||||
0x24, 0x25, 0x8e, 0x15, 0x81, 0x23, 0x07, 0x97, 0xa2, 0x70, 0x88, 0xb1, 0xc8, 0x03, 0x21, 0xa7,
|
||||
0xc9, 0x98, 0x6e, 0xd0, 0x3f, 0x84, 0xc6, 0x74, 0x83, 0x81, 0xa1, 0x34, 0x2e, 0x10, 0x6a, 0x58,
|
||||
0x15, 0x76, 0x9e, 0xbd, 0xca, 0x6a, 0xcf, 0x5f, 0x65, 0xb5, 0x97, 0xaf, 0xb2, 0xda, 0x93, 0xc3,
|
||||
0xec, 0xd4, 0xf3, 0xc3, 0xec, 0xd4, 0x2f, 0x87, 0xd9, 0xa9, 0xcf, 0xd7, 0xfa, 0x87, 0x17, 0xf6,
|
||||
0xed, 0x8b, 0x2e, 0xb1, 0xea, 0xc8, 0x26, 0x9e, 0x6b, 0x57, 0xad, 0x8e, 0x50, 0x24, 0x26, 0x58,
|
||||
0x65, 0x56, 0x0c, 0xff, 0x77, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xa8, 0xa7, 0xcc, 0x53, 0xc8,
|
||||
0x11, 0x00, 0x00,
|
||||
// 1434 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0xcd, 0x6f, 0x13, 0x47,
|
||||
0x14, 0xcf, 0xc6, 0x4e, 0xec, 0x3c, 0x07, 0x70, 0x87, 0x50, 0xcc, 0x36, 0xb1, 0xc3, 0x42, 0x3e,
|
||||
0x09, 0xbb, 0x8d, 0x5b, 0x21, 0x95, 0x4b, 0xc1, 0x56, 0xa0, 0x14, 0xa8, 0xa8, 0x1b, 0xf5, 0x50,
|
||||
0x09, 0x59, 0xe3, 0xf5, 0xb0, 0xb6, 0x62, 0xef, 0x9a, 0x9d, 0xb1, 0xeb, 0x40, 0xe9, 0xa1, 0x52,
|
||||
0x11, 0x15, 0x52, 0x85, 0xd4, 0x7b, 0xc5, 0x7f, 0xd0, 0x63, 0xff, 0x05, 0x8e, 0x48, 0xbd, 0x54,
|
||||
0x3d, 0x50, 0x44, 0x7a, 0xe8, 0xad, 0xf7, 0x9e, 0xaa, 0x99, 0x9d, 0xf1, 0xd7, 0xfa, 0x23, 0x54,
|
||||
0xf4, 0xd4, 0xd3, 0xee, 0xcc, 0xbc, 0x79, 0xef, 0xf7, 0x3e, 0xe6, 0xbd, 0x1f, 0x2c, 0x12, 0x56,
|
||||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 0x97,
|
||||
0xe8, 0x1d, 0x98, 0xb3, 0xbd, 0x32, 0x29, 0x56, 0x30, 0xad, 0xa4, 0xa6, 0xc5, 0x59, 0x9c, 0x6f,
|
||||
0x7c, 0x84, 0x69, 0x05, 0x2d, 0xc0, 0x8c, 0xeb, 0xf1, 0x4b, 0x91, 0x65, 0x6d, 0x3d, 0x5a, 0x08,
|
||||
0x16, 0xc6, 0x87, 0x70, 0x4a, 0x18, 0xc9, 0x8b, 0xf0, 0xfe, 0x0b, 0x94, 0x0f, 0x35, 0xd0, 0x87,
|
||||
0x69, 0x90, 0x60, 0x57, 0xe0, 0x68, 0x90, 0xb9, 0x62, 0xbf, 0xa6, 0x23, 0xc1, 0xee, 0xe5, 0x60,
|
||||
0x13, 0xe9, 0x10, 0xa7, 0xdc, 0x28, 0xc7, 0x37, 0x2d, 0xf0, 0x75, 0xd6, 0x5c, 0x05, 0x0e, 0xb4,
|
||||
0x16, 0xdd, 0x66, 0xbd, 0x44, 0x7c, 0xe9, 0xc1, 0x11, 0xb9, 0xfb, 0x89, 0xd8, 0x34, 0xae, 0xc3,
|
||||
0xa2, 0xc0, 0xf1, 0x39, 0xae, 0x55, 0xcb, 0x98, 0x79, 0xfe, 0x80, 0x33, 0xa7, 0x61, 0xde, 0xf6,
|
||||
0xdc, 0x41, 0x1c, 0x09, 0xbe, 0x77, 0x39, 0xe4, 0xd5, 0x63, 0x0d, 0x96, 0x46, 0x68, 0x93, 0x8e,
|
||||
0xad, 0xc1, 0x31, 0x85, 0xaa, 0x5f, 0xa3, 0x02, 0xfb, 0x06, 0x5d, 0x53, 0x45, 0x94, 0x0b, 0xf2,
|
||||
0xfc, 0x3a, 0xe9, 0x79, 0x57, 0x16, 0x51, 0xe7, 0xea, 0xa4, 0x22, 0x32, 0xae, 0x4b, 0x63, 0x9f,
|
||||
0x31, 0xcf, 0xc7, 0xce, 0x64, 0x63, 0x28, 0x09, 0x91, 0x3d, 0xb2, 0x2f, 0xeb, 0x8d, 0xff,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d, 0xdc, 0xb8, 0xdd, 0x99, 0xa1, 0x72, 0x5b,
|
||||
0xaa, 0xd8, 0x81, 0x38, 0x6f, 0xba, 0xc5, 0x3b, 0x44, 0xce, 0xb1, 0xdc, 0xe6, 0x6f, 0x2f, 0x32,
|
||||
0xab, 0x87, 0xf0, 0xe7, 0x9a, 0xcb, 0xf8, 0xc0, 0x15, 0xea, 0xb2, 0x7f, 0xcd, 0xc3, 0x8c, 0xd0,
|
||||
0x8f, 0xbe, 0xd5, 0x20, 0x26, 0x79, 0x06, 0x5a, 0x09, 0xe7, 0x79, 0x08, 0x91, 0xd4, 0x57, 0x27,
|
||||
0x89, 0x05, 0x58, 0x8d, 0x73, 0xdf, 0xfc, 0xf2, 0xc7, 0x0f, 0xd3, 0x2b, 0xe8, 0x8c, 0x15, 0x22,
|
||||
0xc0, 0x92, 0x6b, 0x58, 0xf7, 0x65, 0x6e, 0x1e, 0xa0, 0x1f, 0x35, 0x38, 0xd2, 0x47, 0xe7, 0xd0,
|
||||
0xb9, 0x11, 0x66, 0x86, 0xd1, 0x46, 0x7d, 0xeb, 0x70, 0xc2, 0x12, 0x59, 0x56, 0x20, 0xdb, 0x42,
|
||||
0x9b, 0x61, 0x64, 0x8a, 0x39, 0x86, 0x00, 0xfe, 0xa4, 0x41, 0x72, 0x90, 0x99, 0x21, 0x73, 0x84,
|
||||
0xd9, 0x11, 0x84, 0x50, 0xb7, 0x0e, 0x2d, 0x2f, 0x91, 0x5e, 0x14, 0x48, 0xdf, 0x47, 0xd9, 0x30,
|
||||
0xd2, 0x96, 0xba, 0xd3, 0x05, 0xdb, 0x4b, 0x36, 0x1f, 0xa0, 0x87, 0x1a, 0xc4, 0x24, 0x07, 0x1b,
|
||||
0x99, 0xda, 0x7e, 0x7a, 0x37, 0x32, 0xb5, 0x03, 0x54, 0xce, 0xd8, 0x12, 0xb0, 0x56, 0xd1, 0xd9,
|
||||
0x30, 0x2c, 0xc9, 0xe9, 0x68, 0x4f, 0xe8, 0x1e, 0x6b, 0x10, 0x93, 0x6c, 0x6c, 0x24, 0x90, 0x7e,
|
||||
0xea, 0x37, 0x12, 0xc8, 0x00, 0xa9, 0x33, 0xb6, 0x05, 0x90, 0x73, 0x68, 0x23, 0x0c, 0x84, 0x06,
|
||||
0xa2, 0x5d, 0x1c, 0xd6, 0xfd, 0x3d, 0xb2, 0xff, 0x00, 0xdd, 0x83, 0x28, 0x27, 0x6d, 0xc8, 0x18,
|
||||
0x59, 0x32, 0x1d, 0x26, 0xa8, 0x9f, 0x19, 0x2b, 0x23, 0x31, 0x6c, 0x08, 0x0c, 0x67, 0xd0, 0xe9,
|
||||
0x61, 0xd5, 0x54, 0xee, 0x8b, 0xc4, 0x97, 0x30, 0x1b, 0xf0, 0x16, 0x74, 0x76, 0x84, 0xe6, 0x3e,
|
||||
0x7a, 0xa4, 0xaf, 0x4c, 0x90, 0x92, 0x08, 0x96, 0x05, 0x02, 0x1d, 0xa5, 0xc2, 0x08, 0x02, 0x62,
|
||||
0x84, 0xda, 0x10, 0x93, 0xbc, 0x08, 0x2d, 0x87, 0x75, 0xf6, 0x53, 0x26, 0x7d, 0x6d, 0xd2, 0xac,
|
||||
0x50, 0x76, 0x0d, 0x61, 0x77, 0x11, 0xe9, 0x61, 0xbb, 0x84, 0x55, 0x8a, 0x36, 0x37, 0xf7, 0x35,
|
||||
0x24, 0x7a, 0x88, 0xcd, 0x21, 0xac, 0x0f, 0xf1, 0x79, 0x08, 0x33, 0x32, 0x56, 0x85, 0xed, 0x65,
|
||||
0x94, 0x1e, 0x62, 0x5b, 0x8a, 0x17, 0x1d, 0x4c, 0xd1, 0x57, 0x10, 0x93, 0x73, 0x74, 0x64, 0xed,
|
||||
0xf5, 0x33, 0xa9, 0x91, 0xb5, 0x37, 0x30, 0x8e, 0xc7, 0x79, 0x1f, 0x0c, 0x51, 0xd6, 0x46, 0x8f,
|
||||
0x34, 0x80, 0xee, 0x24, 0x40, 0xeb, 0xe3, 0x54, 0xf7, 0x0e, 0x6f, 0x7d, 0xe3, 0x10, 0x92, 0x12,
|
||||
0xc7, 0x8a, 0xc0, 0x91, 0x41, 0x4b, 0xa3, 0x70, 0x88, 0xb1, 0xc8, 0x03, 0x21, 0xa7, 0xc9, 0x98,
|
||||
0x6e, 0xd0, 0x3b, 0x84, 0xc6, 0x74, 0x83, 0xbe, 0xa1, 0x34, 0x2e, 0x10, 0x6a, 0x58, 0xe5, 0x2e,
|
||||
0x3d, 0x7b, 0x95, 0xd6, 0x9e, 0xbf, 0x4a, 0x6b, 0x2f, 0x5f, 0xa5, 0xb5, 0x27, 0x07, 0xe9, 0xa9,
|
||||
0xe7, 0x07, 0xe9, 0xa9, 0x5f, 0x0f, 0xd2, 0x53, 0x5f, 0xf4, 0x0e, 0x2f, 0xd2, 0xe2, 0xb3, 0xab,
|
||||
0xab, 0xa5, 0x2d, 0xf4, 0x88, 0x01, 0x56, 0x9a, 0x15, 0xb3, 0xff, 0xbd, 0x7f, 0x02, 0x00, 0x00,
|
||||
0xff, 0xff, 0xa4, 0xba, 0x06, 0x5b, 0xc7, 0x11, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
Generated
+451
-55
@@ -10,6 +10,7 @@ import (
|
||||
_ "github.com/cosmos/cosmos-proto"
|
||||
types "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
|
||||
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||
grpc1 "github.com/gogo/protobuf/grpc"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
@@ -345,6 +346,100 @@ func (m *MsgEthereumTxResponse) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_MsgEthereumTxResponse proto.InternalMessageInfo
|
||||
|
||||
// MsgUpdateParams defines a Msg for updating the x/evm module parameters.
|
||||
type MsgUpdateParams struct {
|
||||
// authority is the address of the governance account.
|
||||
Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
|
||||
// params defines the x/evm parameters to update.
|
||||
// NOTE: All parameters must be supplied.
|
||||
Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} }
|
||||
func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgUpdateParams) ProtoMessage() {}
|
||||
func (*MsgUpdateParams) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_f75ac0a12d075f21, []int{6}
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgUpdateParams.Merge(m, src)
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo
|
||||
|
||||
func (m *MsgUpdateParams) GetAuthority() string {
|
||||
if m != nil {
|
||||
return m.Authority
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) GetParams() Params {
|
||||
if m != nil {
|
||||
return m.Params
|
||||
}
|
||||
return Params{}
|
||||
}
|
||||
|
||||
// MsgUpdateParamsResponse defines the response structure for executing a
|
||||
// MsgUpdateParams message.
|
||||
type MsgUpdateParamsResponse struct {
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} }
|
||||
func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgUpdateParamsResponse) ProtoMessage() {}
|
||||
func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_f75ac0a12d075f21, []int{7}
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src)
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*MsgEthereumTx)(nil), "ethermint.evm.v1.MsgEthereumTx")
|
||||
proto.RegisterType((*LegacyTx)(nil), "ethermint.evm.v1.LegacyTx")
|
||||
@@ -352,66 +447,75 @@ func init() {
|
||||
proto.RegisterType((*DynamicFeeTx)(nil), "ethermint.evm.v1.DynamicFeeTx")
|
||||
proto.RegisterType((*ExtensionOptionsEthereumTx)(nil), "ethermint.evm.v1.ExtensionOptionsEthereumTx")
|
||||
proto.RegisterType((*MsgEthereumTxResponse)(nil), "ethermint.evm.v1.MsgEthereumTxResponse")
|
||||
proto.RegisterType((*MsgUpdateParams)(nil), "ethermint.evm.v1.MsgUpdateParams")
|
||||
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "ethermint.evm.v1.MsgUpdateParamsResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("ethermint/evm/v1/tx.proto", fileDescriptor_f75ac0a12d075f21) }
|
||||
|
||||
var fileDescriptor_f75ac0a12d075f21 = []byte{
|
||||
// 860 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x4f, 0x8f, 0xdb, 0x44,
|
||||
0x14, 0xcf, 0x24, 0x4e, 0xe2, 0x4c, 0x42, 0x55, 0x59, 0x5b, 0xc9, 0x89, 0x68, 0x1c, 0x45, 0x82,
|
||||
0x06, 0xa4, 0xd8, 0xea, 0xc2, 0x69, 0x4f, 0x6c, 0xba, 0xdb, 0xaa, 0xd5, 0x56, 0x20, 0x2b, 0x5c,
|
||||
0xe8, 0x21, 0x9a, 0x75, 0x66, 0x9d, 0x11, 0xf1, 0x8c, 0xe5, 0x99, 0x58, 0x0e, 0x12, 0x17, 0xc4,
|
||||
0x81, 0x1b, 0x48, 0x7c, 0x01, 0x0e, 0x9c, 0xb8, 0xc2, 0x07, 0xe0, 0x58, 0x71, 0xaa, 0xc4, 0x05,
|
||||
0x71, 0x30, 0x28, 0xcb, 0x69, 0x6f, 0xf0, 0x09, 0xd0, 0xcc, 0x78, 0xff, 0x84, 0x28, 0x05, 0xca,
|
||||
0xa2, 0x9e, 0xf2, 0x9e, 0xdf, 0x9f, 0x79, 0xef, 0xfd, 0x7e, 0x79, 0x0f, 0xb6, 0xb1, 0x98, 0xe1,
|
||||
0x24, 0x22, 0x54, 0x78, 0x38, 0x8d, 0xbc, 0xf4, 0xae, 0x27, 0x32, 0x37, 0x4e, 0x98, 0x60, 0xd6,
|
||||
0xcd, 0x0b, 0x93, 0x8b, 0xd3, 0xc8, 0x4d, 0xef, 0x76, 0xda, 0x01, 0xe3, 0x11, 0xe3, 0x13, 0x65,
|
||||
0xf7, 0xb4, 0xa2, 0x9d, 0x3b, 0x9d, 0x8d, 0x3c, 0x32, 0x46, 0xdb, 0x76, 0x42, 0x16, 0x32, 0x1d,
|
||||
0x23, 0xa5, 0xe2, 0xeb, 0xab, 0x21, 0x63, 0xe1, 0x1c, 0x7b, 0x28, 0x26, 0x1e, 0xa2, 0x94, 0x09,
|
||||
0x24, 0x08, 0xa3, 0xe7, 0xf9, 0xda, 0x85, 0x55, 0x69, 0xc7, 0x8b, 0x13, 0x0f, 0xd1, 0xa5, 0x36,
|
||||
0xf5, 0x3f, 0x07, 0xf0, 0x95, 0xc7, 0x3c, 0x3c, 0x94, 0x0f, 0xe2, 0x45, 0x34, 0xce, 0xac, 0x01,
|
||||
0x34, 0xa6, 0x48, 0x20, 0x1b, 0xf4, 0xc0, 0xa0, 0xb9, 0xbb, 0xe3, 0xea, 0x58, 0xf7, 0x3c, 0xd6,
|
||||
0xdd, 0xa7, 0x4b, 0x5f, 0x79, 0x58, 0x6d, 0x68, 0x70, 0xf2, 0x11, 0xb6, 0xcb, 0x3d, 0x30, 0x00,
|
||||
0xa3, 0xea, 0x59, 0xee, 0x80, 0xa1, 0xa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, 0xb9, 0x20, 0xf1, 0x24, 0x40, 0xf1, 0x0b, 0xa0, 0x2e, 0x29, 0x33, 0x26, 0xf1,
|
||||
0x3d, 0x14, 0x9f, 0xe7, 0x3a, 0xc1, 0x58, 0xe5, 0x32, 0x5e, 0x28, 0xd7, 0x7d, 0x8c, 0x65, 0xae,
|
||||
0x82, 0x42, 0xd5, 0xe7, 0x53, 0xa8, 0xb6, 0x49, 0xa1, 0xfa, 0xf5, 0x51, 0xc8, 0xdc, 0x42, 0xa1,
|
||||
0xc6, 0xff, 0x42, 0x21, 0xb8, 0x46, 0xa1, 0xe6, 0x1a, 0x85, 0x5a, 0xdb, 0x28, 0xd4, 0x87, 0x9d,
|
||||
0xc3, 0x4c, 0x60, 0xca, 0x09, 0xa3, 0xef, 0xc6, 0xea, 0x66, 0x5c, 0x9e, 0x82, 0x62, 0x21, 0x7f,
|
||||
0x0d, 0xe0, 0xad, 0xb5, 0x13, 0xe1, 0x63, 0x1e, 0x33, 0xca, 0x55, 0xa3, 0x6a, 0xcb, 0x03, 0xbd,
|
||||
0xc4, 0xd5, 0x62, 0x7f, 0x03, 0x1a, 0x73, 0x16, 0x72, 0xbb, 0xac, 0x9a, 0xbc, 0xb5, 0xd9, 0xe4,
|
||||
0x11, 0x0b, 0x7d, 0xe5, 0x62, 0xdd, 0x84, 0x95, 0x04, 0x0b, 0xc5, 0x99, 0x96, 0x2f, 0x45, 0xab,
|
||||
0x0d, 0xcd, 0x34, 0x9a, 0xe0, 0x24, 0x61, 0x49, 0xb1, 0x75, 0xeb, 0x69, 0x74, 0x28, 0x55, 0x69,
|
||||
0x92, 0xe4, 0x58, 0x70, 0x3c, 0xd5, 0xa8, 0xfa, 0xf5, 0x10, 0xf1, 0xf7, 0x39, 0x9e, 0xea, 0x32,
|
||||
0x77, 0x3f, 0x05, 0xb0, 0xf2, 0x98, 0x87, 0xd6, 0xc7, 0x10, 0x5e, 0xb9, 0x66, 0xce, 0x66, 0x01,
|
||||
0x6b, 0xbd, 0x74, 0xee, 0xfc, 0x8d, 0xc3, 0x79, 0xb3, 0xfd, 0xd7, 0x3e, 0xf9, 0xf1, 0xb7, 0x2f,
|
||||
0xcb, 0x4e, 0xff, 0xb6, 0xb7, 0x79, 0x9d, 0x0b, 0xef, 0x89, 0xc8, 0x46, 0xfb, 0x4f, 0x57, 0x5d,
|
||||
0xf0, 0x6c, 0xd5, 0x05, 0xbf, 0xae, 0xba, 0xe0, 0x8b, 0xd3, 0x6e, 0xe9, 0xd9, 0x69, 0xb7, 0xf4,
|
||||
0xd3, 0x69, 0xb7, 0xf4, 0xc1, 0x9d, 0xab, 0x7c, 0xc2, 0x49, 0x30, 0x24, 0xcc, 0x9b, 0xa3, 0x80,
|
||||
0x51, 0x12, 0x4c, 0xbd, 0x4c, 0xe5, 0x52, 0xa4, 0x3a, 0xae, 0xa9, 0x5b, 0xfb, 0xd6, 0x9f, 0x01,
|
||||
0x00, 0x00, 0xff, 0xff, 0x44, 0x7c, 0x85, 0x7a, 0x4f, 0x08, 0x00, 0x00,
|
||||
// 975 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcf, 0x8f, 0xdb, 0xc4,
|
||||
0x17, 0x8f, 0x13, 0xe7, 0xd7, 0x24, 0xdf, 0xfd, 0x56, 0xa3, 0xad, 0xea, 0x44, 0x34, 0x0e, 0x96,
|
||||
0x80, 0xb4, 0x52, 0x6c, 0x75, 0x41, 0x3d, 0xec, 0xa9, 0x9b, 0xee, 0xb6, 0x6a, 0xb5, 0x2b, 0x2a,
|
||||
0x93, 0x5e, 0x28, 0x52, 0x34, 0x6b, 0xcf, 0x4e, 0x2c, 0x62, 0x8f, 0xe5, 0x99, 0x58, 0x09, 0x12,
|
||||
0x97, 0x9e, 0xb8, 0x01, 0xe2, 0x1f, 0xe0, 0xc0, 0x89, 0x13, 0x12, 0xfd, 0x03, 0x38, 0x56, 0x9c,
|
||||
0x2a, 0xb8, 0x20, 0x0e, 0x01, 0x65, 0x91, 0x90, 0xf6, 0x06, 0x7f, 0x01, 0x9a, 0x19, 0x67, 0xb3,
|
||||
0x69, 0xd8, 0x16, 0x4a, 0x11, 0x27, 0xcf, 0x9b, 0xf7, 0xe6, 0xbd, 0x37, 0x9f, 0xcf, 0x67, 0x66,
|
||||
0x0c, 0x1a, 0x98, 0x0f, 0x71, 0x12, 0x06, 0x11, 0x77, 0x70, 0x1a, 0x3a, 0xe9, 0x35, 0x87, 0x4f,
|
||||
0xec, 0x38, 0xa1, 0x9c, 0xc2, 0x0b, 0xa7, 0x2e, 0x1b, 0xa7, 0xa1, 0x9d, 0x5e, 0x6b, 0x5e, 0xf2,
|
||||
0x28, 0x0b, 0x29, 0x73, 0x42, 0x46, 0x44, 0x64, 0xc8, 0x88, 0x0a, 0x6d, 0x36, 0x94, 0x63, 0x20,
|
||||
0x2d, 0x47, 0x19, 0x99, 0xab, 0xb9, 0x56, 0x40, 0x24, 0x53, 0xbe, 0x4d, 0x42, 0x09, 0x55, 0x6b,
|
||||
0xc4, 0x28, 0x9b, 0x7d, 0x85, 0x50, 0x4a, 0x46, 0xd8, 0x41, 0x71, 0xe0, 0xa0, 0x28, 0xa2, 0x1c,
|
||||
0xf1, 0x80, 0x46, 0x8b, 0x7c, 0x8d, 0xcc, 0x2b, 0xad, 0xc3, 0xf1, 0x91, 0x83, 0xa2, 0xa9, 0x72,
|
||||
0x59, 0x1f, 0x6b, 0xe0, 0x7f, 0x07, 0x8c, 0xec, 0x89, 0x82, 0x78, 0x1c, 0xf6, 0x27, 0xb0, 0x03,
|
||||
0x74, 0x1f, 0x71, 0x64, 0x68, 0x6d, 0xad, 0x53, 0xdb, 0xda, 0xb4, 0xd5, 0x5a, 0x7b, 0xb1, 0xd6,
|
||||
0xde, 0x89, 0xa6, 0xae, 0x8c, 0x80, 0x0d, 0xa0, 0xb3, 0xe0, 0x03, 0x6c, 0xe4, 0xdb, 0x5a, 0x47,
|
||||
0xeb, 0x15, 0x4f, 0x66, 0xa6, 0xd6, 0x75, 0xe5, 0x14, 0x34, 0x81, 0x3e, 0x44, 0x6c, 0x68, 0x14,
|
||||
0xda, 0x5a, 0xa7, 0xda, 0xab, 0xfd, 0x3e, 0x33, 0xcb, 0xc9, 0x28, 0xde, 0xb6, 0xba, 0x96, 0x2b,
|
||||
0x1d, 0x10, 0x02, 0xfd, 0x28, 0xa1, 0xa1, 0xa1, 0x8b, 0x00, 0x57, 0x8e, 0xb7, 0xf5, 0x8f, 0x3e,
|
||||
0x37, 0x73, 0xd6, 0xd7, 0x79, 0x50, 0xd9, 0xc7, 0x04, 0x79, 0xd3, 0xfe, 0x04, 0x6e, 0x82, 0x62,
|
||||
0x44, 0x23, 0x0f, 0xcb, 0x6e, 0x74, 0x57, 0x19, 0xf0, 0x36, 0xa8, 0x12, 0x24, 0x90, 0x0b, 0x3c,
|
||||
0x55, 0xbd, 0xda, 0xbb, 0xfa, 0xe3, 0xcc, 0x7c, 0x9d, 0x04, 0x7c, 0x38, 0x3e, 0xb4, 0x3d, 0x1a,
|
||||
0x66, 0x78, 0x66, 0x9f, 0x2e, 0xf3, 0xdf, 0x77, 0xf8, 0x34, 0xc6, 0xcc, 0xbe, 0x13, 0x71, 0xb7,
|
||||
0x42, 0x10, 0xbb, 0x27, 0xd6, 0xc2, 0x16, 0x28, 0x10, 0xc4, 0x64, 0x97, 0x7a, 0xaf, 0x3e, 0x9f,
|
||||
0x99, 0x95, 0xdb, 0x88, 0xed, 0x07, 0x61, 0xc0, 0x5d, 0xe1, 0x80, 0x1b, 0x20, 0xcf, 0x69, 0xd6,
|
||||
0x63, 0x9e, 0x53, 0x78, 0x17, 0x14, 0x53, 0x34, 0x1a, 0x63, 0xa3, 0x28, 0x8b, 0xbe, 0xf5, 0xd7,
|
||||
0x8b, 0xce, 0x67, 0x66, 0x69, 0x27, 0xa4, 0xe3, 0x88, 0xbb, 0x2a, 0x85, 0x40, 0x40, 0xe2, 0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f, 0x70, 0x7e,
|
||||
0x17, 0xd4, 0x04, 0xe7, 0x3c, 0x88, 0x07, 0x1e, 0x8a, 0x5f, 0x80, 0x75, 0x21, 0x99, 0x7e, 0x10,
|
||||
0xdf, 0x44, 0xf1, 0x22, 0xd7, 0x11, 0xc6, 0x32, 0x97, 0xfe, 0x42, 0xb9, 0x6e, 0x61, 0x2c, 0x72,
|
||||
0x65, 0x12, 0x2a, 0x3e, 0x5b, 0x42, 0xa5, 0x75, 0x09, 0x95, 0x5f, 0x9e, 0x84, 0x2a, 0xe7, 0x48,
|
||||
0xa8, 0xfa, 0xaf, 0x48, 0x08, 0xac, 0x48, 0xa8, 0xb6, 0x22, 0xa1, 0xfa, 0x79, 0x12, 0xb2, 0x40,
|
||||
0x73, 0x6f, 0xc2, 0x71, 0xc4, 0x02, 0x1a, 0xbd, 0x1d, 0xcb, 0x37, 0x63, 0xf9, 0x14, 0x64, 0x17,
|
||||
0xf2, 0x17, 0x1a, 0xb8, 0xb8, 0xf2, 0x44, 0xb8, 0x98, 0xc5, 0x34, 0x62, 0x72, 0xa3, 0xf2, 0x96,
|
||||
0xd7, 0xd4, 0x25, 0x2e, 0x2f, 0xf6, 0x2b, 0x40, 0x1f, 0x51, 0xc2, 0x8c, 0xbc, 0xdc, 0xe4, 0xc5,
|
||||
0xf5, 0x4d, 0xee, 0x53, 0xe2, 0xca, 0x10, 0x78, 0x01, 0x14, 0x12, 0xcc, 0xa5, 0x66, 0xea, 0xae,
|
||||
0x18, 0xc2, 0x06, 0xa8, 0xa4, 0xe1, 0x00, 0x27, 0x09, 0x4d, 0xb2, 0x5b, 0xb7, 0x9c, 0x86, 0x7b,
|
||||
0xc2, 0x14, 0x2e, 0x21, 0x8e, 0x31, 0xc3, 0xbe, 0x62, 0xd5, 0x2d, 0x13, 0xc4, 0xee, 0x33, 0xec,
|
||||
0x67, 0x6d, 0x7e, 0xaa, 0x81, 0xff, 0x1f, 0x30, 0x72, 0x3f, 0xf6, 0x11, 0xc7,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x60, 0x87, 0x25, 0xf9, 0xdf, 0xf1,
|
||||
0xe6, 0x1f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8d, 0xf3, 0xe0, 0xc6, 0x74, 0x09, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -428,6 +532,9 @@ const _ = grpc.SupportPackageIsVersion4
|
||||
type MsgClient interface {
|
||||
// EthereumTx defines a method submitting Ethereum transactions.
|
||||
EthereumTx(ctx context.Context, in *MsgEthereumTx, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error)
|
||||
// UpdateParams defined a governance operation for updating the x/evm module parameters.
|
||||
// The authority is hard-coded to the Cosmos SDK x/gov module account
|
||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||
}
|
||||
|
||||
type msgClient struct {
|
||||
@@ -447,10 +554,22 @@ func (c *msgClient) EthereumTx(ctx context.Context, in *MsgEthereumTx, opts ...g
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
||||
out := new(MsgUpdateParamsResponse)
|
||||
err := c.cc.Invoke(ctx, "/ethermint.evm.v1.Msg/UpdateParams", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MsgServer is the server API for Msg service.
|
||||
type MsgServer interface {
|
||||
// EthereumTx defines a method submitting Ethereum transactions.
|
||||
EthereumTx(context.Context, *MsgEthereumTx) (*MsgEthereumTxResponse, error)
|
||||
// UpdateParams defined a governance operation for updating the x/evm module parameters.
|
||||
// The authority is hard-coded to the Cosmos SDK x/gov module account
|
||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedMsgServer can be embedded to have forward compatible implementations.
|
||||
@@ -460,6 +579,9 @@ type UnimplementedMsgServer struct {
|
||||
func (*UnimplementedMsgServer) EthereumTx(ctx context.Context, req *MsgEthereumTx) (*MsgEthereumTxResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method EthereumTx not implemented")
|
||||
}
|
||||
func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||
}
|
||||
|
||||
func RegisterMsgServer(s grpc1.Server, srv MsgServer) {
|
||||
s.RegisterService(&_Msg_serviceDesc, srv)
|
||||
@@ -483,6 +605,24 @@ func _Msg_EthereumTx_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgUpdateParams)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).UpdateParams(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ethermint.evm.v1.Msg/UpdateParams",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "ethermint.evm.v1.Msg",
|
||||
HandlerType: (*MsgServer)(nil),
|
||||
@@ -491,6 +631,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "EthereumTx",
|
||||
Handler: _Msg_EthereumTx_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateParams",
|
||||
Handler: _Msg_UpdateParams_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "ethermint/evm/v1/tx.proto",
|
||||
@@ -977,6 +1121,69 @@ func (m *MsgEthereumTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
{
|
||||
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintTx(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
if len(m.Authority) > 0 {
|
||||
i -= len(m.Authority)
|
||||
copy(dAtA[i:], m.Authority)
|
||||
i = encodeVarintTx(dAtA, i, uint64(len(m.Authority)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintTx(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovTx(v)
|
||||
base := offset
|
||||
@@ -1204,6 +1411,30 @@ func (m *MsgEthereumTxResponse) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Authority)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
l = m.Params.Size()
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
return n
|
||||
}
|
||||
|
||||
func sovTx(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
@@ -2782,6 +3013,171 @@ func (m *MsgEthereumTxResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Authority = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTx(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTx(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipTx(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package types
|
||||
|
||||
import (
|
||||
|
||||
+16
-1
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package geth
|
||||
|
||||
import (
|
||||
@@ -67,7 +82,7 @@ func (EVM) ActivePrecompiles(rules params.Rules) []common.Address {
|
||||
}
|
||||
|
||||
// RunPrecompiledContract runs a stateless precompiled contract and ignores the address and
|
||||
// value arguments. It uses the RunPrecompiledContract function from the geth vm package.
|
||||
// value arguments. It uses the RunPrecompiledContract function from the geth vm package
|
||||
func (EVM) RunPrecompiledContract(
|
||||
p evm.StatefulPrecompiledContract,
|
||||
_ common.Address, // address arg is unused
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package geth
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
// Copyright 2021 Evmos Foundation
|
||||
// This file is part of Evmos' Ethermint library.
|
||||
//
|
||||
// The Ethermint library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The Ethermint library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE
|
||||
package vm
|
||||
|
||||
import (
|
||||
|
||||
Reference in New Issue
Block a user