forked from osmosis-labs/osmosis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wasm.go
32 lines (27 loc) · 929 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
32
package wasmbinding
import (
"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
gammkeeper "github.com/Anmol1696/osmosis/v11/x/gamm/keeper"
tokenfactorykeeper "github.com/Anmol1696/osmosis/v11/x/tokenfactory/keeper"
twap "github.com/Anmol1696/osmosis/v11/x/twap"
)
func RegisterCustomPlugins(
gammKeeper *gammkeeper.Keeper,
bank *bankkeeper.BaseKeeper,
twap *twap.Keeper,
tokenFactory *tokenfactorykeeper.Keeper,
) []wasmkeeper.Option {
wasmQueryPlugin := NewQueryPlugin(gammKeeper, twap, tokenFactory)
queryPluginOpt := wasmkeeper.WithQueryPlugins(&wasmkeeper.QueryPlugins{
Custom: CustomQuerier(wasmQueryPlugin),
})
messengerDecoratorOpt := wasmkeeper.WithMessageHandlerDecorator(
CustomMessageDecorator(gammKeeper, bank, tokenFactory),
)
return []wasm.Option{
queryPluginOpt,
messengerDecoratorOpt,
}
}