Skip to content

Commit 3babbe5

Browse files
authored
chore: deprecate legacy features on x/token,collection (#1201)
* Deprecate all the x/token features * Deprecate x/collection fungible token features * Deprecate x/collection attach features * Update CHANGELOG.md * Lint * Apply feedbacks on the PR
1 parent a1bab87 commit 3babbe5

31 files changed

+1191
-681
lines changed

.golangci.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ issues:
5757
- text: "SA1019: codec.LegacyAmino is deprecated"
5858
linters:
5959
- staticcheck
60-
- text: "SA1019: collection."
60+
- path: x/collection
61+
text: "SA1019: collection."
62+
linters:
63+
- staticcheck
64+
- path: x/token
65+
text: "SA1019: token."
6166
linters:
6267
- staticcheck
6368
- path: "legacy"

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,4 @@ Ref: https://keepachangelog.com/en/1.0.0/
7171
### Document Updates
7272
* (docs) [\#1059](https://github.com/Finschia/finschia-sdk/pull/1059) create ERRORS.md for x/module
7373
* (docs) [\#1083](https://github.com/Finschia/finschia-sdk/pull/1083) Add detailed explanation about default events
74+
* (x/token,collection) [#1201](https://github.com/Finschia/finschia-sdk/pull/1201) Deprecate legacy features on x/token,collection

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ lint: golangci-lint
340340
find . -name '*.go' -type f -not -path "*.git*" | xargs gofmt -d -s
341341

342342
golangci-lint:
343-
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2
343+
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2
344344

345345
lint-fix: golangci-lint
346346
golangci-lint run --fix --out-format=tab --issues-exit-code=0

baseapp/testutil/messages.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/core/proto-docs.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -9063,8 +9063,6 @@ Contract defines the information of the contract for the collection.
90639063
<a name="lbm.collection.v1.FT"></a>
90649064

90659065
### FT
9066-
Deprecated: use FTClass
9067-
90689066
FT defines the information of fungible token.
90699067

90709068

@@ -9188,8 +9186,8 @@ Params defines the parameters for the collection module.
91889186

91899187
| Field | Type | Label | Description |
91909188
| ----- | ---- | ----- | ----------- |
9191-
| `depth_limit` | [uint32](#uint32) | | |
9192-
| `width_limit` | [uint32](#uint32) | | |
9189+
| `depth_limit` | [uint32](#uint32) | | **Deprecated.** |
9190+
| `width_limit` | [uint32](#uint32) | | **Deprecated.** |
91939191

91949192

91959193

@@ -9841,7 +9839,7 @@ GenesisState defines the collection module's genesis state.
98419839
| `next_token_ids` | [ContractNextTokenIDs](#lbm.collection.v1.ContractNextTokenIDs) | repeated | next ids for (non-fungible) tokens. |
98429840
| `balances` | [ContractBalances](#lbm.collection.v1.ContractBalances) | repeated | balances is an array containing the balances of all the accounts. |
98439841
| `nfts` | [ContractNFTs](#lbm.collection.v1.ContractNFTs) | repeated | nfts is an array containing the nfts. |
9844-
| `parents` | [ContractTokenRelations](#lbm.collection.v1.ContractTokenRelations) | repeated | parents represents the parents of (non-fungible) tokens. |
9842+
| `parents` | [ContractTokenRelations](#lbm.collection.v1.ContractTokenRelations) | repeated | **Deprecated.** parents represents the parents of (non-fungible) tokens. |
98459843
| `grants` | [ContractGrants](#lbm.collection.v1.ContractGrants) | repeated | grants defines the grant information. |
98469844
| `authorizations` | [ContractAuthorizations](#lbm.collection.v1.ContractAuthorizations) | repeated | authorizations defines the approve information. |
98479845
| `supplies` | [ContractStatistics](#lbm.collection.v1.ContractStatistics) | repeated | supplies represents the total supplies of tokens. |
@@ -9861,7 +9859,7 @@ NextClassIDs defines the next class ids of the contract.
98619859
| Field | Type | Label | Description |
98629860
| ----- | ---- | ----- | ----------- |
98639861
| `contract_id` | [string](#string) | | contract id associated with the contract. |
9864-
| `fungible` | [string](#string) | | id for the fungible tokens. |
9862+
| `fungible` | [string](#string) | | **Deprecated.** id for the fungible tokens. |
98659863
| `non_fungible` | [string](#string) | | id for the non-fungible tokens. |
98669864

98679865

proto/lbm/collection/v1/collection.proto

+6-5
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import "cosmos_proto/cosmos.proto";
1010

1111
// Params defines the parameters for the collection module.
1212
message Params {
13-
uint32 depth_limit = 1;
14-
uint32 width_limit = 2;
13+
uint32 depth_limit = 1 [deprecated = true];
14+
uint32 width_limit = 2 [deprecated = true];
1515
}
1616

1717
// Contract defines the information of the contract for the collection.
@@ -30,6 +30,7 @@ message Contract {
3030
//
3131
// Since: 0.46.0 (finschia)
3232
message FTClass {
33+
option deprecated = true;
3334
option (gogoproto.goproto_getters) = true;
3435
option (cosmos_proto.implements_interface) = "TokenClass";
3536

@@ -94,10 +95,9 @@ message OwnerNFT {
9495
string owner = 5;
9596
}
9697

97-
// Deprecated: use FTClass
98-
//
9998
// FT defines the information of fungible token.
10099
message FT {
100+
option deprecated = true;
101101
option (cosmos_proto.implements_interface) = "Token";
102102

103103
// contract id associated with the contract.
@@ -140,7 +140,8 @@ message Coin {
140140
// token id associated with the token.
141141
string token_id = 1;
142142
// amount of the token.
143-
string amount = 2 [(gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Int", (gogoproto.nullable) = false];
143+
string amount = 2
144+
[(gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Int", (gogoproto.nullable) = false];
144145
}
145146

146147
// Grant defines permission given to a grantee.

proto/lbm/collection/v1/event.proto

+12
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ message EventCreatedContract {
8282
//
8383
// Since: 0.46.0 (finschia)
8484
message EventCreatedFTClass {
85+
option deprecated = true;
86+
8587
// contract id associated with the contract.
8688
string contract_id = 1;
8789
// address which triggered the create.
@@ -147,6 +149,8 @@ message EventRenounced {
147149
//
148150
// Since: 0.46.0 (finschia)
149151
message EventMintedFT {
152+
option deprecated = true;
153+
150154
// contract id associated with the contract.
151155
string contract_id = 1;
152156
// address which triggered the mint.
@@ -236,6 +240,8 @@ message EventModifiedNFT {
236240
//
237241
// Since: 0.46.0 (finschia)
238242
message EventAttached {
243+
option deprecated = true;
244+
239245
// contract id associated with the contract.
240246
string contract_id = 1;
241247
// address which triggered the attach.
@@ -252,6 +258,8 @@ message EventAttached {
252258
//
253259
// Since: 0.46.0 (finschia)
254260
message EventDetached {
261+
option deprecated = true;
262+
255263
// contract id associated with the contract.
256264
string contract_id = 1;
257265
// address which triggered the detach.
@@ -268,6 +276,8 @@ message EventDetached {
268276
//
269277
// Since: 0.46.0 (finschia)
270278
message EventOwnerChanged {
279+
option deprecated = true;
280+
271281
// contract id associated with the contract.
272282
string contract_id = 1;
273283
// token id associated with the token.
@@ -282,6 +292,8 @@ message EventOwnerChanged {
282292
//
283293
// Since: 0.46.0 (finschia)
284294
message EventRootChanged {
295+
option deprecated = true;
296+
285297
// contract id associated with the contract.
286298
string contract_id = 1;
287299
// token id associated with the token.

proto/lbm/collection/v1/genesis.proto

+15-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ message GenesisState {
3333
repeated ContractNFTs nfts = 7 [(gogoproto.nullable) = false];
3434

3535
// parents represents the parents of (non-fungible) tokens.
36-
repeated ContractTokenRelations parents = 8 [(gogoproto.nullable) = false];
36+
repeated ContractTokenRelations parents = 8 [deprecated = true, (gogoproto.nullable) = false];
3737

3838
// grants defines the grant information.
3939
repeated ContractGrants grants = 9 [(gogoproto.nullable) = false];
@@ -70,7 +70,8 @@ message ClassStatistics {
7070
// class id associated with the token class.
7171
string class_id = 1;
7272
// statistics
73-
string amount = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Int"];
73+
string amount = 2
74+
[(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Int"];
7475
}
7576

7677
// Balance defines a balance of an address.
@@ -119,9 +120,14 @@ message NextClassIDs {
119120
// contract id associated with the contract.
120121
string contract_id = 1;
121122
// id for the fungible tokens.
122-
string fungible = 2 [(gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Uint", (gogoproto.nullable) = false];
123+
string fungible = 2 [
124+
deprecated = true,
125+
(gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Uint",
126+
(gogoproto.nullable) = false
127+
];
123128
// id for the non-fungible tokens.
124-
string non_fungible = 3 [(gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Uint", (gogoproto.nullable) = false];
129+
string non_fungible = 3
130+
[(gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Uint", (gogoproto.nullable) = false];
125131
}
126132

127133
// ContractNextTokenIDs defines the next token ids belong to a contract.
@@ -140,6 +146,8 @@ message NextTokenID {
140146

141147
// ContractTokenRelations defines token relations belong to a contract.
142148
message ContractTokenRelations {
149+
option deprecated = true;
150+
143151
// contract id associated with the contract.
144152
string contract_id = 1;
145153
// relations
@@ -148,8 +156,10 @@ message ContractTokenRelations {
148156

149157
// TokenRelation defines relations between two tokens.
150158
message TokenRelation {
159+
option deprecated = true;
160+
151161
// self
152162
string self = 1;
153163
// other
154164
string other = 2;
155-
}
165+
}

0 commit comments

Comments
 (0)