Skip to content

Commit

Permalink
Merge branch 'main' into nullpointer0x00/attribute-param-store-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
nullpointer0x00 authored Apr 15, 2024
2 parents 0b683b6 + 14908f1 commit 1c8a944
Show file tree
Hide file tree
Showing 84 changed files with 53,431 additions and 13,878 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Add store for crisis module for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
* Add PreBlocker support for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
* Add the Sanction module back in [#1922](https://github.com/provenance-io/provenance/pull/1922).
* Add the Quarantine module back in [#1926](https://github.com/provenance-io/provenance/pull/1926).

### Improvements

Expand Down
64 changes: 31 additions & 33 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ import (
icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v8/keeper"
icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types"

// "github.com/cosmos/cosmos-sdk/x/quarantine" // TODO[1760]: quarantine
// quarantinekeeper "github.com/cosmos/cosmos-sdk/x/quarantine/keeper" // TODO[1760]: quarantine
// quarantinemodule "github.com/cosmos/cosmos-sdk/x/quarantine/module" // TODO[1760]: quarantine

dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -175,7 +171,9 @@ import (
oraclekeeper "github.com/provenance-io/provenance/x/oracle/keeper"
oraclemodule "github.com/provenance-io/provenance/x/oracle/module"
oracletypes "github.com/provenance-io/provenance/x/oracle/types"

"github.com/provenance-io/provenance/x/quarantine"
quarantinekeeper "github.com/provenance-io/provenance/x/quarantine/keeper"
quarantinemodule "github.com/provenance-io/provenance/x/quarantine/module"
"github.com/provenance-io/provenance/x/sanction"
sanctionkeeper "github.com/provenance-io/provenance/x/sanction/keeper"
sanctionmodule "github.com/provenance-io/provenance/x/sanction/module"
Expand Down Expand Up @@ -249,23 +247,23 @@ type App struct {
memKeys map[string]*storetypes.MemoryStoreKey

// keepers
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
CapabilityKeeper *capabilitykeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
MintKeeper mintkeeper.Keeper
DistrKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
CrisisKeeper *crisiskeeper.Keeper
UpgradeKeeper *upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
AuthzKeeper authzkeeper.Keeper
GroupKeeper groupkeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
MsgFeesKeeper msgfeeskeeper.Keeper
// QuarantineKeeper quarantinekeeper.Keeper // TODO[1760]: quarantine
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
CapabilityKeeper *capabilitykeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
MintKeeper mintkeeper.Keeper
DistrKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
CrisisKeeper *crisiskeeper.Keeper
UpgradeKeeper *upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
AuthzKeeper authzkeeper.Keeper
GroupKeeper groupkeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
MsgFeesKeeper msgfeeskeeper.Keeper
QuarantineKeeper quarantinekeeper.Keeper
SanctionKeeper sanctionkeeper.Keeper
TriggerKeeper triggerkeeper.Keeper
OracleKeeper oraclekeeper.Keeper
Expand Down Expand Up @@ -377,7 +375,7 @@ func New(
nametypes.StoreKey,
msgfeestypes.StoreKey,
wasmtypes.StoreKey,
// quarantine.StoreKey, // TODO[1760]: quarantine
quarantine.StoreKey,
sanction.StoreKey,
triggertypes.StoreKey,
oracletypes.StoreKey,
Expand Down Expand Up @@ -562,8 +560,8 @@ func New(
)

markerReqAttrBypassAddrs := []sdk.AccAddress{
authtypes.NewModuleAddress(authtypes.FeeCollectorName), // Allow collecting fees in restricted coins.
// authtypes.NewModuleAddress(quarantine.ModuleName), // Allow quarantine to hold onto restricted coins. // TODO[1760]: quarantine
authtypes.NewModuleAddress(authtypes.FeeCollectorName), // Allow collecting fees in restricted coins.
authtypes.NewModuleAddress(quarantine.ModuleName), // Allow quarantine to hold onto restricted coins.
authtypes.NewModuleAddress(govtypes.ModuleName), // Allow restricted coins in deposits.
authtypes.NewModuleAddress(distrtypes.ModuleName), // Allow fee denoms to be restricted coins.
authtypes.NewModuleAddress(stakingtypes.BondedPoolName), // Allow bond denom to be a restricted coin.
Expand Down Expand Up @@ -691,7 +689,7 @@ func New(
for mName := range maccPerms {
unsanctionableAddrs = append(unsanctionableAddrs, authtypes.NewModuleAddress(mName))
}
// unsanctionableAddrs = append(unsanctionableAddrs, authtypes.NewModuleAddress(quarantine.ModuleName)) // TODO[1760]: quarantine
unsanctionableAddrs = append(unsanctionableAddrs, authtypes.NewModuleAddress(quarantine.ModuleName))
app.SanctionKeeper = sanctionkeeper.NewKeeper(appCodec, keys[sanction.StoreKey],
app.BankKeeper, &app.GovKeeper,
govAuthority, unsanctionableAddrs)
Expand Down Expand Up @@ -737,7 +735,7 @@ func New(
// If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper

// app.QuarantineKeeper = quarantinekeeper.NewKeeper(appCodec, keys[quarantine.StoreKey], app.BankKeeper, authtypes.NewModuleAddress(quarantine.ModuleName)) // TODO[1760]: quarantine
app.QuarantineKeeper = quarantinekeeper.NewKeeper(appCodec, keys[quarantine.StoreKey], app.BankKeeper, authtypes.NewModuleAddress(quarantine.ModuleName))

/**** Module Options ****/

Expand Down Expand Up @@ -766,7 +764,7 @@ func New(
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
// quarantinemodule.NewAppModule(appCodec, app.QuarantineKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), // TODO[1760]: quarantine
quarantinemodule.NewAppModule(appCodec, app.QuarantineKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
sanctionmodule.NewAppModule(appCodec, app.SanctionKeeper, app.AccountKeeper, app.BankKeeper, app.GovKeeper, app.interfaceRegistry),

// PROVENANCE
Expand Down Expand Up @@ -851,7 +849,7 @@ func New(
icqtypes.ModuleName,
nametypes.ModuleName,
vestingtypes.ModuleName,
// quarantine.ModuleName, // TODO[1760]: quarantine
quarantine.ModuleName,
sanction.ModuleName,
hold.ModuleName,
exchange.ModuleName,
Expand Down Expand Up @@ -892,7 +890,7 @@ func New(
markertypes.ModuleName,
feegrant.ModuleName,
paramstypes.ModuleName,
// quarantine.ModuleName, // TODO[1760]: quarantine
quarantine.ModuleName,
sanction.ModuleName,
hold.ModuleName,
exchange.ModuleName,
Expand Down Expand Up @@ -920,7 +918,7 @@ func New(
authz.ModuleName,
group.ModuleName,
feegrant.ModuleName,
// quarantine.ModuleName, // TODO[1760]: quarantine
quarantine.ModuleName,
sanction.ModuleName,

nametypes.ModuleName,
Expand Down Expand Up @@ -967,7 +965,7 @@ func New(
ibctransfertypes.ModuleName,
upgradetypes.ModuleName,
vestingtypes.ModuleName,
// quarantine.ModuleName, // TODO[1760]: quarantine
quarantine.ModuleName,
sanction.ModuleName,
hold.ModuleName,
exchange.ModuleName,
Expand Down Expand Up @@ -1009,7 +1007,7 @@ func New(
evidence.NewAppModule(app.EvidenceKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
// quarantinemodule.NewAppModule(appCodec, app.QuarantineKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), // TODO[1760]: quarantine
quarantinemodule.NewAppModule(appCodec, app.QuarantineKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
sanctionmodule.NewAppModule(appCodec, app.SanctionKeeper, app.AccountKeeper, app.BankKeeper, app.GovKeeper, app.interfaceRegistry),

metadata.NewAppModule(appCodec, app.MetadataKeeper, app.AccountKeeper),
Expand Down
4 changes: 2 additions & 2 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
evidencetypes "cosmossdk.io/x/evidence/types"

icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types"
// "github.com/cosmos/cosmos-sdk/x/quarantine" // TODO[1760]: quarantine

dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/cosmos-sdk/baseapp"
Expand Down Expand Up @@ -56,6 +55,7 @@ import (
metadatatypes "github.com/provenance-io/provenance/x/metadata/types"
msgfeetype "github.com/provenance-io/provenance/x/msgfees/types"
nametypes "github.com/provenance-io/provenance/x/name/types"
"github.com/provenance-io/provenance/x/quarantine"
"github.com/provenance-io/provenance/x/sanction"
triggertypes "github.com/provenance-io/provenance/x/trigger/types"
)
Expand Down Expand Up @@ -295,7 +295,7 @@ func TestAppImportExport(t *testing.T) {
{app.keys[evidencetypes.StoreKey], newApp.keys[evidencetypes.StoreKey], [][]byte{}},
{app.keys[capabilitytypes.StoreKey], newApp.keys[capabilitytypes.StoreKey], [][]byte{}},
{app.keys[authzkeeper.StoreKey], newApp.keys[authzkeeper.StoreKey], [][]byte{authzkeeper.GrantKey, authzkeeper.GrantQueuePrefix}},
// {app.keys[quarantine.StoreKey], newApp.keys[quarantine.StoreKey], [][]byte{}}, // TODO[1760]: quarantine
{app.keys[quarantine.StoreKey], newApp.keys[quarantine.StoreKey], [][]byte{}},
{app.keys[sanction.StoreKey], newApp.keys[sanction.StoreKey], [][]byte{}},

{app.keys[markertypes.StoreKey], newApp.keys[markertypes.StoreKey], [][]byte{}},
Expand Down
7 changes: 7 additions & 0 deletions client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@
"url": "./tmp-swagger-gen/cosmos/sanction/v1beta1/tx.swagger.json"
},

{
"url": "./tmp-swagger-gen/cosmos/quarantine/v1beta1/query.swagger.json"
},
{
"url": "./tmp-swagger-gen/cosmos/quarantine/v1beta1/tx.swagger.json"
},

{
"url": "./tmp-swagger-gen/provenance/trigger/v1/query.swagger.json"
},
Expand Down
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

Loading

0 comments on commit 1c8a944

Please sign in to comment.