-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow passing an index for test inputs IDs
- Loading branch information
1 parent
9540ac5
commit 4ff8ed7
Showing
15 changed files
with
2,938 additions
and
2,440 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
// Copyright 2020-2021 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use crate::types::block::{payload::signed_transaction::TransactionId, rand::bytes::rand_bytes_array}; | ||
use crate::types::block::{ | ||
payload::signed_transaction::{TransactionHash, TransactionId}, | ||
rand::bytes::rand_bytes_array, | ||
slot::SlotIndex, | ||
}; | ||
|
||
/// Generates a random transaction id. | ||
pub fn rand_transaction_id() -> TransactionId { | ||
TransactionId::new(rand_bytes_array()) | ||
} | ||
|
||
/// Generates a random transaction id with a given slot index. | ||
pub fn rand_transaction_id_with_slot_index(slot_index: impl Into<SlotIndex>) -> TransactionId { | ||
TransactionHash::new(rand_bytes_array()).into_transaction_id(slot_index.into()) | ||
} |
This file contains 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
Oops, something went wrong.