Skip to content

Commit bb572eb

Browse files
committed
Remove test* denoms and replace with default*
1 parent 6efae1b commit bb572eb

File tree

6 files changed

+16
-22
lines changed

6 files changed

+16
-22
lines changed

config/config.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ const (
7272
Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus
7373
// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key.
7474
Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic
75-
// TestDisplayDenom defines the denomination displayed to users in client applications.
76-
TestDisplayDenom = "atom"
77-
// TestEvmDenom defines the non-18-decimal denomination
78-
TestEvmDenom = "uatom"
79-
// TestExtendedDenom defines to the default denomination used in the Cosmos EVM example chain.
80-
TestExtendedDenom = "aatom"
8175
// BaseDenomUnit defines the precision of the base denomination.
8276
BaseDenomUnit = 18
8377
// EVMChainID defines the EIP-155 replay-protection chain id for the current ethereum chain config.

evmd/cmd/evmd/cmd/root.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package cmd
33
import (
44
"errors"
55
"github.com/cosmos/evm/config"
6+
"github.com/cosmos/evm/x/vm/types"
67
"io"
78
"os"
89

@@ -126,7 +127,7 @@ func NewRootCmd() *cobra.Command {
126127
return err
127128
}
128129

129-
customAppTemplate, customAppConfig := config.InitAppConfig(config.TestExtendedDenom, config.EVMChainID) // TODO:VLAD - Remove this
130+
customAppTemplate, customAppConfig := config.InitAppConfig(types.DefaultEVMExtendedDenom, config.EVMChainID) // TODO:VLAD - Remove this
130131
customTMConfig := initCometConfig()
131132

132133
return sdkserver.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customTMConfig)

testutil/ibc/chain.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
cmtversion "github.com/cometbft/cometbft/version"
2020

2121
"github.com/cosmos/evm"
22-
"github.com/cosmos/evm/config"
2322
"github.com/cosmos/evm/crypto/ethsecp256k1"
2423
"github.com/cosmos/evm/testutil/tx"
2524
"github.com/cosmos/evm/x/vm/types"
@@ -138,7 +137,7 @@ func NewTestChainWithValSet(tb testing.TB, isEVM bool, coord *Coordinator, chain
138137
Address: acc.GetAddress().String(),
139138
Coins: sdk.NewCoins(
140139
sdk.NewCoin(sdk.DefaultBondDenom, amount),
141-
sdk.NewCoin(config.TestExtendedDenom, amount),
140+
sdk.NewCoin(types.DefaultEVMExtendedDenom, amount),
142141
),
143142
}
144143

@@ -157,22 +156,22 @@ func NewTestChainWithValSet(tb testing.TB, isEVM bool, coord *Coordinator, chain
157156
Description: "",
158157
DenomUnits: []*banktypes.DenomUnit{
159158
{
160-
Denom: config.TestExtendedDenom,
159+
Denom: types.DefaultEVMExtendedDenom,
161160
Exponent: 0,
162161
Aliases: nil,
163162
},
164163
{
165-
Denom: config.TestDisplayDenom,
164+
Denom: types.DefaultEVMDisplayDenom,
166165
Exponent: 6,
167166
Aliases: nil,
168167
},
169168
},
170-
Base: config.TestExtendedDenom,
171-
Display: config.TestDisplayDenom,
172-
Name: config.TestEvmDenom,
173-
Symbol: config.TestEvmDenom,
174-
URI: config.TestEvmDenom,
175-
URIHash: config.TestEvmDenom,
169+
Base: types.DefaultEVMExtendedDenom,
170+
Display: types.DefaultEVMDisplayDenom,
171+
Name: types.DefaultEVMDenom,
172+
Symbol: types.DefaultEVMDenom,
173+
URI: types.DefaultEVMDenom,
174+
URIHash: types.DefaultEVMDenom,
176175
}}
177176

178177
app := SetupWithGenesisValSet(tb, valSet, genAccs, chainID, sdk.DefaultPowerReduction, metadata, genBals...)

testutil/ibc/helpers.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package ibctesting
22

33
import (
4+
"github.com/cosmos/evm/x/vm/types"
45
"math/big"
56
"math/rand"
67
"testing"
@@ -10,8 +11,6 @@ import (
1011

1112
abci "github.com/cometbft/cometbft/abci/types"
1213

13-
"github.com/cosmos/evm/config"
14-
1514
bam "github.com/cosmos/cosmos-sdk/baseapp"
1615
"github.com/cosmos/cosmos-sdk/client"
1716
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
@@ -25,7 +24,7 @@ func FeeCoins() sdk.Coins {
2524
// Note: evmChain requires for gas price higher than base fee (see fee_checker.go).
2625
// Other Cosmos chains using simapp don’t rely on gas prices, so this works even if simapp isn’t aware of evmChain’s TestExtendedDenom.
2726
sdkExp := new(big.Int).Exp(big.NewInt(10), big.NewInt(6), nil)
28-
return sdk.Coins{sdk.NewInt64Coin(config.TestExtendedDenom, new(big.Int).Mul(big.NewInt(FeeAmt), sdkExp).Int64())}
27+
return sdk.Coins{sdk.NewInt64Coin(types.DefaultEVMExtendedDenom, new(big.Int).Mul(big.NewInt(FeeAmt), sdkExp).Int64())}
2928
}
3029

3130
// SignAndDeliver signs and delivers a transaction. No simulation occurs as the

testutil/ibc/testing_app.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
cmttypes "github.com/cometbft/cometbft/types"
1212

1313
dbm "github.com/cosmos/cosmos-db"
14-
"github.com/cosmos/evm/config"
1514
evmtypes "github.com/cosmos/evm/x/vm/types"
1615
"github.com/cosmos/ibc-go/v10/modules/core/keeper"
1716
ibctesting "github.com/cosmos/ibc-go/v10/testing"
@@ -125,7 +124,7 @@ func setupWithGenesisValSet(tb testing.TB, valSet *cmttypes.ValidatorSet, genAcc
125124
genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenesis)
126125

127126
evmGenesis := evmtypes.DefaultGenesisState()
128-
evmGenesis.Params.EvmDenom = config.TestExtendedDenom
127+
evmGenesis.Params.EvmDenom = evmtypes.DefaultEVMExtendedDenom
129128
evmGenesis.Params.ActiveStaticPrecompiles = evmtypes.AvailableStaticPrecompiles
130129
genesisState[evmtypes.ModuleName] = app.AppCodec().MustMarshalJSON(evmGenesis)
131130

x/vm/types/params.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ var (
2121
DefaultEVMDenom = "uatom"
2222
// DefaultEVMExtendedDenom is the default value for the evm extended denom
2323
DefaultEVMExtendedDenom = "aatom"
24+
// DefaultEVMDisplayDenom is the default value for the display denom in the bank metadata
25+
DefaultEVMDisplayDenom = "atom"
2426
// DefaultEVMChainID is the default value for the evm chain ID
2527
DefaultEVMChainID uint64 = 262144
2628
// DefaultEVMDecimals is the default value for the evm denom decimal precision

0 commit comments

Comments
 (0)