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

[feature]: #1572: Specialized permission tokens #2156

Merged
merged 5 commits into from May 4, 2022

Conversation

QuentinI
Copy link
Contributor

Description of the Change

Created concrete types for PermissionTokens predefined in public_blockchain to enable client interaction with public_blockchain be less stringly-typed.
Added cli util to list the new concrete token types.

Issue

Resolves #1572

Benefits

Less stringly-typed public_blockchain.

Possible Drawbacks

None?

@github-actions github-actions bot added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label Apr 27, 2022
@QuentinI QuentinI force-pushed the 1572-permission-tokens branch 2 times, most recently from 5d7f510 to 91181da Compare April 27, 2022 14:29
@QuentinI QuentinI marked this pull request as ready for review April 27, 2022 15:09
Cargo.toml Outdated Show resolved Hide resolved
@mversic mversic self-assigned this Apr 28, 2022
permissions_validators/src/public_blockchain/unregister.rs Outdated Show resolved Hide resolved
client/tests/integration/roles.rs Outdated Show resolved Hide resolved
client/tests/integration/roles.rs Outdated Show resolved Hide resolved
permissions_validators/Cargo.toml Show resolved Hide resolved
permissions_validators/src/public_blockchain/mod.rs Outdated Show resolved Hide resolved
permissions_validators/src/public_blockchain/mod.rs Outdated Show resolved Hide resolved
tools/permission_tokens/src/main.rs Outdated Show resolved Hide resolved
@QuentinI QuentinI force-pushed the 1572-permission-tokens branch 3 times, most recently from 644b51b to 8d19521 Compare April 29, 2022 13:15
appetrosyan
appetrosyan previously approved these changes May 2, 2022
Copy link
Contributor

@appetrosyan appetrosyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to update telegram channels with API changes.

@QuentinI
Copy link
Contributor Author

QuentinI commented May 2, 2022

@mversic, added NewRole builder per your suggestion.

mversic
mversic previously approved these changes May 3, 2022
data_model/src/role.rs Outdated Show resolved Hide resolved
data_model/src/role.rs Outdated Show resolved Hide resolved
Comment on lines +7 to +14
declare_token!(
/// Can burn asset with the corresponding asset definition.
CanBurnAssetWithDefinition {
/// Asset definition id.
asset_definition_id ("asset_definition_id"): DefinitionId,
},
"can_burn_asset_with_definition"
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be a derive macro:

Suggested change
declare_token!(
/// Can burn asset with the corresponding asset definition.
CanBurnAssetWithDefinition {
/// Asset definition id.
asset_definition_id ("asset_definition_id"): DefinitionId,
},
"can_burn_asset_with_definition"
);
/// Can burn asset with the corresponding asset definition.
#[derive(Permission)]
struct CanBurnAssetWithDefinition {
/// Asset definition id.
asset_definition_id: DefinitionId,
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose to leave it as macro_rules because I don't have a lot of experience writing procedural macros and this one is straightforward enough to be understandable in spite of it's length IMO.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's create a ticket for it in chores.

permissions_validators/src/lib.rs Show resolved Hide resolved
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
Artemii Gerasimovich and others added 4 commits May 3, 2022 15:05
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
Signed-off-by: Quentin Inkling <mbee@protonmail.ch>
Signed-off-by: Quentin Inkling <mbee@protonmail.ch>
Signed-off-by: Quentin Inkling <mbee@protonmail.ch>
@mversic mversic requested review from mversic and s8sato May 4, 2022 06:32
@appetrosyan appetrosyan merged commit 26dc6eb into hyperledger:iroha2-dev May 4, 2022
appetrosyan pushed a commit to appetrosyan/iroha that referenced this pull request May 12, 2022
…er#2156)

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

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

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

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

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

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

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

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

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

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
mversic pushed a commit to mversic/iroha that referenced this pull request May 13, 2022
…er#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
iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants