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

fix!: update x/collection,token proto #863

Merged
merged 23 commits into from
Feb 3, 2023
Merged

Conversation

0Tech
Copy link
Collaborator

@0Tech 0Tech commented Jan 16, 2023

Description

It would apply the client's requirements on x/collection,token proto.

  • Update the class-related part in the proto as requested by our client.
  • Remove proxy in the proto.
  • Replace all the uri variants into uri, in the proto.

Checklist:

  • I followed the contributing guidelines and code of conduct.
  • I have added a relevant changelog to CHANGELOG.md
  • I have added tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have updated API documentation client/docs/swagger-ui/swagger.yaml

@codecov
Copy link

codecov bot commented Jan 16, 2023

Codecov Report

Merging #863 (046dc94) into main (1deccf3) will increase coverage by 0.00%.
The diff coverage is 96.51%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #863   +/-   ##
=======================================
  Coverage   62.37%   62.37%           
=======================================
  Files         653      653           
  Lines       79967    79976    +9     
=======================================
+ Hits        49876    49885    +9     
  Misses      27399    27399           
  Partials     2692     2692           
Impacted Files Coverage Δ
x/collection/codec.go 44.59% <50.00%> (+0.75%) ⬆️
x/token/codec.go 57.89% <57.14%> (+1.13%) ⬆️
x/collection/msgs.go 96.72% <97.64%> (ø)
x/collection/client/testutil/query.go 100.00% <100.00%> (ø)
x/collection/client/testutil/suite.go 99.60% <100.00%> (ø)
x/collection/client/testutil/tx.go 100.00% <100.00%> (ø)
x/collection/event.go 100.00% <100.00%> (ø)
x/collection/genesis.go 93.20% <100.00%> (ø)
x/collection/keeper/genesis.go 97.04% <100.00%> (ø)
x/collection/keeper/grpc_query.go 89.95% <100.00%> (ø)
... and 32 more

@ByunghyunBang
Copy link

ByunghyunBang commented Jan 20, 2023

Could check comment?
Fix approver -> holder, proxy -> operator

ex)

  // - ErrUnauthorized
  //   - the approver has not authorized `proxy`. ---> ###
  // - ErrInvalidRequest
  //   - `owner` does not owns `subject`.  

token/v1/tx.proto

  • rpc AuthorizeOperator
  • rpc OperatorSend
  • rpc OperatorBurn
  • rpc Modify
  • message MsgOperatorSend
  • message MsgAuthorizeOperator
  • message MsgOperatorBurn

collection /v1/tx.proto

  • rpc OperatorSendFT
  • rpc OperatorSendNFT
  • rpc AuthorizeOperator
  • rpc RevokeOperator
  • rpc OperatorBurnFT
  • rpc OperatorBurnNFT
  • rpc Modify
  • rpc OperatorAttach
  • rpc OperatorDetach

@0Tech
Copy link
Collaborator Author

0Tech commented Jan 20, 2023

Could check comment?
Fix approver -> holder, proxy -> operator

The conditions on the errors would be wiped out from the comment, because we will introduce its own codespace (on #849). It would be obvious from the error code.

@ByunghyunBang
Copy link

ByunghyunBang commented Jan 20, 2023

Could you check these? approver and proxy are used here
Change approver -> holder, proxy -> operator

collection/v1/query.proto

rpc Approved(QueryApprovedRequest) returns (QueryApprovedResponse)
rpc Approvers(QueryApproversRequest) returns (QueryApproversResponse)
message QueryApprovedRequest
message QueryApprovedResponse
message QueryApproversRequest
message QueryApproversResponse

token/v1/query.proto

rpc Approved(QueryApprovedRequest) returns (QueryApprovedResponse)
rpc Approvers(QueryApproversRequest) returns (QueryApproversResponse)
message QueryApprovedRequest
message QueryApprovedResponse
message QueryApproversRequest
message QueryApproversResponse

example)

// QueryApprovedRequest is the request type for the Query/Approved RPC method
message QueryApprovedRequest {
  // contract id associated with the contract.
  string contract_id = 1;
  // address of the proxy which the authorization is granted to.
  string proxy = 2;
  // approver is the address of the approver of the authorization.
  string approver = 3;
}

// QueryApprovedResponse is the response type for the Query/Approved RPC method
message QueryApprovedResponse {
  bool approved = 1;
}

// class id associated with the token class.
string class_id = 3;
// token id associated with the token class.
string token_id = 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

(For confirmation) This field was changed from a 8-bytes ID to a 16 bytes ID, am I correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the change has been applied.

Comment on lines 261 to 262
// changes of the attributes applied.
repeated Attribute changes = 4 [(gogoproto.nullable) = false];
Copy link
Contributor

Choose a reason for hiding this comment

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

It's helpful for client developers to add a comment about possible attribute keys. For example,

Suggested change
// changes of the attributes applied.
repeated Attribute changes = 4 [(gogoproto.nullable) = false];
// changes of the attributes applied.
// Possible attribute keys are same as those of `MsgModify.changes`.
repeated Attribute changes = 4 [(gogoproto.nullable) = false];

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added the comments.

// MsgBurnFromResponse defines the Msg/BurnFrom response type.
message MsgBurnFromResponse {}
// MsgOperatorBurnResponse defines the Msg/OperatorBurn response type.
message MsgOperatorBurnResponse {}

// MsgModify defines the Msg/Modify request type.
//
Copy link
Contributor

Choose a reason for hiding this comment

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

It's helpful for client developers to add a comment about possible fields of changes. For example,

  // changes to apply.
  // possible fields: uri, meta, ...
  repeated Pair changes = 3 [(gogoproto.nullable) = false];

//
// Since: 0.46.0 (finschia)
message EventModified {
// contract id associated with the token class.
// contract id associated with the contract.
string contract_id = 1;
// address which triggered the modify.
string operator = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

It's helpful for client developers to add a comment about possible fields of changes. For example,

  // changes on the metadata of the class.
  // Possible fields are same as those of `MsgModify.changes`. 
  repeated Pair changes = 3 [(gogoproto.nullable) = false];

@0Tech 0Tech marked this pull request as ready for review January 26, 2023 10:00
@0Tech 0Tech requested review from loin3 and tkxkd0159 January 26, 2023 10:01
x/token/client/cli/tx.go Outdated Show resolved Hide resolved
x/token/client/cli/tx.go Outdated Show resolved Hide resolved
x/collection/client/cli/tx.go Outdated Show resolved Hide resolved
x/collection/client/cli/tx.go Outdated Show resolved Hide resolved
x/collection/client/cli/tx.go Outdated Show resolved Hide resolved
x/collection/client/cli/tx.go Outdated Show resolved Hide resolved
x/collection/client/cli/tx.go Outdated Show resolved Hide resolved
x/collection/client/cli/tx.go Outdated Show resolved Hide resolved
x/collection/client/cli/tx.go Outdated Show resolved Hide resolved
@0Tech 0Tech merged commit 3933ad1 into Finschia:main Feb 3, 2023
zemyblue added a commit to zemyblue/finschia-sdk that referenced this pull request Feb 6, 2023
* main:
  feat!: add MultiSend deactivation (Finschia#876)
  chore(deps): Bump github.com/gogo/protobuf in /ics23/go (Finschia#816)
  fix: do not create account on x/token,collection (Finschia#866)
  fix!: update x/collection,token proto (Finschia#863)

# Conflicts:
#	CHANGELOG.md
@0Tech 0Tech deleted the client_proto branch February 6, 2023 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants