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

Create an enum for Permission tokens and a cli helper to return all tokens #1572

Closed
e-ivkov opened this issue Nov 1, 2021 · 0 comments
Closed
Assignees
Labels
Enhancement New feature or request good first issue Good for newcomers iroha2-dev The re-implementation of a BFT hyperledger in RUST

Comments

@e-ivkov
Copy link
Contributor

e-ivkov commented Nov 1, 2021

Bogdan Mingela, [11.10.21 13:01]
Hi! Could I request to plan activities related to:

  1. including Grant tokens values into the model scheme to have them formally defined, not be expected as 'arbitrary' string values
    ...
    Thanks!
@eadventurous

Egor Ivkov, [29.10.21 13:33]
[In reply to Bogdan Mingela]
The issue with the Grant tokens being string values comes from the fact that we wanted to separate core from permission_validators so that projects can add their own arbitrary validators while using the same core library. For this we needed dynamic (not strictly typed) values - for validators these are Box<dyn _> for tokens the String type was chosen. If we would have added and enum with all tokens there - then it would not be possible to use core with different validators and their corresponding tokens from different modules.

Egor Ivkov, [29.10.21 13:39]
With the possible permission checks with Triggers - there will be even more sense to keep tokens a String or byte value. As Triggers can be updated at runtime with corresponding permission tokens.

Ivan Rybin, [29.10.21 14:50]
We can probably make it like this: create a type which represent some specific permission token which implements Into trait for generic permission token

Ivan Rybin, [29.10.21 14:51]
On client side they can do dynamic conversion of it into generic token with strings

Egor Ivkov, [29.10.21 15:01]
[In reply to Ivan Rybin]
In general I like the idea, I think we can proceed with it. And give a cli helper for clients to get String reprs in json for example.

Ivan Rybin, [29.10.21 15:01]
[In reply to Egor Ivkov]
Btw we can even make an enum for gathering all tokens

Ivan Rybin, [29.10.21 15:02]
And just make conversion between this enum and generic permission token

Egor Ivkov, [29.10.21 15:04]
[In reply to Ivan Rybin]
Sure
@e-ivkov e-ivkov added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label Nov 1, 2021
@appetrosyan appetrosyan added the Enhancement New feature or request label Feb 20, 2022
@appetrosyan appetrosyan added the good first issue Good for newcomers label Apr 19, 2022
@QuentinI QuentinI self-assigned this Apr 25, 2022
appetrosyan pushed a commit that referenced this issue May 4, 2022
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
appetrosyan pushed a commit to appetrosyan/iroha that referenced this issue May 12, 2022
…erledger-iroha#2156)

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
appetrosyan pushed a commit to appetrosyan/iroha that referenced this issue May 12, 2022
…erledger-iroha#2156)

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
appetrosyan pushed a commit to appetrosyan/iroha that referenced this issue May 12, 2022
…erledger-iroha#2156)

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
appetrosyan pushed a commit to appetrosyan/iroha that referenced this issue May 12, 2022
…erledger-iroha#2156)

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
appetrosyan pushed a commit to appetrosyan/iroha that referenced this issue May 12, 2022
…erledger-iroha#2156)

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
appetrosyan pushed a commit to appetrosyan/iroha that referenced this issue May 12, 2022
…erledger-iroha#2156)

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
appetrosyan pushed a commit to appetrosyan/iroha that referenced this issue May 12, 2022
…erledger-iroha#2156)

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
appetrosyan pushed a commit to appetrosyan/iroha that referenced this issue May 12, 2022
…erledger-iroha#2156)

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
appetrosyan pushed a commit to appetrosyan/iroha that referenced this issue May 12, 2022
…erledger-iroha#2156)

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
appetrosyan pushed a commit to appetrosyan/iroha that referenced this issue May 12, 2022
…erledger-iroha#2156)

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
mversic pushed a commit to mversic/iroha that referenced this issue May 13, 2022
…erledger-iroha#2156)

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request good first issue Good for newcomers iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

No branches or pull requests

4 participants