From 6a5853b4a86a61a9bed9d6b854d9247edb2c5de3 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Fri, 24 May 2024 13:23:06 +0200 Subject: [PATCH] docs: add diff to config --- docs/docs/features/democracy-modules.md | 32 ++++++++++++------------- docs/docusaurus.config.js | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/docs/features/democracy-modules.md b/docs/docs/features/democracy-modules.md index 36c9a6cfd9..c2f6f9b862 100644 --- a/docs/docs/features/democracy-modules.md +++ b/docs/docs/features/democracy-modules.md @@ -119,7 +119,7 @@ var ( genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), bank.AppModuleBasic{}, capability.AppModuleBasic{}, -- sdkstaking.AppModuleBasic{}, +- sdkstaking.AppModuleBasic{}, + ccvstaking.AppModuleBasic{}, // replace sdkstaking ... ) @@ -194,33 +194,33 @@ func NewApp(...) { + ) + + // Setting the standalone staking keeper is only needed for standalone to consumer changeover chains -+ // New chains using the democracy/staking do not need to set this ++ // New chains using the democracy/staking do not need to set this + app.ConsumerKeeper.SetStandaloneStakingKeeper(app.StakingKeeper) - // change the slashing keeper dependency + // change the slashing keeper dependency app.SlashingKeeper = slashingkeeper.NewKeeper( appCodec, legacyAmino, keys[slashingtypes.StoreKey], -- app.StakingKeeper, +- app.StakingKeeper, + &app.ConsumerKeeper, // ConsumerKeeper implements StakingKeeper interface authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - // register slashing module StakingHooks to the consumer keeper + // register slashing module StakingHooks to the consumer keeper + app.ConsumerKeeper = *app.ConsumerKeeper.SetHooks(app.SlashingKeeper.Hooks()) + consumerModule := consumer.NewAppModule(app.ConsumerKeeper, app.GetSubspace(consumertypes.ModuleName)) // register the module with module manager // replace the x/staking module app.MM = module.NewManager( - ... -- sdkstaking.NewAppModule(appCodec, &app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), + ... +- sdkstaking.NewAppModule(appCodec, &app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), + ccvstaking.NewAppModule(appCodec, *app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), - ... - ) + ... + ) } ``` @@ -440,9 +440,9 @@ func NewApp(...) { // register the module with module manager // replace the x/gov module app.MM = module.NewManager( -- sdkgov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper, IsProposalWhitelisted, app.GetSubspace(govtypes.ModuleName), IsModuleWhiteList), +- sdkgov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper, IsProposalWhitelisted, app.GetSubspace(govtypes.ModuleName), IsModuleWhiteList), + ccvgov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper, IsProposalWhitelisted, app.GetSubspace(govtypes.ModuleName), IsModuleWhiteList), - ... + ... ) } ``` @@ -462,9 +462,9 @@ Second, the remaining rewards get distributed to the consumer chain's Governator :::info The % that is sent to the provider chain corresponds to `1 - ConsumerRedistributionFraction`. -e.g. +e.g. `ConsumerRedistributionFraction = "0.75"` -`ConsumerRedistributionFraction = "0.75"` means that the consumer chain retains 75% of the rewards while 25% gets sent to the provider chain to be distributed to provider chain validators. +means that the consumer chain retains 75% of the rewards while 25% gets sent to the provider chain to be distributed as rewards to provider chain validators. ::: #### Integration @@ -490,7 +490,7 @@ var ( capability.AppModuleBasic{}, ccvstaking.AppModuleBasic{}, // make sure you first swap the staking keeper mint.AppModuleBasic{}, -- sdkdistr.AppModuleBasic{}, +- sdkdistr.AppModuleBasic{}, + ccvdistr.AppModuleBasic{}, ) ) @@ -511,11 +511,11 @@ func NewApp(...) { // register with the module manager app.MM = module.NewManager( ... -- sdkdistr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, *app.StakingKeeper, authtypes.FeeCollectorName, app.GetSubspace(distrtypes.ModuleName)), +- sdkdistr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, *app.StakingKeeper, authtypes.FeeCollectorName, app.GetSubspace(distrtypes.ModuleName)), + ccvdistr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, *app.StakingKeeper, authtypes.FeeCollectorName, app.GetSubspace(distrtypes.ModuleName)), ccvstaking.NewAppModule(appCodec, *app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), - ... + ... ) } ``` diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index c949763429..e73d5e2a21 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -190,7 +190,7 @@ const config = { prism: { theme: lightCodeTheme, darkTheme: darkCodeTheme, - additionalLanguages: ["protobuf", "go-module"], // https://prismjs.com/#supported-languages + additionalLanguages: ["protobuf", "go-module", "diff", "go"], // https://prismjs.com/#supported-languages }, // algolia: { // appId: "QLS2QSP47E",