Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Dec 23, 2024
1 parent 2ab835e commit 072d11f
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions service/src/main_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,12 +540,9 @@ fn start_worker<E, T, D, InitializationHandler, WorkerModeProvider>(
.expect("our enclave should be registered at this point");
trace!("verified that our enclave is registered: {:?}", my_enclave);

let (we_are_primary_validateer, re_init_parentchain_needed) = match integritee_rpc_api
.primary_worker_for_shard(shard, None)
.unwrap()
{
Some(primary_enclave) =>
match primary_enclave.instance_signer() {
let (we_are_primary_validateer, re_init_parentchain_needed) =
match integritee_rpc_api.primary_worker_for_shard(shard, None).unwrap() {
Some(primary_enclave) => match primary_enclave.instance_signer() {
AnySigner::Known(MultiSigner::Ed25519(primary)) =>
if primary.encode() == tee_accountid.encode() {
println!("We are primary worker on this shard and we have been previously running.");
Expand Down Expand Up @@ -580,24 +577,24 @@ fn start_worker<E, T, D, InitializationHandler, WorkerModeProvider>(
);
},
},
None => {
println!("We are the primary worker on this shard and the shard is untouched. Will initialize it");
enclave.init_shard(shard.encode()).unwrap();
if WorkerModeProvider::worker_mode() != WorkerMode::Teeracle {
enclave
.init_shard_creation_parentchain_header(
shard,
&ParentchainId::Integritee,
&register_enclave_xt_header,
)
.unwrap();
debug!("shard config should be initialized on integritee network now");
(true, true)
} else {
(true, false)
}
},
};
None => {
println!("We are the primary worker on this shard and the shard is untouched. Will initialize it");
enclave.init_shard(shard.encode()).unwrap();
if WorkerModeProvider::worker_mode() != WorkerMode::Teeracle {
enclave
.init_shard_creation_parentchain_header(
shard,
&ParentchainId::Integritee,
&register_enclave_xt_header,
)
.unwrap();
debug!("shard config should be initialized on integritee network now");
(true, true)
} else {
(true, false)
}
},
};
debug!("getting shard creation: {:?}", enclave.get_shard_creation_info(shard));
initialization_handler.registered_on_parentchain();

Expand Down

0 comments on commit 072d11f

Please sign in to comment.