-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(strategy-tests): add extra_keys field for StartIdentities and use random identities for transfers #1794
Conversation
packages/strategy-tests/src/lib.rs
Outdated
// Make sure we insert a key for transfers | ||
let mut key_maps: KeyMaps = [( | ||
Purpose::TRANSFER, | ||
[(SecurityLevel::CRITICAL, vec![KeyType::ECDSA_SECP256K1])].into(), | ||
)] | ||
.into(); | ||
let mut new_key_count = self.start_identities.keys_per_identity - 1; | ||
|
||
// Also an authentication key with critical security level for documents | ||
key_maps.insert( | ||
Purpose::AUTHENTICATION, | ||
[(SecurityLevel::CRITICAL, vec![KeyType::ECDSA_SECP256K1])].into(), | ||
); | ||
new_key_count -= 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I on purpose didn't want to add the transfer key to all identities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. I added extra_keys field for StartIdentities struct and the users can select whether or not to add a transfer key in the TUI
packages/strategy-tests/src/lib.rs
Outdated
for identity in &identities { | ||
identity_nonce_counter.insert(identity.id(), 1); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this means we would start things at 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed (removed it because it wasn't necessary)
packages/strategy-tests/src/lib.rs
Outdated
} | ||
|
||
// Select a random identity from the current_identities for the sender | ||
let random_index_sender = thread_rng().gen_range(0..identities_count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't you want to use rng, so that tests are determinisitic based on the seed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Changed to rng
Issue being fixed or feature implemented
We might want Strategy StartIdentities to have transfer keys or other extra keys in addition to the main keys. Also, there was an issue with public key IDs in
transitions.rs
.What was done?
We add an extra_keys field similar to that in IdentityInserts and fix the issue in
transitions.rs
.How Has This Been Tested?
Platform TUI strategy tests
Breaking Changes
Checklist:
For repository code-owners and collaborators only