forked from osmosis-labs/osmosis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wasm.go
31 lines (25 loc) · 829 Bytes
/
wasm.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package wasm
import (
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
tokenfactorykeeper "github.com/PaddyMc/osmosis/v8/x/tokenfactory/keeper"
"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
gammkeeper "github.com/PaddyMc/osmosis/v8/x/gamm/keeper"
)
func RegisterCustomPlugins(
gammKeeper *gammkeeper.Keeper,
bank *bankkeeper.BaseKeeper,
tokenFactory *tokenfactorykeeper.Keeper,
) []wasmkeeper.Option {
wasmQueryPlugin := NewQueryPlugin(gammKeeper)
queryPluginOpt := wasmkeeper.WithQueryPlugins(&wasmkeeper.QueryPlugins{
Custom: CustomQuerier(wasmQueryPlugin),
})
messengerDecoratorOpt := wasmkeeper.WithMessageHandlerDecorator(
CustomMessageDecorator(gammKeeper, bank, tokenFactory),
)
return []wasm.Option{
queryPluginOpt,
messengerDecoratorOpt,
}
}