-
Notifications
You must be signed in to change notification settings - Fork 28
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
Separation of issuer and admin for fungible tokens #805
Separation of issuer and admin for fungible tokens #805
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #805 +/- ##
==========================================
+ Coverage 31.74% 34.90% +3.16%
==========================================
Files 179 181 +2
Lines 50608 51805 +1197
==========================================
+ Hits 16064 18084 +2020
+ Misses 31374 30213 -1161
- Partials 3170 3508 +338
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
902dc01
to
3b40565
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 28 of 28 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @masihyeganeh)
integration-tests/modules/wasm_test.go
line 1361 at r1 (raw file):
requireT.NoError(json.Unmarshal(queryOut, &wasmTokenRes)) wasmTokenRes.Token.Version = expectedToken.Version // test should work with any version // TODO(masih): Remove this line, once WASM contract is updated
by wasm contract you mean our rust sdk ?
x/asset/ft/migrations/v3/definitions.go
line 25 at r1 (raw file):
def.Admin = def.Issuer keeper.SetDefinition(ctx, issuer, subunit, def)
definition has the issuer field, use that
90405fd
to
45e7f1e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 20 of 29 files reviewed, 4 unresolved discussions (waiting on @masihyeganeh, @miladz68, @wojtek-coreum, and @ysv)
proto/coreum/asset/ft/v1/tx.proto
line 45 at r2 (raw file):
// TransferAdmin changes admin of a fungible token. rpc TransferAdmin(MsgTransferAdmin) returns (EmptyResponse);
Don't we need the admin removal ?
@ysv @miladz68 @wojtek-coreum
x/asset/ft/keeper/migrations.go
line 39 at r2 (raw file):
// Migrate3to4 migrates from version 3 to 4. func (m Migrator) Migrate3to4(ctx sdk.Context) error {
You also need to add upgrade integration test for it, please check (integration-tests/upgrade/upgrade_test.go).
It might require the crust changes as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 20 of 29 files reviewed, 4 unresolved discussions (waiting on @dzmitryhil, @miladz68, @wojtek-coreum, and @ysv)
integration-tests/modules/wasm_test.go
line 1361 at r1 (raw file):
Previously, miladz68 (milad) wrote…
by wasm contract you mean our rust sdk ?
Done.
proto/coreum/asset/ft/v1/tx.proto
line 45 at r2 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
Don't we need the admin removal ?
@ysv @miladz68 @wojtek-coreum
A follow up question would be:
Are we going to support having multiple admins for a token or not
x/asset/ft/keeper/migrations.go
line 39 at r2 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
You also need to add upgrade integration test for it, please check (integration-tests/upgrade/upgrade_test.go).
It might require the crust changes as well.
Should I write an upgrade for v4 or v3patch3?
x/asset/ft/migrations/v3/definitions.go
line 25 at r1 (raw file):
Previously, miladz68 (milad) wrote…
definition has the issuer field, use that
I'm gonna need the subunit anyways, so it won't do much here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 19 of 29 files reviewed, 4 unresolved discussions (waiting on @miladz68, @wojtek-coreum, and @ysv)
proto/coreum/asset/ft/v1/tx.proto
line 45 at r2 (raw file):
Previously, masihyeganeh (Masih Yeganeh) wrote…
A follow up question would be:
Are we going to support having multiple admins for a token or not
I mean do we need an sdm.Message to remove admin completely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 19 of 29 files reviewed, 4 unresolved discussions (waiting on @dzmitryhil, @miladz68, @wojtek-coreum, and @ysv)
proto/coreum/asset/ft/v1/tx.proto
line 45 at r2 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
I mean do we need an sdm.Message to remove admin completely?
I don't think so. This would limit sovereignty of a token indefinitely. If you have a use-case for it, we can discuss it after daily
x/asset/ft/keeper/migrations.go
line 39 at r2 (raw file):
Previously, masihyeganeh (Masih Yeganeh) wrote…
Should I write an upgrade for v4 or v3patch3?
And also I think I need to wait for #809 to merge first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 9 of 9 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @wojtek-coreum, and @ysv)
proto/coreum/asset/ft/v1/tx.proto
line 45 at r2 (raw file):
Previously, masihyeganeh (Masih Yeganeh) wrote…
I don't think so. This would limit sovereignty of a token indefinitely. If you have a use-case for it, we can discuss it after daily
we would like to have that feature probably. But we should discuss it with Reza first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @masihyeganeh, @wojtek-coreum, and @ysv)
proto/coreum/asset/ft/v1/tx.proto
line 45 at r2 (raw file):
Previously, miladz68 (milad) wrote…
we would like to have that feature probably. But we should discuss it with Reza first.
Let's discuss it today.
x/asset/ft/keeper/migrations.go
line 39 at r2 (raw file):
Previously, masihyeganeh (Masih Yeganeh) wrote…
And also I think I need to wait for #809 to merge first
Right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @wojtek-coreum, and @ysv)
proto/coreum/asset/ft/v1/tx.proto
line 45 at r2 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
Let's discuss it today.
It is decided that we need this feature but as an other task
x/asset/ft/keeper/migrations.go
line 39 at r2 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
Right.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 13 of 32 files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @miladz68, @wojtek-coreum, and @ysv)
proto/coreum/asset/ft/v1/tx.proto
line 45 at r2 (raw file):
Previously, masihyeganeh (Masih Yeganeh) wrote…
It is decided that we need this feature but as an other task
Dropping admin functionality added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 13 of 32 files reviewed, 2 unresolved discussions (waiting on @masihyeganeh, @miladz68, @wojtek-coreum, and @ysv)
integration-tests/modules/wasm_test.go
line 1361 at r4 (raw file):
requireT.NoError(json.Unmarshal(queryOut, &wasmTokenRes)) wasmTokenRes.Token.Version = expectedToken.Version // test should work with any version // TODO(masih): Remove this line, once WASM SDK is updated
@keyleu Could you please add a TODO for the WASM SDK update to resolve all Remove this line, once WASM SDK is updated
comments.
proto/coreum/asset/ft/v1/tx.proto
line 136 at r4 (raw file):
} message MsgDropAdmin {
You mentioned that it should be in a separate task, but it's here :-)
RemoveAdmin
IMO is a better name or ClearAdmin
(similar to wasm). @ysv @miladz68 @wojtek-coreum WDYT ?
x/asset/ft/keeper/keeper.go
line 983 at r4 (raw file):
if def.IsAdmin(addr) { return sdkerrors.Wrap(cosmoserrors.ErrUnauthorized, "issuer's balance can't be frozen")
Update error text, and check whether there are other errors with issuer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 13 of 32 files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @miladz68, @wojtek-coreum, and @ysv)
proto/coreum/asset/ft/v1/tx.proto
line 136 at r4 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
You mentioned that it should be in a separate task, but it's here :-)
RemoveAdmin
IMO is a better name orClearAdmin
(similar to wasm). @ysv @miladz68 @wojtek-coreum WDYT ?
Yeah, I was going to do that in a separate PR, but since my PRs are open for a while and they have some fundamental changed, I did it here.
I'm open to change the name but it is good enough IMO
x/asset/ft/keeper/keeper.go
line 983 at r4 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
Update error text, and check whether there are other errors with
issuer
.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 19 of 19 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @wojtek-coreum, and @ysv)
proto/coreum/asset/ft/v1/tx.proto
line 136 at r4 (raw file):
Previously, masihyeganeh (Masih Yeganeh) wrote…
Yeah, I was going to do that in a separate PR, but since my PRs are open for a while and they have some fundamental changed, I did it here.
I'm open to change the name but it is good enough IMO
ClearAdmin is better.
7359b67
to
cc7278c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 11 of 32 files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @miladz68, @wojtek-coreum, and @ysv)
proto/coreum/asset/ft/v1/tx.proto
line 136 at r4 (raw file):
Previously, miladz68 (milad) wrote…
ClearAdmin is better.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 11 of 32 files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @miladz68, @wojtek-coreum, and @ysv)
integration-tests/modules/wasm_test.go
line 1361 at r4 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
@keyleu Could you please add a TODO for the WASM SDK update to resolve all
Remove this line, once WASM SDK is updated
comments.
We have a task for this already.
87073e8
to
8d73459
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 9 of 9 files at r13, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @wojtek-coreum and @ysv)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 9 of 9 files at r13, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @wojtek-coreum and @ysv)
Description
Reviewers checklist:
Authors checklist
This change is