This repository was archived by the owner on May 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Add mana semantic validation #1700
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
c51f7c8
validate some mana semantics
a48efcc
Merge branch '2.0' into feat/mana-semantics
73df348
Merge branch '2.0' into feat/mana-semantics
476095e
Merge branch '2.0' into feat/mana-semantics
thibault-martinez a0ad146
Cleanup
thibault-martinez 5cc119f
delta->diff
thibault-martinez d1f8f35
Merge branch '2.0' into feat/mana-semantics
93ff09b
Merge branch '2.0' into feat/mana-semantics
thibault-martinez c226598
Merge branch '2.0' into feat/mana-semantics
thibault-martinez 9540ac5
Nit
thibault-martinez 4ff8ed7
Allow passing an index for test inputs IDs
thibault-martinez 2239db3
Fix tests
thibault-martinez 29cecc6
Merge branch '2.0' into feat/mana-semantics
thibault-martinez 71b34ef
rand nit
thibault-martinez 14dd3cc
Simplify tests
thibault-martinez 3923f24
Add link to issue
thibault-martinez fc9ef2e
Update sdk/src/types/block/semantic/mod.rs
thibault-martinez 524f2f5
Merge branch '2.0' into feat/mana-semantics
Alex6323 e220ea5
Format
thibault-martinez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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, number::rand_number}, | ||
slot::SlotIndex, | ||
}; | ||
|
||
/// 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()) | ||
} | ||
|
||
/// Generates a random transaction id. | ||
pub fn rand_transaction_id() -> TransactionId { | ||
TransactionId::new(rand_bytes_array()) | ||
rand_transaction_id_with_slot_index(rand_number::<u32>()) | ||
} |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.