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

[refactor] #3640: place permission tokens in a separate module #3940

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
//!
//! This executor should be applied on top of the blockchain with default validation.
//!
//! It also doesn't have [`iroha_executor::default::domain::tokens::CanUnregisterDomain`].
//! It also doesn't have [`iroha_executor::default::tokens::domain::CanUnregisterDomain`].
//!
//! In migration it replaces [`iroha_executor::default::domain::tokens::CanUnregisterDomain`]
//! In migration it replaces [`iroha_executor::default::tokens::domain::CanUnregisterDomain`]
//! with [`token::CanControlDomainLives`] for all accounts.
//! So it doesn't matter which domain user was able to unregister before migration, they will
//! get access to control all domains. Remember that this is just a test example.
Expand Down Expand Up @@ -108,7 +108,7 @@ impl Executor {
})?;

if let Ok(can_unregister_domain_token) =
iroha_executor::default::domain::tokens::CanUnregisterDomain::try_from(token)
iroha_executor::default::tokens::domain::CanUnregisterDomain::try_from(token)
{
found_accounts.push((account, can_unregister_domain_token.domain_id));
break;
Expand All @@ -121,7 +121,7 @@ impl Executor {

fn replace_token(accounts: &[(Account, DomainId)]) -> MigrationResult {
let can_unregister_domain_definition_id = PermissionTokenId::try_from(
iroha_executor::default::domain::tokens::CanUnregisterDomain::type_name(),
iroha_executor::default::tokens::domain::CanUnregisterDomain::type_name(),
)
.unwrap();

Expand Down Expand Up @@ -304,7 +304,7 @@ pub fn migrate(_block_height: u64) -> MigrationResult {
let accounts = Executor::get_all_accounts_with_can_unregister_domain_permission()?;

let mut schema = default_permission_token_schema();
schema.remove::<iroha_executor::default::domain::tokens::CanUnregisterDomain>();
schema.remove::<iroha_executor::default::tokens::domain::CanUnregisterDomain>();
schema.insert::<token::CanControlDomainLives>();

let (token_ids, schema_str) = schema.serialize();
Expand Down
Binary file modified configs/peer/executor.wasm
Binary file not shown.
Loading
Loading