test(types, crypto): add unit tests to increase coverage - #993
Open
FibrinLab wants to merge 1 commit into
Open
Conversation
…sdk-types and iota-sdk-crypto
| #[test] | ||
| fn from_bytes_valid_roundtrip() { | ||
| use crate::ToFromBytes; | ||
| let key = Ed25519PrivateKey::new([42u8; 32]); |
Contributor
There was a problem hiding this comment.
Why not use rand for valid values? There are several types that we could do this for.
|
|
||
| #[cfg(feature = "serde")] | ||
| #[test] | ||
| fn try_from_u8_intent_app_id_valid() { |
Contributor
There was a problem hiding this comment.
Why not combine methods like this with the ones like intent_app_id_is_accessors
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves
#504
Adds unit tests across iota-sdk-types and iota-sdk-crypto targeting uncovered validation, parsing, error paths, and serialization logic.
iota-sdk-types: intent constructors and roundtrips, object_id conversions, multisig is_valid() rules, digest parsing errors, identifier validation, transaction BCS/base64 roundtrips, iota_names label validation.
iota-sdk-crypto: bitmap indices, multisig aggregator sign/verify roundtrip, ed25519 key validation and PEM/DER roundtrips, flagged bytes and bech32 encoding, mnemonic generation.