Skip to content

Commit

Permalink
chore: linter and revert change
Browse files Browse the repository at this point in the history
  • Loading branch information
therealdannzor committed Sep 4, 2024
1 parent 8dbaee2 commit 6863eb7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
25 changes: 15 additions & 10 deletions dan_layer/engine_types/src/substate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ use tari_bor::{decode, decode_exact, encode, BorError};
use tari_common_types::types::FixedHash;
use tari_template_lib::{
models::{
ComponentAddress, NonFungibleAddress, NonFungibleIndexAddress, ObjectKey, ResourceAddress,
UnclaimedConfidentialOutputAddress, VaultId,
ComponentAddress,
NonFungibleAddress,
NonFungibleIndexAddress,
ObjectKey,
ResourceAddress,
UnclaimedConfidentialOutputAddress,
VaultId,
},
prelude::PUBLIC_IDENTITY_RESOURCE_ADDRESS,
Hash,
Expand Down Expand Up @@ -147,14 +152,14 @@ impl SubstateId {
/// Returns true for any substate that has is "versionable" i.e. can have a version > 0, otherwise false.
pub fn is_versioned(&self) -> bool {
match self {
SubstateId::Component(_)
| SubstateId::Resource(_)
| SubstateId::Vault(_)
| SubstateId::NonFungibleIndex(_)
| SubstateId::NonFungible(_) => true,
SubstateId::UnclaimedConfidentialOutput(_)
| SubstateId::TransactionReceipt(_)
| SubstateId::FeeClaim(_) => false,
SubstateId::Component(_) |
SubstateId::Resource(_) |
SubstateId::Vault(_) |
SubstateId::NonFungibleIndex(_) |
SubstateId::NonFungible(_) => true,
SubstateId::UnclaimedConfidentialOutput(_) |
SubstateId::TransactionReceipt(_) |
SubstateId::FeeClaim(_) => false,
}
}

Expand Down
4 changes: 4 additions & 0 deletions dan_layer/transaction_manifest/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ impl FromStr for ManifestValue {
SubstateId::from_str(s)
.ok()
.map(ManifestValue::SubstateId)
.or_else(|| {
let id = NonFungibleId::try_from_canonical_string(s).ok()?;
Some(ManifestValue::NonFungibleId(id))
})
.or_else(|| {
let tokens = s.parse().ok()?;
let lit = parse2(tokens).ok()?;
Expand Down

0 comments on commit 6863eb7

Please sign in to comment.