Skip to content

Commit

Permalink
appease linter; rm logs
Browse files Browse the repository at this point in the history
  • Loading branch information
MSalopek committed Jun 16, 2023
1 parent fdaed77 commit aa66dd8
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 19 deletions.
9 changes: 4 additions & 5 deletions tests/e2e/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@ func main() {

if happyPathOnly != nil && *happyPathOnly {
fmt.Println("=============== running happy path only ===============")
tr := ChangeoverTestRun()
tr.Run(changeoverSteps, *localSdkPath, *useGaia, *gaiaTag)
// tr := DefaultTestRun()
// tr.Run(happyPathSteps, *localSdkPath, *useGaia, *gaiaTag)
tr := DefaultTestRun()
tr.Run(happyPathSteps, *localSdkPath, *useGaia, *gaiaTag)
return
}

testRuns := []testRunWithSteps{
{ChangeoverTestRun(), changeoverSteps},
{DefaultTestRun(), happyPathSteps},
{DemocracyTestRun(true), democracySteps},
{DemocracyTestRun(false), rewardDenomConsumerSteps},
Expand Down Expand Up @@ -102,7 +101,7 @@ func (tr *TestRun) Run(steps []Step, localSdkPath string, useGaia bool, gaiaTag
tr.validateStringLiterals()
tr.startDocker()
tr.executeSteps(steps)
// tr.teardownDocker()
tr.teardownDocker()
}

type testRunWithSteps struct {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/steps_sovereign_changeover.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func stepsChangeoverToConsumer(consumerName string) []Step {
from: validatorID("alice"),
deposit: 10000001,
consumerChain: chainID(consumerName),
distributionChannel: "transfer", // consumer's channel end
distributionChannel: "channel-0", // consumer's channel end
spawnTime: 0,
initialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 111}, // 1 block after upgrade !important
},
Expand Down
4 changes: 1 addition & 3 deletions x/ccv/consumer/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,10 @@ func (am AppModule) OnChanOpenAck(

// First check if an existing transfer channel already exists.
transChannelID := am.keeper.GetDistributionTransmissionChannel(ctx)
am.keeper.Logger(ctx).Error("transChannelID", "transChannelID", transChannelID)
if found := am.keeper.TransferChannelExists(ctx, transChannelID); found {
am.keeper.Logger(ctx).Error("transChannelID", "NOT FOUND", "RETURNING")
return nil
}
am.keeper.Logger(ctx).Error("transChannelID", "FOUND", transChannelID)

// NOTE The handshake for this channel is handled by the ibc-go/transfer
// module. If the transfer-channel fails here (unlikely) then the transfer
// channel should be manually created and ccv parameters set accordingly.
Expand Down
5 changes: 1 addition & 4 deletions x/ccv/consumer/keeper/changeover.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package keeper

import (
"encoding/json"

sdk "github.com/cosmos/cosmos-sdk/types"
abci "github.com/tendermint/tendermint/abci/types"
)
Expand Down Expand Up @@ -32,8 +30,6 @@ func (k Keeper) ChangeoverToConsumer(ctx sdk.Context) (initialValUpdates []abci.
// populate cross chain validators states with initial valset
initialValUpdates = k.GetInitialValSet(ctx)
k.ApplyCCValidatorChanges(ctx, initialValUpdates)
buf, _ := json.Marshal(initialValUpdates)
k.Logger(ctx).Error("Changeover to consumer complete", "initialValUpdates", string(buf))

// Add validator updates to initialValUpdates, such that the "old" validators returned from standalone staking module
// are given zero power, and the provider validators are given their full power.
Expand All @@ -52,5 +48,6 @@ func (k Keeper) ChangeoverToConsumer(ctx sdk.Context) (initialValUpdates []abci.
// Therefore we set the PreCCV state to false so the endblocker caller doesn't call this method again.
k.DeletePreCCV(ctx)

k.Logger(ctx).Info("ICS changeover complete - you are now a consumer chain!")
return initialValUpdates
}
4 changes: 0 additions & 4 deletions x/ccv/consumer/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ func (k Keeper) InitGenesis(ctx sdk.Context, state *consumertypes.GenesisState)
k.SetPreCCVTrue(ctx)
k.MarkAsPrevStandaloneChain(ctx)
k.SetInitialValSet(ctx, state.InitialValSet)
k.Logger(ctx).Error("PRECCV CHAIN", "height", ctx.BlockHeight())
}
k.SetInitGenesisHeight(ctx, ctx.BlockHeight()) // Usually 0, but not the case for changeover chains

Expand Down Expand Up @@ -55,7 +54,6 @@ func (k Keeper) InitGenesis(ctx sdk.Context, state *consumertypes.GenesisState)
// initialValSet is checked in NewChain case by ValidateGenesis
// start a new chain
if state.NewChain {
k.Logger(ctx).Error("NEW CHAIN IN INIT GENESIS")
// create the provider client in InitGenesis for new consumer chain. CCV Handshake must be established with this client id.
clientID, err := k.clientKeeper.CreateClient(ctx, state.ProviderClientState, state.ProviderConsensusState)
if err != nil {
Expand All @@ -71,7 +69,6 @@ func (k Keeper) InitGenesis(ctx sdk.Context, state *consumertypes.GenesisState)

} else {
// chain restarts with the CCV channel established
k.Logger(ctx).Error("APPARENTLY IT'S NOT NEW")
if state.ProviderChannelId != "" {
// set provider channel ID
k.SetProviderChannel(ctx, state.ProviderChannelId)
Expand Down Expand Up @@ -106,7 +103,6 @@ func (k Keeper) InitGenesis(ctx sdk.Context, state *consumertypes.GenesisState)
}

if state.PreCCV {
k.Logger(ctx).Error("PRECCV SO RETURNING EMPTY VALSET AFTERALL...")
return []abci.ValidatorUpdate{}
}

Expand Down
2 changes: 0 additions & 2 deletions x/ccv/consumer/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,6 @@ func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.V
// that was just upgraded to include the consumer ccv module, execute changeover logic.
if am.keeper.IsPreCCV(ctx) {
initialValUpdates := am.keeper.ChangeoverToConsumer(ctx)
buf, _ := json.Marshal(initialValUpdates)
am.keeper.Logger(ctx).Error("ChangeoverToConsumer", string(buf))
return initialValUpdates
}

Expand Down

0 comments on commit aa66dd8

Please sign in to comment.