Skip to content

Commit

Permalink
register module
Browse files Browse the repository at this point in the history
  • Loading branch information
amityadav0 committed Jun 14, 2024
1 parent af24964 commit 5b71cab
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions wasmbindings/client/register_custom_plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import (
perpetualkeeper "github.com/elys-network/elys/x/perpetual/keeper"
stablestakeclientwasm "github.com/elys-network/elys/x/stablestake/client/wasm"
stablestakekeeper "github.com/elys-network/elys/x/stablestake/keeper"
tierclientwasm "github.com/elys-network/elys/x/tier/client/wasm"
tierkeeper "github.com/elys-network/elys/x/tier/keeper"
tokenomicsclientwasm "github.com/elys-network/elys/x/tokenomics/client/wasm"
tokenomicskeeper "github.com/elys-network/elys/x/tokenomics/keeper"
transferhookclientwasm "github.com/elys-network/elys/x/transferhook/client/wasm"
Expand Down Expand Up @@ -65,6 +67,7 @@ func RegisterCustomPlugins(
transferhook *transferhookkeeper.Keeper,
masterchef *masterchefkeeper.Keeper,
estaking *estakingkeeper.Keeper,
tier *tierkeeper.Keeper,
) []wasmkeeper.Option {
accountedpoolQuerier := accountedpoolclientwasm.NewQuerier(accountedpool)
accountedpoolMessenger := accountedpoolclientwasm.NewMessenger(accountedpool)
Expand Down Expand Up @@ -120,6 +123,9 @@ func RegisterCustomPlugins(
estakingQuerier := estakingclientwasm.NewQuerier(estaking)
estakingMessenger := estakingclientwasm.NewMessenger(estaking, parameter)

tierQuerier := tierclientwasm.NewQuerier(tier)
tierMessenger := tierclientwasm.NewMessenger(tier, parameter)

moduleQueriers := []types.ModuleQuerier{
accountedpoolQuerier,
ammQuerier,
Expand All @@ -139,6 +145,7 @@ func RegisterCustomPlugins(
transferhookQuerier,
masterchefQuerier,
estakingQuerier,
tierQuerier,
}

wasmQueryPlugin := types.NewQueryPlugin(
Expand All @@ -163,6 +170,7 @@ func RegisterCustomPlugins(
transferhook,
masterchef,
estaking,
tier,
)

queryPluginOpt := wasmkeeper.WithQueryPlugins(&wasmkeeper.QueryPlugins{
Expand All @@ -188,6 +196,7 @@ func RegisterCustomPlugins(
transferhookMessenger,
masterchefMessenger,
estakingMessenger,
tierMessenger,
}

messengerDecoratorOpt := wasmkeeper.WithMessageHandlerDecorator(
Expand All @@ -213,6 +222,7 @@ func RegisterCustomPlugins(
transferhook,
masterchef,
estaking,
tier,
),
)
return []wasm.Option{
Expand Down
3 changes: 3 additions & 0 deletions wasmbindings/types/custom_message_decorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
parameterkeeper "github.com/elys-network/elys/x/parameter/keeper"
perpetualkeeper "github.com/elys-network/elys/x/perpetual/keeper"
stablestakekeeper "github.com/elys-network/elys/x/stablestake/keeper"
tierkeeper "github.com/elys-network/elys/x/tier/keeper"
tokenomicskeeper "github.com/elys-network/elys/x/tokenomics/keeper"
transferhookkeeper "github.com/elys-network/elys/x/transferhook/keeper"
)
Expand All @@ -46,6 +47,7 @@ func CustomMessageDecorator(
transferhook *transferhookkeeper.Keeper,
masterchef *masterchefkeeper.Keeper,
estaking *estakingkeeper.Keeper,
tier *tierkeeper.Keeper,
) func(wasmkeeper.Messenger) wasmkeeper.Messenger {
return func(old wasmkeeper.Messenger) wasmkeeper.Messenger {
return &CustomMessenger{
Expand All @@ -71,6 +73,7 @@ func CustomMessageDecorator(
transferhook: transferhook,
masterchef: masterchef,
estaking: estaking,
tier: tier,
}
}
}
3 changes: 3 additions & 0 deletions wasmbindings/types/new_query_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
parameterkeeper "github.com/elys-network/elys/x/parameter/keeper"
perpetualkeeper "github.com/elys-network/elys/x/perpetual/keeper"
stablestakekeeper "github.com/elys-network/elys/x/stablestake/keeper"
tierkeeper "github.com/elys-network/elys/x/tier/keeper"
tokenomicskeeper "github.com/elys-network/elys/x/tokenomics/keeper"
transferhookkeeper "github.com/elys-network/elys/x/transferhook/keeper"
)
Expand Down Expand Up @@ -46,6 +47,7 @@ func NewQueryPlugin(
transferhook *transferhookkeeper.Keeper,
masterchef *masterchefkeeper.Keeper,
estaking *estakingkeeper.Keeper,
tier *tierkeeper.Keeper,
) *QueryPlugin {
return &QueryPlugin{
moduleQueriers: moduleQueriers,
Expand All @@ -69,5 +71,6 @@ func NewQueryPlugin(
transferhookKeeper: transferhook,
masterchefKeeper: masterchef,
estakingKeeper: estaking,
tierKeeper: tier,
}
}
3 changes: 3 additions & 0 deletions wasmbindings/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
perpetualtypes "github.com/elys-network/elys/x/perpetual/types"
stablestakekeeper "github.com/elys-network/elys/x/stablestake/keeper"
stablestaketypes "github.com/elys-network/elys/x/stablestake/types"
tierkeeper "github.com/elys-network/elys/x/tier/keeper"
tiertypes "github.com/elys-network/elys/x/tier/types"
tokenomicskeeper "github.com/elys-network/elys/x/tokenomics/keeper"
tokenomicstypes "github.com/elys-network/elys/x/tokenomics/types"
Expand Down Expand Up @@ -87,6 +88,7 @@ type QueryPlugin struct {
tokenomicsKeeper *tokenomicskeeper.Keeper
transferhookKeeper *transferhookkeeper.Keeper
estakingKeeper *estakingkeeper.Keeper
tierKeeper *tierkeeper.Keeper
}

// AllCapabilities returns all capabilities available with the current wasmvm
Expand Down Expand Up @@ -261,6 +263,7 @@ type CustomMessenger struct {
staking *stakingkeeper.Keeper
tokenomics *tokenomicskeeper.Keeper
transferhook *transferhookkeeper.Keeper
tier *tierkeeper.Keeper
}

type ElysMsg struct {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5b71cab

Please sign in to comment.