Skip to content

test(types, crypto): add unit tests to increase coverage - #993

Open
FibrinLab wants to merge 1 commit into
iotaledger:developfrom
FibrinLab:increase-test-coverage
Open

test(types, crypto): add unit tests to increase coverage#993
FibrinLab wants to merge 1 commit into
iotaledger:developfrom
FibrinLab:increase-test-coverage

Conversation

@FibrinLab

Copy link
Copy Markdown

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.

@FibrinLab
FibrinLab requested a review from a team as a code owner March 1, 2026 21:53
#[test]
fn from_bytes_valid_roundtrip() {
use crate::ToFromBytes;
let key = Ed25519PrivateKey::new([42u8; 32]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not combine methods like this with the ones like intent_app_id_is_accessors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants