Skip to content

Commit

Permalink
Change testnet chain id to 6633438
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianBorst committed Nov 20, 2024
1 parent e85471e commit ac697ce
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/ante/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (suite *AnteTestSuite) SetupTest() {
})

// nolint: exhaustruct
suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 2, ChainID: "althea_417834-1", Time: time.Now().UTC()})
suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 2, ChainID: "althea_6633438-1", Time: time.Now().UTC()})
suite.ctx = suite.ctx.WithMinGasPrices(sdk.NewDecCoins(sdk.NewDecCoin(altheaconfig.BaseDenom, sdk.OneInt())))
suite.ctx = suite.ctx.WithBlockGasMeter(sdk.NewGasMeter(1000000000000000000))

Expand Down
2 changes: 1 addition & 1 deletion ibcutils/testing/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type SenderAccount struct {
}

// ChainIDPrefix defines the default chain ID prefix for althea test chains
var ChainIDPrefixAlthea = "althea_417834-"
var ChainIDPrefixAlthea = "althea_6633438-"

// TestChain is a testing struct that wraps a simapp with the last TM Header, the current ABCI
// header and the validators of the TestChain. It also contains a field called ChainID. This
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/test_runner/src/bootstrapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ pub async fn start_ibc_relayer(
)
.await;
if althea_channel.is_err() {
info!("No IBC channels exist between althea_417834-1 and ibc-test-1, creating one now...");
info!("No IBC channels exist between althea_6633438-1 and ibc-test-1, creating one now...");
create_ibc_channel(hermes_base());
}
thread::spawn(|| {
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/test_runner/src/tests/onboarding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pub async fn onboarding_test(
Some(channel_id_timeout),
)
.await
.expect("Could not find ibc-test-1 <-> althea_417834-1 channel");
.expect("Could not find ibc-test-1 <-> althea_6633438-1 channel");

let TestSetupResults {
erc20_denom_on_ibc,
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/test_runner/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub fn get_test_token_name() -> String {

/// Returns the chain-id of the althea instance running, see ALTHEA CHAIN CONSTANTS above
pub fn get_chain_id() -> String {
"althea_417834-1".to_string()
"althea_6633438-1".to_string()
}

/// Returns the chain-id of the gaiad instance running, see IBC CHAIN CONSTANTS above
Expand Down
2 changes: 1 addition & 1 deletion tests/assets/ibc-relayer-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ port = 3001
# A chains section includes parameters related to a chain and the full node to which
# the relayer can send transactions and queries.
[[chains]]
id = 'althea_417834-1'
id = 'althea_6633438-1'
# Specify the RPC address and port where the chain RPC server listens on. Required
rpc_addr = 'http://localhost:26657'
# Specify the GRPC address and port where the chain GRPC server listens on. Required
Expand Down
2 changes: 1 addition & 1 deletion tests/container-scripts/setup-validators.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -eux
# your gaiad binary name
BIN=althea

CHAIN_ID="althea_417834-1"
CHAIN_ID="althea_6633438-1"

NODES=$1

Expand Down
64 changes: 61 additions & 3 deletions x/gasfree/module_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package gasfree_test

import (
"encoding/json"
"testing"
"time"

Expand Down Expand Up @@ -86,10 +87,41 @@ func (suite *GasfreeTestSuite) DoSetupTest(t require.TestingT) {
return genesis
})

coins := sdk.NewCoins(sdk.NewCoin(altheaconfig.BaseDenom, sdk.NewInt(100000000000000)))
genesisState := althea.ModuleBasics.DefaultGenesis(suite.app.AppCodec())
b32address := sdk.MustBech32ifyAddressBytes(sdk.GetConfig().GetBech32AccountAddrPrefix(), priv.PubKey().Address().Bytes())
balances := []banktypes.Balance{
{
Address: b32address,
Coins: coins,
},
{
Address: suite.app.AccountKeeper.GetModuleAddress(authtypes.FeeCollectorName).String(),
Coins: coins,
},
}
// Update total supply
bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, sdk.NewCoins(sdk.NewCoin(altheaconfig.BaseDenom, sdk.NewInt(200000000000000))), []banktypes.Metadata{})
genesisState[banktypes.ModuleName] = suite.app.AppCodec().MustMarshalJSON(bankGenesis)

stateBytes, err := tmjson.MarshalIndent(genesisState, "", " ")

Check failure on line 107 in x/gasfree/module_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: tmjson

Check failure on line 107 in x/gasfree/module_test.go

View workflow job for this annotation

GitHub Actions / Test

undefined: tmjson
require.NoError(t, err)

// Initialize the chain
suite.app.InitChain(
// nolint: exhaustruct
abci.RequestInitChain{
ChainId: "althea_6633438-1",
Validators: []abci.ValidatorUpdate{},
ConsensusParams: DefaultConsensusParams,
AppStateBytes: stateBytes,
},
)

// nolint: exhaustruct
suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{
Height: 1,
ChainID: "althea_417834-1",
ChainID: "althea_6633438-1",
Time: time.Now().UTC(),
ProposerAddress: consAddress.Bytes(),
// nolint: exhaustruct
Expand Down Expand Up @@ -139,8 +171,34 @@ func (suite *GasfreeTestSuite) DoSetupTest(t require.TestingT) {
}

// Setup initializes a new Althea app. A Nop logger is set in AltheaApp.
func Setup(isCheckTx bool, patchGenesis func(*althea.AltheaApp, simapp.GenesisState) simapp.GenesisState) *althea.AltheaApp {
return althea.NewSetup(isCheckTx, patchGenesis)
func Setup(isCheckTx bool, patchGenesis func(*althea.AltheaApp, althea.GenesisState) althea.GenesisState) *althea.AltheaApp {

Check failure on line 174 in x/gasfree/module_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: althea.GenesisState

Check failure on line 174 in x/gasfree/module_test.go

View workflow job for this annotation

GitHub Actions / Test

undefined: althea.GenesisState
db := dbm.NewMemDB()

Check failure on line 175 in x/gasfree/module_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: dbm

Check failure on line 175 in x/gasfree/module_test.go

View workflow job for this annotation

GitHub Actions / Test

undefined: dbm
app := althea.NewAltheaApp(tmlog.NewNopLogger(), db, nil, true, map[int64]bool{}, althea.DefaultNodeHome, 5, althea.MakeEncodingConfig(), simapp.EmptyAppOptions{})

Check failure on line 176 in x/gasfree/module_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: tmlog (typecheck)

Check failure on line 176 in x/gasfree/module_test.go

View workflow job for this annotation

GitHub Actions / Test

undefined: tmlog
if !isCheckTx {
// init chain must be called to stop deliverState from being nil
genesisState := althea.NewDefaultGenesisState()
if patchGenesis != nil {
genesisState = patchGenesis(app, genesisState)
}

stateBytes, err := json.MarshalIndent(genesisState, "", " ")
if err != nil {
panic(err)
}

// Initialize the chain
app.InitChain(
// nolint: exhaustruct
abci.RequestInitChain{
ChainId: "althea_6633438-1",
Validators: []abci.ValidatorUpdate{},
ConsensusParams: DefaultConsensusParams,
AppStateBytes: stateBytes,
},
)
}

return app
}

// DefaultConsensusParams defines the default Tendermint consensus params used in
Expand Down

0 comments on commit ac697ce

Please sign in to comment.