-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Convert messenge encoder to message decorator * Implement and Test mint token message * Add TODOs for future refactoring * Update app/wasm/message_plugin.go Co-authored-by: Mauro Lacy <[email protected]> Co-authored-by: Mauro Lacy <[email protected]>
- Loading branch information
Showing
7 changed files
with
186 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,29 @@ | ||
package wasm | ||
|
||
import ( | ||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" | ||
|
||
"github.com/CosmWasm/wasmd/x/wasm" | ||
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" | ||
|
||
gammkeeper "github.com/osmosis-labs/osmosis/v7/x/gamm/keeper" | ||
) | ||
|
||
func RegisterCustomPlugins( | ||
wasmQueryPlugin *QueryPlugin, | ||
gammKeeper *gammkeeper.Keeper, | ||
bank *bankkeeper.BaseKeeper, | ||
) []wasmkeeper.Option { | ||
wasmQueryPlugin := NewQueryPlugin(gammKeeper) | ||
|
||
queryPluginOpt := wasmkeeper.WithQueryPlugins(&wasmkeeper.QueryPlugins{ | ||
Custom: CustomQuerier(wasmQueryPlugin), | ||
}) | ||
messagePluginOpt := wasmkeeper.WithMessageEncoders(&wasmkeeper.MessageEncoders{ | ||
Custom: CustomEncoder(wasmQueryPlugin), | ||
}) | ||
messangerDecoratorOpt := wasmkeeper.WithMessageHandlerDecorator( | ||
CustomMessageDecorator(gammKeeper, bank), | ||
) | ||
|
||
return []wasm.Option{ | ||
queryPluginOpt, | ||
messagePluginOpt, | ||
messangerDecoratorOpt, | ||
} | ||
} |