Skip to content

Commit

Permalink
[refactor] #3640: place permission tokens in a separate module
Browse files Browse the repository at this point in the history
Signed-off-by: Marin Veršić <[email protected]>
  • Loading branch information
mversic committed Oct 6, 2023
1 parent d865251 commit c26299a
Show file tree
Hide file tree
Showing 4 changed files with 546 additions and 563 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl Validator {

for token in permission_tokens {
if let Ok(can_unregister_domain_token) =
iroha_validator::default::domain::tokens::CanUnregisterDomain::try_from(token)
iroha_validator::tokens::domain::CanUnregisterDomain::try_from(token)
{
found_accounts.push((account, can_unregister_domain_token.domain_id));
break;
Expand All @@ -108,7 +108,7 @@ impl Validator {

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

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

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

let (token_ids, schema_str) = schema.serialize();
Expand Down
Loading

0 comments on commit c26299a

Please sign in to comment.