Skip to content

Commit fc34eea

Browse files
committed
Correction after rebase.
1 parent 29fd045 commit fc34eea

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

linera-execution/src/system.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,15 +444,15 @@ where
444444
self.ownership.set(ownership);
445445
}
446446
ChangeApplicationPermissions(application_permissions) => {
447-
let current_ownership = self.ownership.get();
447+
let current_ownership = self.ownership.get().await?;
448448
match context.authenticated_owner {
449449
Some(owner) if current_ownership.super_owners.contains(&owner) => {}
450450
_ => return Err(ExecutionError::UnauthorizedChangeApplicationPermissions),
451451
}
452452
self.application_permissions.set(application_permissions);
453453
}
454454
CloseChain => {
455-
let current_ownership = self.ownership.get();
455+
let current_ownership = self.ownership.get().await?;
456456
match context.authenticated_owner {
457457
Some(owner) if current_ownership.super_owners.contains(&owner) => {}
458458
_ => return Err(ExecutionError::UnauthorizedCloseChain),

linera-execution/tests/test_system_execution.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ async fn test_change_super_owners_by_super_owner() -> anyhow::Result<()> {
163163
ExecutionStateActor::new(&mut view, &mut txn_tracker, &mut controller)
164164
.execute_operation(context, Operation::system(operation))
165165
.await?;
166-
let new_ownership = view.system.ownership.get();
166+
let new_ownership = view.system.ownership.get().await?;
167167
assert!(new_ownership.super_owners.contains(&new_super_owner));
168168
assert!(!new_ownership.super_owners.contains(&super_owner));
169169
assert_eq!(
@@ -346,7 +346,7 @@ async fn test_change_owners_preserves_super_owners() -> anyhow::Result<()> {
346346
ExecutionStateActor::new(&mut view, &mut txn_tracker, &mut controller)
347347
.execute_operation(context, Operation::system(operation))
348348
.await?;
349-
let new_ownership = view.system.ownership.get();
349+
let new_ownership = view.system.ownership.get().await?;
350350
// Super owners are preserved by ChangeOwners.
351351
assert!(new_ownership.super_owners.contains(&super_owner));
352352
// Regular owners were changed.
@@ -555,7 +555,10 @@ async fn test_change_application_permissions_by_super_owner() -> anyhow::Result<
555555
ExecutionStateActor::new(&mut view, &mut txn_tracker, &mut controller)
556556
.execute_operation(context, Operation::system(operation))
557557
.await?;
558-
assert_eq!(view.system.application_permissions.get(), &new_permissions);
558+
assert_eq!(
559+
view.system.application_permissions.get().await?,
560+
&new_permissions
561+
);
559562
Ok(())
560563
}
561564

@@ -605,7 +608,7 @@ async fn test_change_application_permissions_by_regular_owner_fails() -> anyhow:
605608
));
606609
// Permissions should be unchanged.
607610
assert_eq!(
608-
view.system.application_permissions.get(),
611+
view.system.application_permissions.get().await?,
609612
&initial_permissions
610613
);
611614
Ok(())

0 commit comments

Comments
 (0)