Skip to content

Commit

Permalink
fix: channel not registered error (#934)
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonberg1997 authored Mar 27, 2023
1 parent 36a5e19 commit b3a0753
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,11 +563,6 @@ func (app *BinanceChain) initStaking() {
if sdkErr != nil {
panic(sdkErr.Error())
}
crossStakeApp := cStake.NewCrossStakeApp(app.stakeKeeper)
err := app.scKeeper.RegisterChannel(sTypes.CrossStakeChannel, sTypes.CrossStakeChannelID, crossStakeApp)
if err != nil {
panic(err)
}
})
upgrade.Mgr.RegisterBeginBlocker(sdk.BEP159, func(ctx sdk.Context) {
stake.MigrateValidatorDistributionAddr(ctx, app.stakeKeeper)
Expand All @@ -589,12 +584,11 @@ func (app *BinanceChain) initStaking() {
app.stakeKeeper.SubscribeBCParamChange(app.ParamHub)
app.stakeKeeper = app.stakeKeeper.WithHooks(app.slashKeeper.Hooks())

if sdk.IsUpgrade(sdk.BEP153) {
crossStakeApp := cStake.NewCrossStakeApp(app.stakeKeeper)
err := app.scKeeper.RegisterChannel(sTypes.CrossStakeChannel, sTypes.CrossStakeChannelID, crossStakeApp)
if err != nil {
panic(err)
}
// register cross stake channel
crossStakeApp := cStake.NewCrossStakeApp(app.stakeKeeper)
err := app.scKeeper.RegisterChannel(sTypes.CrossStakeChannel, sTypes.CrossStakeChannelID, crossStakeApp)
if err != nil {
panic(err)
}
}

Expand Down Expand Up @@ -938,8 +932,8 @@ func (app *BinanceChain) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) a
fees.Pool.Clear()
// just clean it, no matter use it or not.
pub.Pool.Clean()
//match may end with transaction failure, which is better to save into
//the EndBlock response. However, current cosmos doesn't support this.
// match may end with transaction failure, which is better to save into
// the EndBlock response. However, current cosmos doesn't support this.
return abci.ResponseEndBlock{
ValidatorUpdates: validatorUpdates,
Events: ctx.EventManager().ABCIEvents(),
Expand Down Expand Up @@ -1191,7 +1185,7 @@ func (app *BinanceChain) publish(tradesToPublish []*pub.Trade, proposalsToPublis
accountsToPublish,
latestPriceLevels,
blockFee,
app.DexKeeper.RoundOrderFees, //only use DexKeeper RoundOrderFees
app.DexKeeper.RoundOrderFees, // only use DexKeeper RoundOrderFees
transferToPublish,
blockToPublish)

Expand Down

0 comments on commit b3a0753

Please sign in to comment.