Skip to content

Commit 1138cce

Browse files
authored
! fix: indexing in get_first_worker_that_is_not_equal_to_self (#150)
1 parent cdb7450 commit 1138cce

File tree

1 file changed

+3
-2
lines changed
  • substratee-node-primitives/src

1 file changed

+3
-2
lines changed

substratee-node-primitives/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ pub mod calls {
6565
where
6666
MultiSignature: From<P::Signature>,
6767
{
68-
for n in 0..api.get_storage_value("SubstrateeRegistry", "EnclaveCount", None)? {
69-
let worker = get_worker_info(api, n)?;
68+
// the registry starts indexing its map at one
69+
for n in 1..=api.get_storage_value("SubstrateeRegistry", "EnclaveCount", None)? {
70+
let worker = get_worker_info(api, n).unwrap();
7071
if &worker.pubkey != self_account {
7172
return Some(worker);
7273
}

0 commit comments

Comments
 (0)