Skip to content

Commit

Permalink
Some renames lost in the merge
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Nov 8, 2023
1 parent dff70c8 commit 5e214c3
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions sdk/src/wallet/operations/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ where
wallet_data: &WalletData,
) -> Result<Balance> {
let network_id = self.client().get_network_id().await?;
let storage_params = self.client().get_storage_score_parameters().await?;
let storage_score_params = self.client().get_storage_score_parameters().await?;
let mut balance = Balance::default();
let mut total_rent_amount = 0;
let mut total_native_tokens = NativeTokensBuilder::default();
Expand All @@ -58,7 +58,7 @@ where
}

let output = &output_data.output;
let storage_cost = output.storage_cost(storage_params);
let storage_cost = output.storage_cost(storage_score_params);

// Add account and foundry outputs here because they can't have a
// [`StorageDepositReturnUnlockCondition`] or time related unlock conditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ where
options: impl Into<Option<TransactionOptions>> + Send,
) -> crate::wallet::Result<PreparedTransactionData> {
log::debug!("[TRANSACTION] prepare_create_account_output");
let storage_params = self.client().get_storage_score_parameters().await?;
let storage_score_params = self.client().get_storage_score_parameters().await?;

let address = match params.as_ref().and_then(|options| options.address.as_ref()) {
Some(bech32_address) => {
Expand All @@ -85,7 +85,7 @@ where
};

let mut account_output_builder =
AccountOutputBuilder::new_with_minimum_amount(storage_params, AccountId::null())
AccountOutputBuilder::new_with_minimum_amount(storage_score_params, AccountId::null())
.with_foundry_counter(0)
.add_unlock_condition(AddressUnlockCondition::new(address.clone()));
if let Some(CreateAccountParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ where
options: impl Into<Option<TransactionOptions>> + Send,
) -> crate::wallet::Result<PreparedCreateNativeTokenTransaction> {
log::debug!("[TRANSACTION] create_native_token");
let storage_params = self.client().get_storage_score_parameters().await?;
let storage_score_params = self.client().get_storage_score_parameters().await?;

let (account_id, account_output) = self
.get_account_output(params.account_id)
Expand All @@ -158,7 +158,7 @@ where
new_account_output_builder.finish_output()?,
{
let mut foundry_builder = FoundryOutputBuilder::new_with_minimum_amount(
storage_params,
storage_score_params,
account_output.foundry_counter() + 1,
TokenScheme::Simple(SimpleTokenScheme::new(
params.circulating_supply,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ where
I::IntoIter: Send,
{
log::debug!("[TRANSACTION] prepare_mint_nfts");
let storage_params = self.client().get_storage_score_parameters().await?;
let storage_score_params = self.client().get_storage_score_parameters().await?;
let wallet_address = self.address().await.into_inner();
let mut outputs = Vec::new();

Expand All @@ -183,7 +183,7 @@ where
};

// NftId needs to be set to 0 for the creation
let mut nft_builder = NftOutputBuilder::new_with_minimum_amount(storage_params, NftId::null())
let mut nft_builder = NftOutputBuilder::new_with_minimum_amount(storage_score_params, NftId::null())
// Address which will own the nft
.add_unlock_condition(AddressUnlockCondition::new(address));

Expand Down
6 changes: 3 additions & 3 deletions sdk/src/wallet/operations/transaction/high_level/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ where
{
log::debug!("[TRANSACTION] prepare_send");
let options = options.into();
let storage_params = self.client().get_storage_score_parameters().await?;
let storage_score_params = self.client().get_storage_score_parameters().await?;
let token_supply = self.client().get_token_supply().await?;

let wallet_address = self.address().await;
Expand Down Expand Up @@ -173,7 +173,7 @@ where
.add_unlock_condition(AddressUnlockCondition::new(address))
.finish()?;

if amount >= output.storage_cost(storage_params) {
if amount >= output.storage_cost(storage_score_params) {
outputs.push(output.into())
} else {
let expiration_slot_index = expiration
Expand All @@ -187,7 +187,7 @@ where
return_address.clone(),
expiration_slot_index,
)?)
.with_sufficient_storage_deposit(return_address, storage_params, token_supply)?
.with_sufficient_storage_deposit(return_address, storage_score_params, token_supply)?
.finish_output()?;

if !options.as_ref().map(|o| o.allow_micro_amount).unwrap_or_default() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ where
I::IntoIter: Send,
{
log::debug!("[TRANSACTION] prepare_send_native_tokens");
let storage_params = self.client().get_storage_score_parameters().await?;
let storage_score_params = self.client().get_storage_score_parameters().await?;
let token_supply = self.client().get_token_supply().await?;

let wallet_address = self.address().await;
Expand Down Expand Up @@ -179,7 +179,7 @@ where
return_address.clone(),
expiration_slot_index,
)?)
.with_sufficient_storage_deposit(return_address, storage_params, token_supply)?
.with_sufficient_storage_deposit(return_address, storage_score_params, token_supply)?
.finish_output()?,
)
}
Expand Down
14 changes: 7 additions & 7 deletions sdk/src/wallet/operations/transaction/prepare_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ where

self.client().bech32_hrp_matches(params.recipient_address.hrp()).await?;

let storage_params = self.client().get_storage_score_parameters().await?;
let storage_score_params = self.client().get_storage_score_parameters().await?;

let nft_id = params.assets.as_ref().and_then(|a| a.nft_id);

let (mut first_output_builder, existing_nft_output_data) = self
.create_initial_output_builder(params.recipient_address, nft_id, storage_params)
.create_initial_output_builder(params.recipient_address, nft_id, storage_score_params)
.await?;

if let Some(assets) = &params.assets {
Expand Down Expand Up @@ -105,7 +105,7 @@ where

// Build output with minimum required storage deposit so we can use the amount in the next step
let first_output = first_output_builder
.with_minimum_amount(storage_params)
.with_minimum_amount(storage_score_params)
.finish_output(token_supply)?;

let mut second_output_builder = if nft_id.is_some() {
Expand All @@ -115,12 +115,12 @@ where
};

// TODO: Probably not good to use ed25519 always here, even if technically it's the same for now..
let min_storage_deposit_basic_output = BasicOutputBuilder::new_with_minimum_amount(storage_params)
let min_storage_deposit_basic_output = BasicOutputBuilder::new_with_minimum_amount(storage_score_params)
.add_unlock_condition(AddressUnlockCondition::new(Ed25519Address::null()))
.finish()?
.amount();

let min_required_storage_deposit = first_output.storage_cost(storage_params);
let min_required_storage_deposit = first_output.storage_cost(storage_score_params);

if params.amount > min_required_storage_deposit {
second_output_builder = second_output_builder.with_amount(params.amount);
Expand Down Expand Up @@ -152,7 +152,7 @@ where
// need to check the min required storage deposit again
let min_storage_deposit_new_amount = second_output_builder
.clone()
.with_minimum_amount(storage_params)
.with_minimum_amount(storage_score_params)
.finish_output(token_supply)?
.amount();

Expand Down Expand Up @@ -182,7 +182,7 @@ where
// If we're sending an existing NFT, its minimum required storage deposit is not part of the available base_coin
// balance, so we add it here
if let Some(existing_nft_output_data) = existing_nft_output_data {
available_base_coin += existing_nft_output_data.output.storage_cost(storage_params);
available_base_coin += existing_nft_output_data.output.storage_cost(storage_score_params);
}

if final_amount > available_base_coin {
Expand Down

0 comments on commit 5e214c3

Please sign in to comment.