Skip to content

Commit 06a96c3

Browse files
committed
resetting perpetual for upgrade
1 parent cb6237f commit 06a96c3

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package migrations
2+
3+
import (
4+
sdk "github.com/cosmos/cosmos-sdk/types"
5+
)
6+
7+
// Need to do this for testnet upgrade testing as some features is being removed from testnet
8+
func (m Migrator) V22Migration(_ sdk.Context) error {
9+
return nil
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package migrations
2+
3+
import (
4+
sdk "github.com/cosmos/cosmos-sdk/types"
5+
)
6+
7+
// Need to do this for testnet upgrade testing as some features is being removed from testnet
8+
func (m Migrator) V23Migration(_ sdk.Context) error {
9+
return nil
10+
}

x/perpetual/module.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
129129
if err != nil {
130130
panic(err)
131131
}
132+
133+
err = cfg.RegisterMigration(types.ModuleName, 21, m.V22Migration)
134+
if err != nil {
135+
panic(err)
136+
}
137+
138+
err = cfg.RegisterMigration(types.ModuleName, 22, m.V23Migration)
139+
if err != nil {
140+
panic(err)
141+
}
132142
}
133143

134144
// RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted)
@@ -152,7 +162,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw
152162
}
153163

154164
// ConsensusVersion is a sequence number for state-breaking change of the module. It should be incremented on each consensus-breaking change introduced by the module. To avoid wrong/empty versions, the initial version should be set to 1
155-
func (AppModule) ConsensusVersion() uint64 { return 21 }
165+
func (AppModule) ConsensusVersion() uint64 { return 23 }
156166

157167
// BeginBlock contains the logic that is automatically triggered at the beginning of each block
158168
func (am AppModule) BeginBlock(gotCtx context.Context) error {

0 commit comments

Comments
 (0)