Skip to content

Commit

Permalink
add events to mint nft response
Browse files Browse the repository at this point in the history
  • Loading branch information
slandymani committed Sep 27, 2024
1 parent 7830833 commit 32328ed
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
16 changes: 16 additions & 0 deletions kvasir/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func keysCmd(c *Context) *cobra.Command {
keysDeleteCmd(c),
keysListCmd(c),
keysShowCmd(c),
ImportKeyHexCommand(),
)
return cmd
}
Expand Down Expand Up @@ -140,6 +141,21 @@ func keysDeleteCmd(c *Context) *cobra.Command {
return cmd
}

func ImportKeyHexCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "import-hex <name> <hex>",
Short: "Import private keys into the local keybase",
Long: "Import hex encoded private key into the local keybase.\nSupported key-types can be obtained with:\n list-key-types",
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
keyType, _ := cmd.Flags().GetString(flags.FlagKeyType)
return kb.ImportPrivKeyHex(args[0], args[1], keyType)
},
}
cmd.Flags().String(flags.FlagKeyType, string(hd.Secp256k1Type), "private key signing algorithm kind")
return cmd
}

func keysListCmd(c *Context) *cobra.Command {
cmd := &cobra.Command{
Use: "list",
Expand Down
15 changes: 14 additions & 1 deletion x/onft/keeper/wasm_hander_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
wasmkeeper "github.com/ODIN-PROTOCOL/wasmd/x/wasm/keeper"
wasmtypes "github.com/ODIN-PROTOCOL/wasmd/x/wasm/types"
wasmvmtypes "github.com/ODIN-PROTOCOL/wasmvm/v2/types"
abci "github.com/cometbft/cometbft/abci/types"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down Expand Up @@ -68,7 +69,19 @@ func NewMintNFTMessageHandler(onftKeeper Keeper) MessageHandlerFunc {
With("module", fmt.Sprintf("x/%s", wasmtypes.ModuleName)).
Info("Minted NFT", "id", nftID)

return nil, nil, nil, nil
events = []sdk.Event{
{
Type: "nft",
Attributes: []abci.EventAttribute{
{
Key: "nft_id",
Value: nftID,
},
},
},
}

return events, nil, nil, nil
}

return nil, nil, nil, wasmtypes.ErrUnknownMsg
Expand Down

0 comments on commit 32328ed

Please sign in to comment.