Skip to content

Commit

Permalink
Add rand_issuer_id
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Sep 13, 2023
1 parent f3ae45a commit 69b9d68
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdk/src/types/block/rand/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::types::block::{
protocol::ProtocolParameters,
rand::{
bytes::rand_bytes_array,
issuer_id::rand_issuer_id,
number::rand_number,
parents::rand_strong_parents,
payload::rand_payload_for_block,
Expand Down Expand Up @@ -42,8 +43,7 @@ pub fn rand_block_wrapper_with_block(protocol_params: ProtocolParameters, block:
rand_number(),
rand_slot_commitment_id(),
rand_slot_index(),
// TODO rand_issuer_id
rand_bytes_array().into(),
rand_issuer_id(),
block,
rand_signature(),
)
Expand Down
9 changes: 9 additions & 0 deletions sdk/src/types/block/rand/issuer_id.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use crate::types::block::{issuer_id::IssuerId, rand::bytes::rand_bytes_array};

/// Generates a random issuer id.
pub fn rand_issuer_id() -> IssuerId {
IssuerId::new(rand_bytes_array())
}
2 changes: 2 additions & 0 deletions sdk/src/types/block/rand/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ pub mod bool;
pub mod bytes;
/// Module providing random input generation utilities.
pub mod input;
/// Module providing random issuer ID generation utilities.
pub mod issuer_id;
/// Module providing random mana generation utilities.
pub mod mana;
/// Module providing random number generation utilities.
Expand Down

0 comments on commit 69b9d68

Please sign in to comment.