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 x/collection,token proto #3

Closed
wants to merge 5 commits into from
Closed
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
14 changes: 3 additions & 11 deletions proto/lbm/collection/v1/collection.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ message Params {
// Contract defines the information of the contract for the collection.
message Contract {
// contract_id defines the unique identifier of the contract.
string contract_id = 1;
string id = 1;
// name defines the human-readable name of the contract.
string name = 2;
// meta is a brief description of the contract.
string meta = 3;
// base img uri is an uri for the contract image stored off chain.
string base_img_uri = 4;
// uri for the relevant resource stored off chain.
string uri = 4;
}

// FTClass defines the class of fungible token.
Expand Down Expand Up @@ -203,11 +203,3 @@ message Attribute {
string key = 1;
string value = 2;
}

// Deprecated: use Attribute
//
// Change defines a field-value pair.
message Change {
string field = 1;
string value = 2;
}
105 changes: 54 additions & 51 deletions proto/lbm/collection/v1/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ enum AttributeKey {
ATTRIBUTE_KEY_NEW_ROOT_TOKEN_ID = 19 [(gogoproto.enumvalue_customname) = "AttributeKeyNewRoot"];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does enum AttributeKey affect legacy events?
If not, I guess the following definition should be modified into ATTRIBUTE_KEY_URI and AttributeKeyURI. (Possibly AttributeKeyUri is better?)

  ATTRIBUTE_KEY_BASE_IMG_URI      = 8 [(gogoproto.enumvalue_customname) = "AttributeKeyBaseImgURI"];

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does. So we would better not touch it.

}

// EventSent is emitted when tokens are transferred.
// EventSend is emitted when tokens are transferred.
//
// Since: 0.46.0 (finschia)
message EventSent {
// contract id associated with the contract.
message EventSend {
// id associated with the contract.
string contract_id = 1;
// address which triggered the send.
string operator = 2;
Expand All @@ -90,51 +90,51 @@ message EventSent {
repeated Coin amount = 5 [(gogoproto.nullable) = false];
}

// EventAuthorizedOperator is emitted when a holder authorizes an operator to manipulate its tokens.
// EventAuthorizeOperator is emitted when a holder authorizes an operator to manipulate its tokens.
//
// Since: 0.46.0 (finschia)
message EventAuthorizedOperator {
// contract id associated with the contract.
message EventAuthorizeOperator {
// id associated with the contract.
string contract_id = 1;
// address of a holder which authorized the `operator` address as an operator.
string holder = 2;
// address which became an operator of `holder`.
string operator = 3;
}

// EventRevokedOperator is emitted when an authorization is revoked.
// EventRevokeOperator is emitted when an authorization is revoked.
//
// Since: 0.46.0 (finschia)
message EventRevokedOperator {
// contract id associated with the contract.
message EventRevokeOperator {
// id associated with the contract.
string contract_id = 1;
// address of a holder which revoked the `operator` address as an operator.
string holder = 2;
// address which was revoked as an operator of `holder`.
string operator = 3;
}

// EventCreatedContract is emitted when a new contract is created.
// EventCreateContract is emitted when a new contract is created.
//
// Since: 0.46.0 (finschia)
message EventCreatedContract {
message EventCreateContract {
// address which created the contract.
string creator = 1;
// contract id associated with the contract.
// id associated with the contract.
string contract_id = 2;
// name of the contract.
string name = 3;
// metadata of the contract.
string meta = 4;
// uri for the contract image stored off chain.
string base_img_uri = 5;
string uri = 5;
}

// EventCreatedFTClass is emitted when a new fungible token class is created.
// EventCreateFTClass is emitted when a new fungible token class is created.
//
// Since: 0.46.0 (finschia)
message EventCreatedFTClass {
// contract id associated with the contract.
message EventCreateFTClass {
// id associated with the contract.
string contract_id = 1;
// address which triggered the create.
string operator = 2;
Expand All @@ -150,11 +150,11 @@ message EventCreatedFTClass {
bool mintable = 7;
}

// EventCreatedNFTClass is emitted when a new non-fungible token class is created.
// EventCreateNFTClass is emitted when a new non-fungible token class is created.
//
// Since: 0.46.0 (finschia)
message EventCreatedNFTClass {
// contract id associated with the contract.
message EventCreateNFTClass {
// id associated with the contract.
string contract_id = 1;
// address which triggered the create.
string operator = 2;
Expand All @@ -166,13 +166,13 @@ message EventCreatedNFTClass {
string meta = 5;
}

// EventGranted is emitted when a granter grants its permission to a grantee.
// EventGrant 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 EventGranted {
// contract id associated with the contract.
message EventGrant {
// id associated with the contract.
string contract_id = 1;
// address of the granter which grants the permission.
string granter = 2;
Expand All @@ -182,23 +182,23 @@ message EventGranted {
Permission permission = 4;
}

// EventRenounced is emitted when a grantee renounced its permission.
// EventRenounce is emitted when a grantee renounced its permission.
//
// Since: 0.46.0 (finschia)
message EventRenounced {
// contract id associated with the contract.
message EventRenounce {
// id associated with the contract.
string contract_id = 1;
// address of the grantee which abandons its grant.
string grantee = 2;
// permission on the contract.
Permission permission = 3;
}

// EventMintedFT is emitted when fungible tokens are minted.
// EventMintFT is emitted when fungible tokens are minted.
//
// Since: 0.46.0 (finschia)
message EventMintedFT {
// contract id associated with the contract.
message EventMintFT {
// id associated with the contract.
string contract_id = 1;
// address which triggered the mint.
string operator = 2;
Expand All @@ -208,11 +208,11 @@ message EventMintedFT {
repeated Coin amount = 4 [(gogoproto.nullable) = false];
}

// EventMintedNFT is emitted when non-fungible tokens are minted.
// EventMintNFT is emitted when non-fungible tokens are minted.
//
// Since: 0.46.0 (finschia)
message EventMintedNFT {
// contract id associated with the contract.
message EventMintNFT {
// id associated with the contract.
string contract_id = 1;
// address which triggered the mint.
string operator = 2;
Expand All @@ -222,11 +222,11 @@ message EventMintedNFT {
repeated NFT tokens = 4 [(gogoproto.nullable) = false];
}

// EventBurned is emitted when tokens are burnt.
// EventBurn is emitted when tokens are burnt.
//
// Since: 0.46.0 (finschia)
message EventBurned {
// contract id associated with the contract.
message EventBurn {
// id associated with the contract.
string contract_id = 1;
// address which triggered the burn.
string operator = 2;
Expand All @@ -236,53 +236,56 @@ message EventBurned {
repeated Coin amount = 4 [(gogoproto.nullable) = false];
}

// EventModifiedContract is emitted when the information of a contract is modified.
// EventModifyContract is emitted when the information of a contract is modified.
//
// Since: 0.46.0 (finschia)
message EventModifiedContract {
// contract id associated with the contract.
message EventModifyContract {
// id associated with the contract.
string contract_id = 1;
// address which triggered the modify.
string operator = 2;
// changes of the attributes applied.
// refer to the comments on MsgModify for the possible keys.
repeated Attribute changes = 3 [(gogoproto.nullable) = false];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about explaining possible keys of changes like the following?

  // changes of the attributes applied.
  // The possible attribute keys are same as the possible keys of `changes` in `message MsgModify`.
  repeated Attribute changes = 3 [(gogoproto.nullable) = false];

}

// EventModifiedTokenClass is emitted when the information of a token class is modified.
// EventModifyTokenClass is emitted when the information of a token class is modified.
//
// Since: 0.46.0 (finschia)
message EventModifiedTokenClass {
// contract id associated with the contract.
message EventModifyTokenClass {
// id associated with the contract.
string contract_id = 1;
// address which triggered the modify.
string operator = 2;
// class id associated with the token class.
string class_id = 3;
// changes of the attributes applied.
// refer to the comments on MsgModify for the possible keys.
repeated Attribute changes = 4 [(gogoproto.nullable) = false];
// type name of the token class.
string type_name = 5;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto, how about explaining possible keys of changes like the following?

  // changes of the attributes applied.
  // The possible attribute keys are same as the possible keys of `changes` in `message MsgModify`.
  repeated Attribute changes = 4 [(gogoproto.nullable) = false];


// EventModifiedNFT is emitted when the information of a non-fungible token is modified.
// EventModifyNFT is emitted when the information of a non-fungible token is modified.
//
// Since: 0.46.0 (finschia)
message EventModifiedNFT {
// contract id associated with the contract.
message EventModifyNFT {
// id associated with the contract.
string contract_id = 1;
// address which triggered the modify.
string operator = 2;
// token id associated with the non-fungible token.
string token_id = 3;
// changes of the attributes applied.
// refer to the comments on MsgModify for the possible keys.
repeated Attribute changes = 4 [(gogoproto.nullable) = false];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto, how about explaining possible keys of changes like the following?

  // changes of the attributes applied.
  // The possible attribute keys are same as the possible keys of `changes` in `message MsgModify`.
  repeated Attribute changes = 4 [(gogoproto.nullable) = false];

}

// EventAttached is emitted when a token is attached to another.
// EventAttach is emitted when a token is attached to another.
//
// Since: 0.46.0 (finschia)
message EventAttached {
// contract id associated with the contract.
message EventAttach {
// id associated with the contract.
string contract_id = 1;
// address which triggered the attach.
string operator = 2;
Expand All @@ -294,11 +297,11 @@ message EventAttached {
string target = 5;
}

// EventDetached is emitted when a token is detached from its parent.
// EventDetach is emitted when a token is detached from its parent.
//
// Since: 0.46.0 (finschia)
message EventDetached {
// contract id associated with the contract.
message EventDetach {
// id associated with the contract.
string contract_id = 1;
// address which triggered the detach.
string operator = 2;
Expand All @@ -314,7 +317,7 @@ message EventDetached {
//
// Since: 0.46.0 (finschia)
message EventOwnerChanged {
// contract id associated with the contract.
// id associated with the contract.
string contract_id = 1;
// token id associated with the token.
string token_id = 2;
Expand All @@ -328,7 +331,7 @@ message EventOwnerChanged {
//
// Since: 0.46.0 (finschia)
message EventRootChanged {
// contract id associated with the contract.
// id associated with the contract.
string contract_id = 1;
// token id associated with the token.
string token_id = 2;
Expand Down
Loading