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

refactor: rename x/collection events #639

Merged
merged 4 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/collection) [\#621](https://github.com/line/lbm-sdk/pull/621) add additional information into EventXXXChanged
* (x/token) [\#636](https://github.com/line/lbm-sdk/pull/636) add creator into x/token EventIssue
* (x/token) [\#637](https://github.com/line/lbm-sdk/pull/637) rename x/token events
* (x/collection) [\#639](https://github.com/line/lbm-sdk/pull/639) rename x/collection events

### Bug Fixes
* (x/wasm) [\#453](https://github.com/line/lbm-sdk/pull/453) modify wasm grpc query api path
Expand Down
52 changes: 26 additions & 26 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -920,21 +920,21 @@
- [Permission](#lbm.collection.v1.Permission)

- [lbm/collection/v1/event.proto](#lbm/collection/v1/event.proto)
- [EventAbandon](#lbm.collection.v1.EventAbandon)
- [EventAttached](#lbm.collection.v1.EventAttached)
- [EventAuthorizedOperator](#lbm.collection.v1.EventAuthorizedOperator)
- [EventBurned](#lbm.collection.v1.EventBurned)
- [EventCreatedContract](#lbm.collection.v1.EventCreatedContract)
- [EventCreatedFTClass](#lbm.collection.v1.EventCreatedFTClass)
- [EventCreatedNFTClass](#lbm.collection.v1.EventCreatedNFTClass)
- [EventDetached](#lbm.collection.v1.EventDetached)
- [EventGrant](#lbm.collection.v1.EventGrant)
- [EventGranted](#lbm.collection.v1.EventGranted)
- [EventMintedFT](#lbm.collection.v1.EventMintedFT)
- [EventMintedNFT](#lbm.collection.v1.EventMintedNFT)
- [EventModifiedContract](#lbm.collection.v1.EventModifiedContract)
- [EventModifiedNFT](#lbm.collection.v1.EventModifiedNFT)
- [EventModifiedTokenClass](#lbm.collection.v1.EventModifiedTokenClass)
- [EventOwnerChanged](#lbm.collection.v1.EventOwnerChanged)
- [EventRenounced](#lbm.collection.v1.EventRenounced)
- [EventRevokedOperator](#lbm.collection.v1.EventRevokedOperator)
- [EventRootChanged](#lbm.collection.v1.EventRootChanged)
- [EventSent](#lbm.collection.v1.EventSent)
Expand Down Expand Up @@ -13829,25 +13829,6 @@ Permission enumerates the valid permissions on a contract.



<a name="lbm.collection.v1.EventAbandon"></a>

### EventAbandon
EventAbandon is emitted when a grantee abandons its permission.

Since: 0.46.0 (finschia)


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `contract_id` | [string](#string) | | contract id associated with the contract. |
| `grantee` | [string](#string) | | address of the grantee which abandons its grant. |
| `permission` | [Permission](#lbm.collection.v1.Permission) | | permission on the contract. |






<a name="lbm.collection.v1.EventAttached"></a>

### EventAttached
Expand Down Expand Up @@ -13994,10 +13975,10 @@ Since: 0.46.0 (finschia)



<a name="lbm.collection.v1.EventGrant"></a>
<a name="lbm.collection.v1.EventGranted"></a>

### EventGrant
EventGrant is emitted when a granter grants its permission to a grantee.
### EventGranted
EventGranted is emitted when a granter grants its permission to a grantee.

Info: `granter` would be empty if the permission is granted by an issuance.

Expand Down Expand Up @@ -14136,6 +14117,25 @@ Since: 0.46.0 (finschia)



<a name="lbm.collection.v1.EventRenounced"></a>

### EventRenounced
EventRenounced is emitted when a grantee renounced its permission.

Since: 0.46.0 (finschia)


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `contract_id` | [string](#string) | | contract id associated with the contract. |
| `grantee` | [string](#string) | | address of the grantee which abandons its grant. |
| `permission` | [Permission](#lbm.collection.v1.Permission) | | permission on the contract. |






<a name="lbm.collection.v1.EventRevokedOperator"></a>

### EventRevokedOperator
Expand Down Expand Up @@ -16011,8 +16011,8 @@ Msg defines the collection Msg service.
| `BurnNFT` | [MsgBurnNFT](#lbm.collection.v1.MsgBurnNFT) | [MsgBurnNFTResponse](#lbm.collection.v1.MsgBurnNFTResponse) | BurnNFT defines a method to burn non-fungible tokens. Fires: - EventBurned - burn_ft (deprecated, not typed) - burn_nft (deprecated, not typed) - operation_burn_nft (deprecated, not typed) Throws: - ErrUnauthorized - `from` does not have `burn` permission. - ErrInvalidRequest: - the balance of `from` does not have enough tokens to burn. | |
| `BurnNFTFrom` | [MsgBurnNFTFrom](#lbm.collection.v1.MsgBurnNFTFrom) | [MsgBurnNFTFromResponse](#lbm.collection.v1.MsgBurnNFTFromResponse) | BurnNFTFrom defines a method to burn non-fungible tokens of the approver by the proxy. Fires: - EventBurned - burn_ft_from (deprecated, not typed) - burn_nft_from (deprecated, not typed) - operation_burn_nft (deprecated, not typed) Throws: - ErrUnauthorized - `proxy` does not have `burn` permission. - the approver has not authorized `proxy`. - ErrInvalidRequest: - the balance of `from` does not have enough tokens to burn. | |
| `Modify` | [MsgModify](#lbm.collection.v1.MsgModify) | [MsgModifyResponse](#lbm.collection.v1.MsgModifyResponse) | Modify defines a method to modify metadata. Fires: - EventModifiedContract - modify_collection (deprecated, not typed) - EventModifiedTokenClass - modify_token_type (deprecated, not typed) - modify_token (deprecated, not typed) - EventModifiedNFT Throws: - ErrUnauthorized - the proxy does not have `modify` permission. - ErrNotFound - there is no contract of `contract_id`. - there is no token type of `token_type`. - there is no token of `token_id`. | |
| `GrantPermission` | [MsgGrantPermission](#lbm.collection.v1.MsgGrantPermission) | [MsgGrantPermissionResponse](#lbm.collection.v1.MsgGrantPermissionResponse) | GrantPermission allows one to mint or burn tokens or modify metadata. Fires: - EventGrant - grant_perm (deprecated, not typed) Throws: - ErrUnauthorized - `granter` does not have `permission`. - ErrInvalidRequest - `grantee` already has `permission`. | |
| `RevokePermission` | [MsgRevokePermission](#lbm.collection.v1.MsgRevokePermission) | [MsgRevokePermissionResponse](#lbm.collection.v1.MsgRevokePermissionResponse) | RevokePermission abandons a permission. Fires: - EventAbandon - revoke_perm (deprecated, not typed) Throws: - ErrUnauthorized - `grantee` does not have `permission`. | |
| `GrantPermission` | [MsgGrantPermission](#lbm.collection.v1.MsgGrantPermission) | [MsgGrantPermissionResponse](#lbm.collection.v1.MsgGrantPermissionResponse) | GrantPermission allows one to mint or burn tokens or modify metadata. Fires: - EventGranted - grant_perm (deprecated, not typed) Throws: - ErrUnauthorized - `granter` does not have `permission`. - ErrInvalidRequest - `grantee` already has `permission`. | |
| `RevokePermission` | [MsgRevokePermission](#lbm.collection.v1.MsgRevokePermission) | [MsgRevokePermissionResponse](#lbm.collection.v1.MsgRevokePermissionResponse) | RevokePermission abandons a permission. Fires: - EventRenounced - revoke_perm (deprecated, not typed) Throws: - ErrUnauthorized - `grantee` does not have `permission`. | |
| `Attach` | [MsgAttach](#lbm.collection.v1.MsgAttach) | [MsgAttachResponse](#lbm.collection.v1.MsgAttachResponse) | Attach defines a method to attach a token to another token. Fires: - EventAttach - attach (deprecated, not typed) - operation_root_changed (deprecated, not typed) Throws: - ErrInvalidRequest - `owner` does not owns `id`. - `owner` does not owns `to`. - `token_id` is not root. - `token_id` is an ancestor of `to_token_id`, which creates a cycle as a result. - depth of `to_token_id` exceeds an app-specific limit. | |
| `Detach` | [MsgDetach](#lbm.collection.v1.MsgDetach) | [MsgDetachResponse](#lbm.collection.v1.MsgDetachResponse) | Detach defines a method to detach a token from another token. Fires: - EventDetach - detach (deprecated, not typed) - operation_root_changed (deprecated, not typed) Throws: - ErrInvalidRequest - `owner` does not owns `token_id`. | |
| `AttachFrom` | [MsgAttachFrom](#lbm.collection.v1.MsgAttachFrom) | [MsgAttachFromResponse](#lbm.collection.v1.MsgAttachFromResponse) | AttachFrom defines a method to attach a token to another token by proxy. Fires: - EventAttach - attach_from (deprecated, not typed) - operation_root_changed (deprecated, not typed) Throws: - ErrUnauthorized - the approver has not authorized `proxy`. - ErrInvalidRequest - `owner` does not owns `subject`. - `owner` does not owns `target`. - `subject` is not root. - `subject` is an ancestor of `target`, which creates a cycle as a result. - depth of `to` exceeds an app-specific limit. | |
Expand Down
8 changes: 4 additions & 4 deletions proto/lbm/collection/v1/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ message EventCreatedNFTClass {
string meta = 5;
}

// EventGrant is emitted when a granter grants its permission to a grantee.
// EventGranted is emitted when a granter grants its permission to a grantee.
//
// Info: `granter` would be empty if the permission is granted by an issuance.
//
// Since: 0.46.0 (finschia)
message EventGrant {
message EventGranted {
// contract id associated with the contract.
string contract_id = 1;
// address of the granter which grants the permission.
Expand All @@ -182,10 +182,10 @@ message EventGrant {
Permission permission = 4;
}

// EventAbandon is emitted when a grantee abandons its permission.
// EventRenounced is emitted when a grantee renounced its permission.
//
// Since: 0.46.0 (finschia)
message EventAbandon {
message EventRenounced {
// contract id associated with the contract.
string contract_id = 1;
// address of the grantee which abandons its grant.
Expand Down
4 changes: 2 additions & 2 deletions proto/lbm/collection/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ service Msg {

// GrantPermission allows one to mint or burn tokens or modify metadata.
// Fires:
// - EventGrant
// - EventGranted
// - grant_perm (deprecated, not typed)
// Throws:
// - ErrUnauthorized
Expand All @@ -198,7 +198,7 @@ service Msg {

// RevokePermission abandons a permission.
// Fires:
// - EventAbandon
// - EventRenounced
// - revoke_perm (deprecated, not typed)
// Throws:
// - ErrUnauthorized
Expand Down
16 changes: 8 additions & 8 deletions x/collection/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@ func NewEventTransferNFTFrom(event EventSent) sdk.Events {
return res
}

// Deprecated: use EventGrant.
func NewEventGrantPermToken(event EventGrant) sdk.Event {
// Deprecated: use EventGranted.
func NewEventGrantPermToken(event EventGranted) sdk.Event {
eventType := EventTypeGrantPermToken.String()
attributes := map[AttributeKey]string{
AttributeKeyContractID: event.ContractId,
Expand All @@ -518,8 +518,8 @@ func NewEventGrantPermToken(event EventGrant) sdk.Event {
return res
}

// Deprecated: use EventGrant.
func NewEventGrantPermTokenHead(event EventGrant) sdk.Event {
// Deprecated: use EventGranted.
func NewEventGrantPermTokenHead(event EventGranted) sdk.Event {
eventType := EventTypeGrantPermToken.String()
attributes := map[AttributeKey]string{
AttributeKeyContractID: event.ContractId,
Expand All @@ -537,8 +537,8 @@ func NewEventGrantPermTokenHead(event EventGrant) sdk.Event {
return res
}

// Deprecated: use EventGrant.
func NewEventGrantPermTokenBody(event EventGrant) sdk.Event {
// Deprecated: use EventGranted.
func NewEventGrantPermTokenBody(event EventGranted) sdk.Event {
eventType := EventTypeGrantPermToken.String()
attributes := map[AttributeKey]string{
AttributeKeyPerm: LegacyPermission(event.Permission).String(),
Expand All @@ -552,8 +552,8 @@ func NewEventGrantPermTokenBody(event EventGrant) sdk.Event {
return res
}

// Deprecated: use EventAbandon.
func NewEventRevokePermToken(event EventAbandon) sdk.Event {
// Deprecated: use EventRenounced.
func NewEventRevokePermToken(event EventRenounced) sdk.Event {
eventType := EventTypeRevokePermToken.String()
attributes := map[AttributeKey]string{
AttributeKeyContractID: event.ContractId,
Expand Down
Loading