Skip to content

Commit

Permalink
refactor: rename x/token events (#637)
Browse files Browse the repository at this point in the history
* Rename events

* Update CHANGELOG.md

* Fix the unchanged comment
  • Loading branch information
0Tech committed Aug 16, 2022
1 parent 09aace5 commit a2fff76
Show file tree
Hide file tree
Showing 8 changed files with 207 additions and 206 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/token) [\#609](https://github.com/line/lbm-sdk/pull/609) remove new APIs on x/token
* (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

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

- [lbm/token/v1/event.proto](#lbm/token/v1/event.proto)
- [EventAbandon](#lbm.token.v1.EventAbandon)
- [EventAuthorizedOperator](#lbm.token.v1.EventAuthorizedOperator)
- [EventBurned](#lbm.token.v1.EventBurned)
- [EventGrant](#lbm.token.v1.EventGrant)
- [EventIssue](#lbm.token.v1.EventIssue)
- [EventGranted](#lbm.token.v1.EventGranted)
- [EventIssued](#lbm.token.v1.EventIssued)
- [EventMinted](#lbm.token.v1.EventMinted)
- [EventModified](#lbm.token.v1.EventModified)
- [EventRenounced](#lbm.token.v1.EventRenounced)
- [EventRevokedOperator](#lbm.token.v1.EventRevokedOperator)
- [EventSent](#lbm.token.v1.EventSent)

Expand Down Expand Up @@ -17464,25 +17464,6 @@ Permission enumerates the valid permissions on a token class.



<a name="lbm.token.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 token class. |
| `grantee` | [string](#string) | | address of the grantee which abandons its grant. |
| `permission` | [Permission](#lbm.token.v1.Permission) | | permission on the token class. |






<a name="lbm.token.v1.EventAuthorizedOperator"></a>

### EventAuthorizedOperator
Expand Down Expand Up @@ -17522,10 +17503,10 @@ Since: 0.46.0 (finschia)



<a name="lbm.token.v1.EventGrant"></a>
<a name="lbm.token.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 All @@ -17544,10 +17525,10 @@ Since: 0.46.0 (finschia)



<a name="lbm.token.v1.EventIssue"></a>
<a name="lbm.token.v1.EventIssued"></a>

### EventIssue
EventIssue is emitted when a new token class is created.
### EventIssued
EventIssued is emitted when a new token class is created.

Since: 0.46.0 (finschia)

Expand Down Expand Up @@ -17607,6 +17588,25 @@ Since: 0.46.0 (finschia)



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

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

Since: 0.46.0 (finschia)


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






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

### EventRevokedOperator
Expand Down
12 changes: 6 additions & 6 deletions proto/lbm/token/v1/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ message EventRevokedOperator {
string operator = 3;
}

// EventIssue is emitted when a new token class is created.
// EventIssued is emitted when a new token class is created.
//
// Since: 0.46.0 (finschia)
message EventIssue {
message EventIssued {
// address which created the contract.
string creator = 1;
// contract id associated with the token class.
Expand All @@ -113,12 +113,12 @@ message EventIssue {
bool mintable = 8;
}

// 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 token class.
string contract_id = 1;
// address which granted the permission to `grantee`.
Expand All @@ -130,10 +130,10 @@ message EventGrant {
Permission permission = 4;
}

// EventAbandon is emitted when a grantee abandons its permission.
// EventRenounced is emitted when a grantee renounces its permission.
//
// Since: 0.46.0 (finschia)
message EventAbandon {
message EventRenounced {
// contract id associated with the token class.
string contract_id = 1;
// address of the grantee which abandons its grant.
Expand Down
10 changes: 5 additions & 5 deletions x/token/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func AttributeKeyFromString(name string) AttributeKey {
return AttributeKey(AttributeKey_value[attributeKeyName])
}

func NewEventIssueToken(event EventIssue, to sdk.AccAddress, amount sdk.Int) sdk.Event {
func NewEventIssueToken(event EventIssued, to sdk.AccAddress, amount sdk.Int) sdk.Event {
eventType := EventTypeIssueToken.String()
attributes := map[AttributeKey]string{
AttributeKeyContractID: event.ContractId,
Expand Down Expand Up @@ -157,7 +157,7 @@ func NewEventTransferFrom(event EventSent) sdk.Event {
return res
}

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

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

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

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

0 comments on commit a2fff76

Please sign in to comment.