Skip to content

Commit

Permalink
Remove KIP9 Alpha version references
Browse files Browse the repository at this point in the history
  • Loading branch information
surinder83singh committed Dec 9, 2024
1 parent ef92116 commit 53fd7f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
4 changes: 1 addition & 3 deletions wallet/core/src/tx/generator/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::error::Error;
use crate::result::Result;
use crate::tx::{Fees, MassCalculator, PaymentDestination};
use crate::utxo::{NetworkParams, UtxoEntryReference};
use crate::utxo::UtxoEntryReference;
use crate::{tx::PaymentOutputs, utils::kaspa_to_sompi};
use kaspa_addresses::Address;
use kaspa_consensus_core::config::params::Params;
Expand Down Expand Up @@ -782,14 +782,12 @@ fn test_generator_fan_out_1() -> Result<()> {
use kaspa_consensus_core::mass::calc_storage_mass;

let network_id = test_network_id();
let network_params = NetworkParams::from(network_id);
let consensus_params = Params::from(network_id);

let storage_mass = calc_storage_mass(
false,
[100000000, 8723579967].into_iter(),
[20000000, 25000000, 31000000].into_iter(),
network_params.kip9_version,
consensus_params.storage_mass_parameter,
);

Expand Down
10 changes: 2 additions & 8 deletions wallet/core/src/wasm/tx/mass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,12 @@ pub fn calculate_unsigned_transaction_fee(
pub fn calculate_storage_mass(network_id: NetworkIdT, input_values: &NumberArray, output_values: &NumberArray) -> Result<Option<u64>> {
let network_id = NetworkId::try_owned_from(network_id)?;
let consensus_params = Params::from(network_id);
let network_params = NetworkParams::from(network_id);

let input_values = Array::from(input_values).to_vec().iter().map(|v| v.as_f64().unwrap() as u64).collect::<Vec<u64>>();
let output_values = Array::from(output_values).to_vec().iter().map(|v| v.as_f64().unwrap() as u64).collect::<Vec<u64>>();

let storage_mass = calc_storage_mass(
false,
input_values.into_iter(),
output_values.into_iter(),
network_params.kip9_version,
consensus_params.storage_mass_parameter,
);
let storage_mass =
calc_storage_mass(false, input_values.into_iter(), output_values.into_iter(), consensus_params.storage_mass_parameter);

Ok(storage_mass)
}

0 comments on commit 53fd7f8

Please sign in to comment.