From b896a6cfb3f40b0cde3c4584db8890c7705b6fd4 Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Thu, 16 Nov 2023 19:34:48 +0100 Subject: [PATCH] Some more fixes --- sdk/src/types/block/output/basic.rs | 4 ++-- sdk/src/types/block/output/feature/mod.rs | 1 + sdk/src/types/block/output/feature/native_token.rs | 4 +++- sdk/src/wallet/operations/output_claiming.rs | 2 -- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sdk/src/types/block/output/basic.rs b/sdk/src/types/block/output/basic.rs index 221f68d1fa..07b2053627 100644 --- a/sdk/src/types/block/output/basic.rs +++ b/sdk/src/types/block/output/basic.rs @@ -533,13 +533,13 @@ mod tests { }; let builder = BasicOutput::build_with_amount(100) - .add_native_token(NativeToken::new(TokenId::from(foundry_id), 1000).unwrap()) + .with_native_token(NativeToken::new(TokenId::from(foundry_id), 1000).unwrap()) .add_unlock_condition(address.clone()) .with_features(rand_allowed_features(BasicOutput::ALLOWED_FEATURES)); test_split_dto(builder); let builder = BasicOutput::build_with_minimum_amount(protocol_parameters.storage_score_parameters()) - .add_native_token(NativeToken::new(TokenId::from(foundry_id), 1000).unwrap()) + .with_native_token(NativeToken::new(TokenId::from(foundry_id), 1000).unwrap()) .add_unlock_condition(address) .with_features(rand_allowed_features(BasicOutput::ALLOWED_FEATURES)); test_split_dto(builder); diff --git a/sdk/src/types/block/output/feature/mod.rs b/sdk/src/types/block/output/feature/mod.rs index 654f2f4815..7f3a04c1c8 100644 --- a/sdk/src/types/block/output/feature/mod.rs +++ b/sdk/src/types/block/output/feature/mod.rs @@ -83,6 +83,7 @@ impl StorageScore for Feature { Self::Issuer(feature) => feature.storage_score(params), Self::Metadata(feature) => feature.storage_score(params), Self::Tag(feature) => feature.storage_score(params), + Self::NativeToken(feature) => feature.storage_score(params), Self::BlockIssuer(feature) => feature.storage_score(params), Self::Staking(feature) => feature.storage_score(params), } diff --git a/sdk/src/types/block/output/feature/native_token.rs b/sdk/src/types/block/output/feature/native_token.rs index 72007f32bb..5a79299d43 100644 --- a/sdk/src/types/block/output/feature/native_token.rs +++ b/sdk/src/types/block/output/feature/native_token.rs @@ -3,7 +3,7 @@ use derive_more::{Deref, From}; -use crate::types::block::output::NativeToken; +use crate::types::block::output::{NativeToken, StorageScore}; #[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Deref, From, packable::Packable)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] @@ -23,3 +23,5 @@ impl NativeTokenFeature { &self.0 } } + +impl StorageScore for NativeTokenFeature {} diff --git a/sdk/src/wallet/operations/output_claiming.rs b/sdk/src/wallet/operations/output_claiming.rs index 5b8dcffbff..93d7a7bf28 100644 --- a/sdk/src/wallet/operations/output_claiming.rs +++ b/sdk/src/wallet/operations/output_claiming.rs @@ -280,8 +280,6 @@ where .with_minimum_amount(storage_score_params) .with_nft_id(nft_output.nft_id_non_null(&output_data.output_id)) .with_unlock_conditions([AddressUnlockCondition::new(wallet_address.clone())]) - // Set native tokens empty, we will collect them from all inputs later - .with_native_tokens([]) .finish_output()? };