Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hooks in x/nftmarket and Method to get memo to pass in the hook #218

Closed
taiki1frsh opened this issue Aug 2, 2022 · 3 comments
Closed

Hooks in x/nftmarket and Method to get memo to pass in the hook #218

taiki1frsh opened this issue Aug 2, 2022 · 3 comments
Assignees

Comments

@taiki1frsh
Copy link
Collaborator

taiki1frsh commented Aug 2, 2022

For the frontend-incentive module, I'd like x/nftmarket module to have hooks for the timing of listing NFT and ending listing.

The hook style reference is here:
https://github.com/UnUniFi/chain/blob/main/x/cdp/types/hooks.go
https://github.com/UnUniFi/chain/blob/main/x/cdp/keeper/hooks.go

This hook style doesn't create the two-way interaction between the modules using the hooks.

And, in the listing creation hook, a memo data is required to be in.

@taiki1frsh taiki1frsh changed the title Hooks in x/nftmarket Hooks in x/nftmarket and Method to get memo to pass in the hook Aug 2, 2022
@taiki1frsh
Copy link
Collaborator Author

taiki1frsh commented Aug 2, 2022

The possible Nftmarket hooks interface:

type NftmarketHooks interface {
   AfterNftListed(ctx sdk.Context, nft_id types.NftIdentifier, incentive_id string)
   AfterNftPaid(ctx sdk.Context, nft_id types.NftIdentifiler, fee_amount mathInt, fee_denom string)
}

@taiki1frsh
Copy link
Collaborator Author

The reference to get memo data in a specific tx that contrains specific message:
https://github.com/UnUniFi/chain/blob/how_to_get_memo/x/nftmint/keeper/get_memo.go

// memo, err := k.keeper.GetMemo(ctx)

This was referenced Aug 3, 2022
@taiki1frsh
Copy link
Collaborator Author

I'll work on this for ecosystem-incentive module, but this has to be done in nftmarket module.
So I'll make a change on newDevelep on the other branch than the fundamental part of the ecosystem-incentive module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant