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

feat: implement x/collection #574

Merged
merged 89 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
a1bd2c1
feat: define x/collection proto
0Tech May 24, 2022
e8ef9d1
feat: update proto
0Tech May 30, 2022
a5be418
feat: add event_spent and event_received
0Tech May 30, 2022
91b84af
feat: add x/collection to simapp
0Tech May 30, 2022
4772e08
feat: implement send
0Tech May 30, 2022
934669a
feat: add getters to classes
0Tech May 31, 2022
ef0e5a6
feat: implement create
0Tech May 30, 2022
9a2001c
feat: add new msgs and deprecate the old ones
0Tech Jun 2, 2022
9857ace
fix: fix the type of the event fields
0Tech Jun 2, 2022
e830346
feat: add new queries and deprecate the old ones
0Tech Jun 3, 2022
9cad6cf
feat: implement msgs
0Tech Jun 3, 2022
d37c105
fix: use coins
0Tech Jun 9, 2022
06fc5fc
feat: implement authorization logic
0Tech Jun 9, 2022
e9ef079
feat: implement grant
0Tech Jun 9, 2022
cc357e9
feat: implement nft
0Tech Jun 13, 2022
9278448
feat: implement genesis
0Tech Jun 13, 2022
cd81839
docs: update documents on proto
0Tech Jun 15, 2022
8260807
docs: update version information in the comments
0Tech Jun 15, 2022
c6ec4a0
docs: update ERC777 related comments
0Tech Jun 15, 2022
7f360c4
test: add tests on genesis
0Tech Jun 15, 2022
1a88643
feat: update protos
0Tech Jun 23, 2022
4d86120
fix: fix export genesis
0Tech Jun 24, 2022
6f85fc2
feat: return the id of the created entity
0Tech Jun 24, 2022
b94f926
feat: add next ids to genesis state
0Tech Jun 24, 2022
a34cc8f
feat: add queries
0Tech Jun 24, 2022
97e62f8
fix: split EventMinted
0Tech Jun 27, 2022
4d90df4
feat: update field names and comments in tx proto
0Tech Jun 27, 2022
fc7bd52
feat: update comments in query proto
0Tech Jun 27, 2022
8a5990d
fix: fix event types and update proto
0Tech Jun 27, 2022
c259200
feat: add query client
0Tech Jun 28, 2022
483dd61
feat: add nft to genesis
0Tech Jun 28, 2022
c18f2a4
fix: fix parents iterator
0Tech Jun 28, 2022
ab2ecc3
lint: suppress unused for a while
0Tech Jun 28, 2022
d6f404f
feat: enable servers
0Tech Jun 28, 2022
f64ba90
refactor: remove ValidateNFTID() of keeper
0Tech Jun 28, 2022
dccfaab
Merge branch 'main' into collection
0Tech Jun 28, 2022
f3e89cf
docs: update CHANGELOG.md
0Tech Jun 28, 2022
255155d
feat: implement mint and burn
0Tech Jun 28, 2022
533e50a
test: increase coverage of msgs.go
0Tech Jun 29, 2022
6f9a354
test: increase coverage of msg_server.go
0Tech Jun 29, 2022
ff0a868
test: add tests on grpc_query.go
0Tech Jun 30, 2022
7d52147
Merge branch 'main' into collection
0Tech Jun 30, 2022
b78d41a
feat: implement attach and detach
0Tech Jun 30, 2022
bb2ec23
refactor: remove validateRoot
0Tech Jul 4, 2022
44f57ea
feat: implement modify
0Tech Jul 4, 2022
d849db8
test: burn tokens
0Tech Jul 4, 2022
6f5bb2e
lint: lint
0Tech Jul 5, 2022
86a3a26
feat: add Msg/CreateFTClass and Msg/CreateNFTClass
0Tech Jul 5, 2022
bd33bd0
fix: remove an interface TokenClass from proto
0Tech Jul 6, 2022
0b26c64
feat: add Query/TokenClassTypeURL
0Tech Jul 6, 2022
e1702b4
feat: add tx cli
0Tech Jul 6, 2022
5c506bf
docs: update deprecated comments
0Tech Jul 7, 2022
8cca778
test: add tests for collection types
0Tech Jul 7, 2022
f48646b
lint: add a exclude rule for the deprecated collection proto
0Tech Jul 7, 2022
2d68f6c
feat: add mintable logic
0Tech Jul 7, 2022
da4d7ea
feat: limit the number of descendants (NFT)
0Tech Jul 8, 2022
a0d1b4b
test: remove redundant test cases
0Tech Jul 8, 2022
56b01ec
fix: fix naming collision in enums
0Tech Jul 8, 2022
65ae5d7
feat: add legacy events
0Tech Jul 11, 2022
1183d6a
feat: emit operation events (daphne compat.)
0Tech Jul 12, 2022
e315585
chore: remove the commented logic
0Tech Jul 12, 2022
b8a3ac7
docs: add error conditions to tx proto
0Tech Jul 12, 2022
902917b
Merge branch 'main' into collection
0Tech Jul 12, 2022
4512e1b
feat: add depth and width limit on attach
0Tech Jul 13, 2022
cda1a89
feat: add params for the limits
0Tech Jul 13, 2022
1147933
test: check attribute_key_to
0Tech Jul 13, 2022
681d752
fix: emit legacy event against the original request
0Tech Jul 14, 2022
8a9c401
chore: put the logics after get_client_context except setting from
0Tech Jul 14, 2022
a701abc
fix: revisit creation logics
0Tech Jul 14, 2022
a01c026
feat: add tx cli to the module
0Tech Jul 15, 2022
ad3c142
chore: clean up legacy logic
0Tech Jul 15, 2022
6289832
chore: remove commented routerkey
0Tech Jul 15, 2022
65ef698
feat: update genesis validation
0Tech Jul 15, 2022
c25c571
docs: add hints to the deprecation message
0Tech Jul 15, 2022
abac9d7
Merge branch 'main' into collection
0Tech Jul 15, 2022
352e22c
chore: fix typo
0Tech Jul 15, 2022
52855d0
fix: completely remove the rejected spec
0Tech Jul 15, 2022
b9e2c45
refactor: remove duplicate logic
0Tech Jul 15, 2022
9ed5843
chore: completely remove Query/NFTs
0Tech Jul 15, 2022
0cb7c8b
fix: correct event emissions
0Tech Jul 15, 2022
35644f4
chore: literal to nil
0Tech Jul 15, 2022
ec33cbe
fix: use returned error
0Tech Jul 15, 2022
d5bd89b
lint: use literal to avoid false negative
0Tech Jul 15, 2022
ffabd85
chore: remove unimplemented logics
0Tech Jul 18, 2022
363d651
chore: remove unused id logic and deprecate old ones
0Tech Jul 18, 2022
5216dc9
feat: add a validation on params
0Tech Jul 18, 2022
b4549db
feat: add telemetry on account creation
0Tech Jul 18, 2022
0d6c2b6
Merge branch 'main' into collection
0Tech Jul 18, 2022
cbe6f87
style: use variable name other than 'new'
0Tech Jul 18, 2022
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
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ issues:
- text: "SA1019: codec.LegacyAmino is deprecated"
linters:
- staticcheck
- text: "SA1019: collection."
linters:
- staticcheck
max-issues-per-linter: 10000
max-same-issues: 10000

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/foundation) [\#528](https://github.com/line/lbm-sdk/pull/528) add a feature of whitelist for /lbm.foundation.v1.MsgWithdrawFromTreasury
* (proto) [\#584](https://github.com/line/lbm-sdk/pull/564) remove `prove` field in the `GetTxsEventRequest` of `tx` proto
* (x/collection) [\#571](https://github.com/line/lbm-sdk/pull/571) add x/collection proto
* (x/collection) [\#574](https://github.com/line/lbm-sdk/pull/574) implement x/collection

### Improvements

Expand Down
11 changes: 11 additions & 0 deletions simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ import (
"github.com/line/lbm-sdk/x/capability"
capabilitykeeper "github.com/line/lbm-sdk/x/capability/keeper"
capabilitytypes "github.com/line/lbm-sdk/x/capability/types"
"github.com/line/lbm-sdk/x/collection"
collectionkeeper "github.com/line/lbm-sdk/x/collection/keeper"
collectionmodule "github.com/line/lbm-sdk/x/collection/module"
"github.com/line/lbm-sdk/x/crisis"
crisiskeeper "github.com/line/lbm-sdk/x/crisis/keeper"
crisistypes "github.com/line/lbm-sdk/x/crisis/types"
Expand Down Expand Up @@ -157,6 +160,7 @@ var (
authzmodule.AppModuleBasic{},
vesting.AppModuleBasic{},
tokenmodule.AppModuleBasic{},
collectionmodule.AppModuleBasic{},
wasm.AppModuleBasic{},
)

Expand Down Expand Up @@ -218,6 +222,7 @@ type SimApp struct {
TransferKeeper ibctransferkeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
TokenKeeper tokenkeeper.Keeper
CollectionKeeper collectionkeeper.Keeper
WasmKeeper wasm.Keeper

// make scoped keepers public for test purposes
Expand Down Expand Up @@ -279,6 +284,7 @@ func NewSimApp(
foundation.StoreKey,
class.StoreKey,
token.StoreKey,
collection.StoreKey,
authzkeeper.StoreKey,
wasm.StoreKey,
)
Expand Down Expand Up @@ -347,6 +353,7 @@ func NewSimApp(

classKeeper := classkeeper.NewKeeper(appCodec, keys[class.StoreKey])
app.TokenKeeper = tokenkeeper.NewKeeper(appCodec, keys[token.StoreKey], app.AccountKeeper, classKeeper)
app.CollectionKeeper = collectionkeeper.NewKeeper(appCodec, keys[collection.StoreKey], app.AccountKeeper, classKeeper)

// register the staking hooks
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
Expand Down Expand Up @@ -470,6 +477,7 @@ func NewSimApp(
ibc.NewAppModule(app.IBCKeeper),
params.NewAppModule(app.ParamsKeeper),
tokenmodule.NewAppModule(appCodec, app.TokenKeeper),
collectionmodule.NewAppModule(appCodec, app.CollectionKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
transferModule,
)
Expand Down Expand Up @@ -500,6 +508,7 @@ func NewSimApp(
ibchost.ModuleName,
ibctransfertypes.ModuleName,
token.ModuleName,
collection.ModuleName,
wasm.ModuleName,
)
app.mm.SetOrderEndBlockers(
Expand All @@ -523,6 +532,7 @@ func NewSimApp(
ibctransfertypes.ModuleName,
foundation.ModuleName,
token.ModuleName,
collection.ModuleName,
wasm.ModuleName,
)

Expand Down Expand Up @@ -553,6 +563,7 @@ func NewSimApp(
vestingtypes.ModuleName,
foundation.ModuleName,
token.ModuleName,
collection.ModuleName,
// wasm after ibc transfer
wasm.ModuleName,
)
Expand Down
Loading