refactor: x/nft audit changes (#14055)

## Description

ref: #13991 



---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
This commit is contained in:
Likhita Polavarapu
2022-11-30 07:23:30 +00:00
committed by GitHub
parent 6239cdfddb
commit ac6b19df21
30 changed files with 501 additions and 264 deletions
+17 -7
View File
@@ -1739,9 +1739,13 @@ type EventSend struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"`
// class_id associated with the nft
ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"`
// id is a unique identifier of the nft
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
// sender is the address of the owner of nft
Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"`
// receiver is the receiver address of nft
Receiver string `protobuf:"bytes,4,opt,name=receiver,proto3" json:"receiver,omitempty"`
}
@@ -1799,9 +1803,12 @@ type EventMint struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// class_id associated with the nft
ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"`
// id is a unique identifier of the nft
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
// owner is the owner address of the nft
Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"`
}
func (x *EventMint) Reset() {
@@ -1851,9 +1858,12 @@ type EventBurn struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// class_id associated with the nft
ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"`
// id is a unique identifier of the nft
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
// owner is the owner address of the nft
Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"`
}
func (x *EventBurn) Reset() {
+1
View File
@@ -1223,6 +1223,7 @@ type GenesisState struct {
// class defines the class of the nft type.
Classes []*Class `protobuf:"bytes,1,rep,name=classes,proto3" json:"classes,omitempty"`
// entry defines all nft owned by a person.
Entries []*Entry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"`
}
+27 -7
View File
@@ -6567,8 +6567,10 @@ type QueryBalanceRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// class_id associated with the nft
ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"`
Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"`
// owner is the owner address of the nft
Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"`
}
func (x *QueryBalanceRequest) Reset() {
@@ -6611,6 +6613,7 @@ type QueryBalanceResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// amount is the number of all NFTs of a given class owned by the owner
Amount uint64 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"`
}
@@ -6647,8 +6650,10 @@ type QueryOwnerRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// class_id associated with the nft
ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
// id is a unique identifier of the NFT
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *QueryOwnerRequest) Reset() {
@@ -6691,6 +6696,7 @@ type QueryOwnerResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// owner is the owner address of the nft
Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
}
@@ -6727,6 +6733,7 @@ type QuerySupplyRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// class_id associated with the nft
ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"`
}
@@ -6763,6 +6770,7 @@ type QuerySupplyResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// amount is the number of all NFTs from the given class
Amount uint64 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"`
}
@@ -6799,8 +6807,11 @@ type QueryNFTsRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"`
Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"`
// class_id associated with the nft
ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"`
// owner is the owner address of the nft
Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"`
// pagination defines an optional pagination for the request.
Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"`
}
@@ -6851,7 +6862,9 @@ type QueryNFTsResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Nfts []*NFT `protobuf:"bytes,1,rep,name=nfts,proto3" json:"nfts,omitempty"`
// NFT defines the NFT
Nfts []*NFT `protobuf:"bytes,1,rep,name=nfts,proto3" json:"nfts,omitempty"`
// pagination defines the pagination in the response.
Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}
@@ -6895,8 +6908,10 @@ type QueryNFTRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// class_id associated with the nft
ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
// id is a unique identifier of the NFT
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *QueryNFTRequest) Reset() {
@@ -6939,6 +6954,7 @@ type QueryNFTResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// owner is the owner address of the nft
Nft *NFT `protobuf:"bytes,1,opt,name=nft,proto3" json:"nft,omitempty"`
}
@@ -6975,6 +6991,7 @@ type QueryClassRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// class_id associated with the nft
ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"`
}
@@ -7011,6 +7028,7 @@ type QueryClassResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// class defines the class of the nft type.
Class *Class `protobuf:"bytes,1,opt,name=class,proto3" json:"class,omitempty"`
}
@@ -7084,7 +7102,9 @@ type QueryClassesResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Classes []*Class `protobuf:"bytes,1,rep,name=classes,proto3" json:"classes,omitempty"`
// class defines the class of the nft type.
Classes []*Class `protobuf:"bytes,1,rep,name=classes,proto3" json:"classes,omitempty"`
// pagination defines the pagination in the response.
Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}