Skip to content

Commit

Permalink
add AfterNftUnlisted hook and description of it
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki1frsy committed Sep 12, 2022
1 parent a24050a commit 84c62c1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions x/ecosystem-incentive/spec/04_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The example hooks functions interfaces in x/nftmarket module:
type NftmarketHooks interface {
AfterNftListed(ctx sdk.Context, nft_id types.NftIdentifier, incentive_id string)
AfterNftPaid(ctx sdk.Context, nft_id types.NftIdentifier, fee_amount mathInt, fee_denom string)
AfterNftUnlisted(ctx sdk.Context, nft_id types.NftIdentifier)
}
```

Expand All @@ -22,3 +23,8 @@ To pass the `incentive_id` from the memo data of `MsgListNft` requires a method

This hooks function is called for the accumulation of the reward for the subjects which are connected with the `nft_id` in the argument.
The calculation of the actual reward amount is executed in methods which this hook function calls in this module.

## AfterNftUnlisted

This hook function is called when a nft is unlisted for some reason like liquidation.
The purpose is to remove the unlisted nft information from `IncentiveIdTable` KVStore to keep the data consystent.

0 comments on commit 84c62c1

Please sign in to comment.