Skip to content

Commit cb6669c

Browse files
mergify[bot]0Tech
andauthored
chore: deprecate legacy features on x/token,collection (backport #1201) (#1202)
* 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 (cherry picked from commit 3babbe5) # Conflicts: # CHANGELOG.md # tests/mocks/types_module_module.go * Resolve conflicts * Revert updating golangci version --------- Co-authored-by: Youngtaek Yoon <[email protected]>
1 parent acd1ec6 commit cb6669c

30 files changed

+1190
-680
lines changed

.golangci.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ issues:
4949
- text: "SA1019: codec.LegacyAmino is deprecated"
5050
linters:
5151
- staticcheck
52-
- text: "SA1019: collection."
52+
- path: x/collection
53+
text: "SA1019: collection."
54+
linters:
55+
- staticcheck
56+
- path: x/token
57+
text: "SA1019: token."
5358
linters:
5459
- staticcheck
5560
max-issues-per-linter: 10000

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ Ref: https://keepachangelog.com/en/1.0.0/
5555
### Build, CI
5656

5757
### Document Updates
58+
* (x/token,collection) [#1201](https://github.com/Finschia/finschia-sdk/pull/1201) Deprecate legacy features on x/token,collection

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
@@ -9424,8 +9424,6 @@ Contract defines the information of the contract for the collection.
94249424
<a name="lbm.collection.v1.FT"></a>
94259425

94269426
### FT
9427-
Deprecated: use FTClass
9428-
94299427
FT defines the information of fungible token.
94309428

94319429

@@ -9549,8 +9547,8 @@ Params defines the parameters for the collection module.
95499547

95509548
| Field | Type | Label | Description |
95519549
| ----- | ---- | ----- | ----------- |
9552-
| `depth_limit` | [uint32](#uint32) | | |
9553-
| `width_limit` | [uint32](#uint32) | | |
9550+
| `depth_limit` | [uint32](#uint32) | | **Deprecated.** |
9551+
| `width_limit` | [uint32](#uint32) | | **Deprecated.** |
95549552

95559553

95569554

@@ -10202,7 +10200,7 @@ GenesisState defines the collection module's genesis state.
1020210200
| `next_token_ids` | [ContractNextTokenIDs](#lbm.collection.v1.ContractNextTokenIDs) | repeated | next ids for (non-fungible) tokens. |
1020310201
| `balances` | [ContractBalances](#lbm.collection.v1.ContractBalances) | repeated | balances is an array containing the balances of all the accounts. |
1020410202
| `nfts` | [ContractNFTs](#lbm.collection.v1.ContractNFTs) | repeated | nfts is an array containing the nfts. |
10205-
| `parents` | [ContractTokenRelations](#lbm.collection.v1.ContractTokenRelations) | repeated | parents represents the parents of (non-fungible) tokens. |
10203+
| `parents` | [ContractTokenRelations](#lbm.collection.v1.ContractTokenRelations) | repeated | **Deprecated.** parents represents the parents of (non-fungible) tokens. |
1020610204
| `grants` | [ContractGrants](#lbm.collection.v1.ContractGrants) | repeated | grants defines the grant information. |
1020710205
| `authorizations` | [ContractAuthorizations](#lbm.collection.v1.ContractAuthorizations) | repeated | authorizations defines the approve information. |
1020810206
| `supplies` | [ContractStatistics](#lbm.collection.v1.ContractStatistics) | repeated | supplies represents the total supplies of tokens. |
@@ -10222,7 +10220,7 @@ NextClassIDs defines the next class ids of the contract.
1022210220
| Field | Type | Label | Description |
1022310221
| ----- | ---- | ----- | ----------- |
1022410222
| `contract_id` | [string](#string) | | contract id associated with the contract. |
10225-
| `fungible` | [string](#string) | | id for the fungible tokens. |
10223+
| `fungible` | [string](#string) | | **Deprecated.** id for the fungible tokens. |
1022610224
| `non_fungible` | [string](#string) | | id for the non-fungible tokens. |
1022710225

1022810226

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)