Skip to content

Commit

Permalink
update spec
Browse files Browse the repository at this point in the history
  • Loading branch information
catShaark committed Sep 18, 2024
1 parent f82ab74 commit f4c1ede
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions x/asset/spec/06_logic.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ type Privilege interface {
RegisterInterfaces()
MsgHandler() MsgHandler
QueryHandler() QueryHandler
CLI() *cobra.Command
}

type MsgHandler func(context Context, privMsg PrivilegeMsg) error
type MsgHandler func(context Context, privMsg PrivilegeMsg, tokenID string, privAcc sdk.AccAddress) error

type QueryHandler func(context Context, privQuery PrivilegeQuery) error
type QueryHandler func(context Context, privQuery PrivilegeQuery, tokenID string) error
```

This interface provides all the functionality necessary for a privilege, including a message handler, query handler and cli
Expand All @@ -58,6 +57,5 @@ Validation:

Flow:

- Prepare store for the privilege of the token via `MakePrivilegeStore(privilege name, token denom)`. That store is the only store accessable by the privilege's `MsgHandler`.
- `PrivilegeManager` routes the `PrivilegeMsg` to the its `MsgHandler`.
- `MsgHandler` now handles the `PrivilegeMsg`.

0 comments on commit f4c1ede

Please sign in to comment.