fix(account): each signer type has its own account index sequence
@@ -185,10 +185,17 @@ impl AccountInitialiser {
}
}
+ let mut account_index = 0;
+ for account in accounts.values() {
+ if account.read().await.signer_type() == &signer_type {
+ account_index += 1;
+ }
+ }
+
let mut account = Account {
- id: accounts.len().to_string(),
+ id: account_index.to_string(),
signer_type: signer_type.clone(),
- index: accounts.len(),
+ index: account_index,
alias,
created_at,
messages: self.messages,
