Skip to content

Commit 01ad6c8

Browse files
authored
feat: cellarfees v2 changes (#289)
* WIP - cellarfees v2 protos * FeeTokenBalance(s) queries and helper functions * Remove previous upgrade wiring * Remove gravity keeper and hooks from cellarfees * Fix imports * Fix expected keeper * remove empty file * Initial update to auction handling * Wire up new param * Remove old upgrade files from build * Refactor cellarfees BeginBlocker * Update cellarfees keeper unit tests * Remove empty file * Fix broken unit tests and compiler errors * gofmt * WIP - fix integration tests * WIP - Integration test updates * Remove auction requirement that denom be prefixed with gravity * WIP - Integration test passing, fee acct usomm balance not going to 0 bug * Fix test and skip usomm in auction start logic * Linting * Remove old upgrades from linting rules * Add CLI commands for new queries * Fix bugs found in testing * Refactor FeeBalance methods/handler to iterate balances instead of token prices * Tweak comments and imports * Refactor beginAuction method * Comment in proto
1 parent 3157d97 commit 01ad6c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+5110
-1334
lines changed

app/app.go

+6-72
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ import (
9696
gravitykeeper "github.com/peggyjv/gravity-bridge/module/v4/x/gravity/keeper"
9797
gravitytypes "github.com/peggyjv/gravity-bridge/module/v4/x/gravity/types"
9898
appParams "github.com/peggyjv/sommelier/v7/app/params"
99-
v4 "github.com/peggyjv/sommelier/v7/app/upgrades/v4"
100-
v5 "github.com/peggyjv/sommelier/v7/app/upgrades/v5"
101-
v6 "github.com/peggyjv/sommelier/v7/app/upgrades/v6"
102-
v7 "github.com/peggyjv/sommelier/v7/app/upgrades/v7"
10399
"github.com/peggyjv/sommelier/v7/x/auction"
104100
auctionclient "github.com/peggyjv/sommelier/v7/x/auction/client"
105101
auctionkeeper "github.com/peggyjv/sommelier/v7/x/auction/keeper"
@@ -223,6 +219,7 @@ var (
223219
// incidentally this permission is also required to be able to send tokens from module accounts
224220
allowedReceivingModAcc = map[string]bool{
225221
axelarcorktypes.ModuleName: true,
222+
cellarfeestypes.ModuleName: true,
226223
}
227224

228225
_ simapp.App = (*SommelierApp)(nil)
@@ -492,7 +489,7 @@ func NewSommelierApp(
492489

493490
app.CellarFeesKeeper = cellarfeeskeeper.NewKeeper(
494491
appCodec, keys[cellarfeestypes.StoreKey], app.GetSubspace(cellarfeestypes.ModuleName),
495-
app.AccountKeeper, app.BankKeeper, app.MintKeeper, app.CorkKeeper, app.GravityKeeper, app.AuctionKeeper,
492+
app.AccountKeeper, app.BankKeeper, app.MintKeeper, app.CorkKeeper, app.AuctionKeeper,
496493
)
497494

498495
app.IncentivesKeeper = incentiveskeeper.NewKeeper(
@@ -506,7 +503,6 @@ func NewSommelierApp(
506503
app.GravityKeeper = *app.GravityKeeper.SetHooks(
507504
gravitytypes.NewMultiGravityHooks(
508505
app.CorkKeeper.Hooks(),
509-
app.CellarFeesKeeper.Hooks(),
510506
))
511507

512508
// register the proposal types
@@ -578,7 +574,7 @@ func NewSommelierApp(
578574
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
579575
cork.NewAppModule(app.CorkKeeper, appCodec),
580576
incentives.NewAppModule(app.IncentivesKeeper, app.DistrKeeper, app.BankKeeper, app.MintKeeper, appCodec),
581-
cellarfees.NewAppModule(app.CellarFeesKeeper, appCodec, app.AccountKeeper, app.BankKeeper, app.MintKeeper, app.CorkKeeper, app.GravityKeeper, app.AuctionKeeper),
577+
cellarfees.NewAppModule(app.CellarFeesKeeper, appCodec, app.AccountKeeper, app.BankKeeper, app.MintKeeper, app.CorkKeeper, app.AuctionKeeper),
582578
auction.NewAppModule(app.AuctionKeeper, app.BankKeeper, app.AccountKeeper, appCodec),
583579
pubsub.NewAppModule(appCodec, app.PubsubKeeper, app.StakingKeeper, app.GravityKeeper),
584580
)
@@ -713,7 +709,7 @@ func NewSommelierApp(
713709
cork.NewAppModule(app.CorkKeeper, appCodec),
714710
axelarcork.NewAppModule(app.AxelarCorkKeeper, appCodec),
715711
incentives.NewAppModule(app.IncentivesKeeper, app.DistrKeeper, app.BankKeeper, app.MintKeeper, appCodec),
716-
cellarfees.NewAppModule(app.CellarFeesKeeper, appCodec, app.AccountKeeper, app.BankKeeper, app.MintKeeper, app.CorkKeeper, app.GravityKeeper, app.AuctionKeeper),
712+
cellarfees.NewAppModule(app.CellarFeesKeeper, appCodec, app.AccountKeeper, app.BankKeeper, app.MintKeeper, app.CorkKeeper, app.AuctionKeeper),
717713
auction.NewAppModule(app.AuctionKeeper, app.BankKeeper, app.AccountKeeper, appCodec),
718714
pubsub.NewAppModule(appCodec, app.PubsubKeeper, app.StakingKeeper, app.GravityKeeper),
719715
)
@@ -969,75 +965,13 @@ func (app *SommelierApp) setupUpgradeStoreLoaders() {
969965

970966
var storeUpgrades *storetypes.StoreUpgrades = nil
971967

972-
if upgradeInfo.Name == v4.UpgradeName {
973-
storeUpgrades = &storetypes.StoreUpgrades{
974-
Added: []string{corktypes.ModuleName, cellarfeestypes.ModuleName},
975-
Deleted: []string{"allocation"},
976-
}
977-
}
978-
979-
if upgradeInfo.Name == v5.UpgradeName {
980-
storeUpgrades = &storetypes.StoreUpgrades{
981-
Added: []string{incentivestypes.ModuleName},
982-
}
983-
}
984-
985-
if upgradeInfo.Name == v6.UpgradeName {
986-
storeUpgrades = &storetypes.StoreUpgrades{
987-
Added: []string{icahosttypes.SubModuleName},
988-
}
989-
}
990-
991-
if upgradeInfo.Name == v7.UpgradeName {
992-
storeUpgrades = &storetypes.StoreUpgrades{
993-
Added: []string{auctiontypes.ModuleName, axelarcorktypes.ModuleName, cellarfeestypes.ModuleName, pubsubtypes.ModuleName},
994-
}
995-
}
968+
// TODO: Add v8 store loader when writing upgrade handler
996969

997970
if storeUpgrades != nil {
998971
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, storeUpgrades))
999972
}
1000973
}
1001974

1002975
func (app *SommelierApp) setupUpgradeHandlers() {
1003-
app.UpgradeKeeper.SetUpgradeHandler(
1004-
v4.UpgradeName,
1005-
v4.CreateUpgradeHandler(
1006-
app.mm,
1007-
app.configurator,
1008-
app.AccountKeeper,
1009-
app.BankKeeper,
1010-
),
1011-
)
1012-
1013-
app.UpgradeKeeper.SetUpgradeHandler(
1014-
v5.UpgradeName,
1015-
v5.CreateUpgradeHandler(
1016-
app.mm,
1017-
app.configurator,
1018-
app.IncentivesKeeper,
1019-
),
1020-
)
1021-
1022-
app.UpgradeKeeper.SetUpgradeHandler(
1023-
v6.UpgradeName,
1024-
v6.CreateUpgradeHandler(
1025-
app.mm,
1026-
app.configurator,
1027-
),
1028-
)
1029-
1030-
app.UpgradeKeeper.SetUpgradeHandler(
1031-
v7.UpgradeName,
1032-
v7.CreateUpgradeHandler(
1033-
app.mm,
1034-
app.configurator,
1035-
app.AuctionKeeper,
1036-
app.AxelarCorkKeeper,
1037-
app.CellarFeesKeeper,
1038-
app.CorkKeeper,
1039-
app.ICAHostKeeper,
1040-
app.PubsubKeeper,
1041-
),
1042-
)
976+
// TODO: Add v8 upgrade handler
1043977
}

app/upgrades/v4/upgrades.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build exclude
2+
13
package v4
24

35
import (

app/upgrades/v5/upgrades.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build exclude
2+
13
package v5
24

35
import (

app/upgrades/v6/upgrades.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build exclude
2+
13
package v6
24

35
import (

app/upgrades/v7/constants.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build exclude
2+
13
package v7
24

35
// UpgradeName defines the on-chain upgrade name for the Sommelier v7 upgrade

app/upgrades/v7/upgrades.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build exclude
2+
// +build exclude
3+
14
package v7
25

36
import (

0 commit comments

Comments
 (0)