diff --git a/packages/rs-dpp/src/state_transition/fee/mod.rs b/packages/rs-dpp/src/state_transition/fee/mod.rs index 0c0c515eb31..14ef6a12712 100644 --- a/packages/rs-dpp/src/state_transition/fee/mod.rs +++ b/packages/rs-dpp/src/state_transition/fee/mod.rs @@ -22,11 +22,11 @@ pub struct FeeResult { pub required_amount: Credits, } -#[derive(Default)] +#[derive(Debug, Clone, PartialEq, Eq, Default)] pub struct DummyFeesResult { - storage: Credits, - processing: Credits, - fee_refunds: Vec, + pub storage: Credits, + pub processing: Credits, + pub fee_refunds: Vec, } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] diff --git a/packages/wasm-dpp/src/document/state_transition/document_batch_transition/mod.rs b/packages/wasm-dpp/src/document/state_transition/document_batch_transition/mod.rs index ddebf0e65cc..98ef0820ef9 100644 --- a/packages/wasm-dpp/src/document/state_transition/document_batch_transition/mod.rs +++ b/packages/wasm-dpp/src/document/state_transition/document_batch_transition/mod.rs @@ -1,4 +1,5 @@ use dpp::identity::KeyID; +use dpp::state_transition::fee::calculate_state_transition_fee_factory::calculate_state_transition_fee; use dpp::{ document::{ document_transition::document_base_transition, diff --git a/packages/wasm-dpp/src/errors/consensus/fee/balance_is_not_enough_error.rs b/packages/wasm-dpp/src/errors/consensus/fee/balance_is_not_enough_error.rs index b516f1b770d..729283a89da 100644 --- a/packages/wasm-dpp/src/errors/consensus/fee/balance_is_not_enough_error.rs +++ b/packages/wasm-dpp/src/errors/consensus/fee/balance_is_not_enough_error.rs @@ -1,14 +1,15 @@ +use dpp::state_transition::fee::Credits; use wasm_bindgen::prelude::*; #[wasm_bindgen(js_name=BalanceIsNotEnoughError)] pub struct BalanceIsNotEnoughErrorWasm { - balance: u64, - fee: i64, + balance: Credits, + fee: Credits, code: u32, } impl BalanceIsNotEnoughErrorWasm { - pub fn new(balance: u64, fee: i64, code: u32) -> Self { + pub fn new(balance: Credits, fee: Credits, code: u32) -> Self { BalanceIsNotEnoughErrorWasm { balance, fee, code } } } @@ -16,12 +17,12 @@ impl BalanceIsNotEnoughErrorWasm { #[wasm_bindgen(js_class=BalanceIsNotEnoughError)] impl BalanceIsNotEnoughErrorWasm { #[wasm_bindgen(js_name=getBalance)] - pub fn get_balance(&self) -> u64 { + pub fn get_balance(&self) -> Credits { self.balance } #[wasm_bindgen(js_name=getFee)] - pub fn get_fee(&self) -> i64 { + pub fn get_fee(&self) -> Credits { self.fee } diff --git a/packages/wasm-dpp/src/errors/consensus_error.rs b/packages/wasm-dpp/src/errors/consensus_error.rs index 7453d0133f9..b067c1808e5 100644 --- a/packages/wasm-dpp/src/errors/consensus_error.rs +++ b/packages/wasm-dpp/src/errors/consensus_error.rs @@ -185,8 +185,7 @@ pub fn from_consensus_error_ref(e: &DPPConsensusError) -> JsValue { } DPPConsensusError::FeeError(e) => match e { dpp::consensus::fee::FeeError::BalanceIsNotEnoughError { balance, fee } => { - // TODO decide about type for Fee - BalanceIsNotEnoughErrorWasm::new(*balance, *fee as i64, code).into() + BalanceIsNotEnoughErrorWasm::new(*balance, *fee, code).into() } }, DPPConsensusError::SignatureError(e) => from_signature_error(e), diff --git a/packages/wasm-dpp/src/state_transition/fee/calculate_operation_fees.rs b/packages/wasm-dpp/src/state_transition/fee/calculate_operation_fees.rs new file mode 100644 index 00000000000..91625c269d8 --- /dev/null +++ b/packages/wasm-dpp/src/state_transition/fee/calculate_operation_fees.rs @@ -0,0 +1,24 @@ +use dpp::state_transition::fee::{ + calculate_operation_fees::calculate_operation_fees, operations::Operation, +}; +use wasm_bindgen::prelude::*; + +use crate::{ + fee::dummy_fee_result::DummyFeesResultWasm, + utils::{Inner, IntoWasm}, +}; + +use super::OperationWasm; + +#[wasm_bindgen(js_name=calculateOperationFees)] +pub fn calculate_operation_fees_wasm( + operations: js_sys::Array, +) -> Result { + let mut inner_operations: Vec = vec![]; + for operation in operations.iter() { + let operation = operation.to_wasm::("Operation")?.to_owned(); + inner_operations.push(operation.into_inner()) + } + + Ok(calculate_operation_fees(&inner_operations).into()) +} diff --git a/packages/wasm-dpp/src/state_transition/fee/calculate_state_transition_fee.rs b/packages/wasm-dpp/src/state_transition/fee/calculate_state_transition_fee.rs new file mode 100644 index 00000000000..f6bcddef07d --- /dev/null +++ b/packages/wasm-dpp/src/state_transition/fee/calculate_state_transition_fee.rs @@ -0,0 +1,15 @@ +use dpp::state_transition::fee::calculate_state_transition_fee_factory::calculate_state_transition_fee; +use wasm_bindgen::prelude::*; + +use crate::{ + conversion::create_state_transition_from_wasm_instance, fee::fee_result::FeeResultWasm, +}; + +#[wasm_bindgen(js_name=calculateStateTransitionFee)] +pub fn calculate_state_transition_fee_wasm( + state_transition_js: &JsValue, +) -> Result { + let state_transition = create_state_transition_from_wasm_instance(state_transition_js)?; + + Ok(calculate_state_transition_fee(&state_transition).into()) +} diff --git a/packages/wasm-dpp/src/state_transition/fee/dummy_fee_result.rs b/packages/wasm-dpp/src/state_transition/fee/dummy_fee_result.rs new file mode 100644 index 00000000000..40672c03335 --- /dev/null +++ b/packages/wasm-dpp/src/state_transition/fee/dummy_fee_result.rs @@ -0,0 +1,83 @@ +use dpp::state_transition::fee::{DummyFeesResult, Refunds}; +use js_sys::{Array, BigInt}; +use wasm_bindgen::prelude::*; + +use crate::{ + fee::refunds::RefundsWasm, + utils::{try_to_u64, Inner, IntoWasm, WithJsError}, +}; + +#[wasm_bindgen(js_name=DummyFeesResult)] +pub struct DummyFeesResultWasm(DummyFeesResult); + +#[wasm_bindgen(js_class=DummyFeesResult)] +impl DummyFeesResultWasm { + #[wasm_bindgen(getter, js_name = "storageFee")] + pub fn storage_fee(&self) -> BigInt { + BigInt::from(self.0.storage) + } + + #[wasm_bindgen(getter, js_name = "processingFee")] + pub fn processing_fee(&self) -> BigInt { + BigInt::from(self.0.processing) + } + + #[wasm_bindgen(getter, js_name = "feeRefunds")] + pub fn fee_refunds(&self) -> js_sys::Array { + let js_refunds = js_sys::Array::new(); + for refund in self.0.fee_refunds.iter().map(RefundsWasm::from) { + js_refunds.push(&refund.into()); + } + js_refunds + } + + #[wasm_bindgen(setter, js_name = "storageFee")] + pub fn set_storage_fee(&mut self, number: JsValue) -> Result<(), JsValue> { + let number = try_to_u64(number).with_js_error()?; + self.0.storage = number; + Ok(()) + } + + #[wasm_bindgen(setter, js_name = "processingFee")] + pub fn set_processing_fee(&mut self, number: JsValue) -> Result<(), JsValue> { + let number = try_to_u64(number).with_js_error()?; + self.0.processing = number; + Ok(()) + } + + #[wasm_bindgen(setter, js_name = "feeRefunds")] + pub fn set_fee_refunds(&mut self, js_fee_refunds: Array) -> Result<(), JsValue> { + let mut refunds = vec![]; + for refund in js_fee_refunds.iter() { + let transition: Refunds = refund + .to_wasm::("Refunds")? + .to_owned() + .into_inner(); + refunds.push(transition); + } + self.0.fee_refunds = refunds; + Ok(()) + } +} + +impl From for DummyFeesResultWasm { + fn from(value: DummyFeesResult) -> Self { + DummyFeesResultWasm(value) + } +} + +impl Inner for DummyFeesResultWasm { + type InnerItem = DummyFeesResult; + + fn into_inner(self) -> Self::InnerItem { + self.0 + } + + fn inner(&self) -> &Self::InnerItem { + &self.0 + } + + fn inner_mut(&mut self) -> &mut Self::InnerItem { + &mut self.0 + } +} diff --git a/packages/wasm-dpp/src/state_transition/fee/fee_result.rs b/packages/wasm-dpp/src/state_transition/fee/fee_result.rs new file mode 100644 index 00000000000..ed54a675da8 --- /dev/null +++ b/packages/wasm-dpp/src/state_transition/fee/fee_result.rs @@ -0,0 +1,125 @@ +use dpp::state_transition::fee::{FeeResult, Refunds}; +use js_sys::BigInt; +use wasm_bindgen::prelude::*; + +use crate::{ + fee::refunds::RefundsWasm, + utils::{try_to_u64, Inner, IntoWasm, WithJsError}, +}; + +#[wasm_bindgen(js_name=FeeResult)] +pub struct FeeResultWasm(FeeResult); + +#[wasm_bindgen(js_class=FeeResult)] +impl FeeResultWasm { + #[allow(clippy::new_without_default)] + #[wasm_bindgen(constructor)] + pub fn new() -> FeeResultWasm { + FeeResultWasm(FeeResult::default()) + } + + #[wasm_bindgen(getter, js_name = "storageFee")] + pub fn storage_fee(&self) -> BigInt { + BigInt::from(self.0.storage_fee) + } + + #[wasm_bindgen(getter, js_name = "processingFee")] + pub fn processing_fee(&self) -> BigInt { + BigInt::from(self.0.processing_fee) + } + + #[wasm_bindgen(getter, js_name = "feeRefunds")] + pub fn fee_refunds(&self) -> js_sys::Array { + let js_refunds = js_sys::Array::new(); + for refund in self.0.fee_refunds.iter().map(RefundsWasm::from) { + js_refunds.push(&refund.into()); + } + js_refunds + } + + #[wasm_bindgen(getter, js_name = "totalRefunds")] + pub fn total_refunds(&self) -> BigInt { + BigInt::from(self.0.total_refunds) + } + + #[wasm_bindgen(getter, js_name = "desiredAmount")] + pub fn desired_amount(&self) -> BigInt { + BigInt::from(self.0.desired_amount) + } + + #[wasm_bindgen(getter, js_name = "requiredAmount")] + pub fn required_amount(&self) -> BigInt { + BigInt::from(self.0.required_amount) + } + + #[wasm_bindgen(setter, js_name = "storageFee")] + pub fn set_storage_fee(&mut self, number: JsValue) -> Result<(), JsValue> { + let number = try_to_u64(number).with_js_error()?; + self.0.storage_fee = number; + Ok(()) + } + + #[wasm_bindgen(setter, js_name = "processingFee")] + pub fn set_processing_fee(&mut self, number: JsValue) -> Result<(), JsValue> { + let number = try_to_u64(number).with_js_error()?; + self.0.processing_fee = number; + Ok(()) + } + + #[wasm_bindgen(setter, js_name = "feeRefunds")] + pub fn set_fee_refunds(&mut self, js_fee_refunds: js_sys::Array) -> Result<(), JsValue> { + let mut refunds = vec![]; + for refund in js_fee_refunds.iter() { + let transition: Refunds = refund + .to_wasm::("Refunds")? + .to_owned() + .into_inner(); + refunds.push(transition); + } + self.0.fee_refunds = refunds; + Ok(()) + } + + #[wasm_bindgen(setter, js_name = "desiredAmount")] + pub fn set_desired_amount(&mut self, number: JsValue) -> Result<(), JsValue> { + let number = try_to_u64(number).with_js_error()?; + self.0.desired_amount = number; + Ok(()) + } + + #[wasm_bindgen(setter, js_name = "requiredAmount")] + pub fn set_required_amount(&mut self, number: JsValue) -> Result<(), JsValue> { + let number = try_to_u64(number).with_js_error()?; + self.0.required_amount = number; + Ok(()) + } + + #[wasm_bindgen(setter, js_name = "totalRefunds")] + pub fn set_total_refunds(&mut self, number: JsValue) -> Result<(), JsValue> { + let number = try_to_u64(number).with_js_error()?; + self.0.total_refunds = number; + Ok(()) + } +} + +impl From for FeeResultWasm { + fn from(value: FeeResult) -> Self { + FeeResultWasm(value) + } +} + +impl Inner for FeeResultWasm { + type InnerItem = FeeResult; + + fn into_inner(self) -> Self::InnerItem { + self.0 + } + + fn inner(&self) -> &Self::InnerItem { + &self.0 + } + + fn inner_mut(&mut self) -> &mut Self::InnerItem { + &mut self.0 + } +} diff --git a/packages/wasm-dpp/src/state_transition/fee/mod.rs b/packages/wasm-dpp/src/state_transition/fee/mod.rs new file mode 100644 index 00000000000..7f787f119d6 --- /dev/null +++ b/packages/wasm-dpp/src/state_transition/fee/mod.rs @@ -0,0 +1,36 @@ +use dpp::state_transition::fee::operations::Operation; +use wasm_bindgen::prelude::*; + +use crate::utils::Inner; +mod calculate_operation_fees; +mod calculate_state_transition_fee; +mod dummy_fee_result; +mod fee_result; +mod operations; +mod refunds; + +#[wasm_bindgen(js_name=Operation)] +#[derive(Clone)] +pub struct OperationWasm(Operation); + +impl From for OperationWasm { + fn from(value: Operation) -> Self { + OperationWasm(value) + } +} + +impl Inner for OperationWasm { + type InnerItem = Operation; + + fn into_inner(self) -> Self::InnerItem { + self.0 + } + + fn inner(&self) -> &Self::InnerItem { + &self.0 + } + + fn inner_mut(&mut self) -> &mut Self::InnerItem { + &mut self.0 + } +} diff --git a/packages/wasm-dpp/src/state_transition/fee/operations/mod.rs b/packages/wasm-dpp/src/state_transition/fee/operations/mod.rs new file mode 100644 index 00000000000..39f3c998420 --- /dev/null +++ b/packages/wasm-dpp/src/state_transition/fee/operations/mod.rs @@ -0,0 +1,7 @@ +mod pre_calculated_operation; +mod read_operation; +mod signature_verification_operation; + +pub use pre_calculated_operation::*; +pub use read_operation::*; +pub use signature_verification_operation::*; diff --git a/packages/wasm-dpp/src/state_transition/fee/operations/pre_calculated_operation.rs b/packages/wasm-dpp/src/state_transition/fee/operations/pre_calculated_operation.rs new file mode 100644 index 00000000000..59bce03f0af --- /dev/null +++ b/packages/wasm-dpp/src/state_transition/fee/operations/pre_calculated_operation.rs @@ -0,0 +1,92 @@ +use crate::{fee::dummy_fee_result::DummyFeesResultWasm, utils::Inner}; +use dpp::state_transition::fee::{ + operations::{OperationLike, PreCalculatedOperation}, + Refunds, +}; +use js_sys::{Array, BigInt}; +use wasm_bindgen::prelude::*; + +use crate::{ + fee::refunds::RefundsWasm, + utils::{try_to_u64, IntoWasm, WithJsError}, +}; + +#[wasm_bindgen(js_name = "PreCalculatedOperation")] +#[derive(Clone)] +pub struct PreCalculatedOperationWasm(PreCalculatedOperation); + +impl From for PreCalculatedOperationWasm { + fn from(value: PreCalculatedOperation) -> Self { + PreCalculatedOperationWasm(value) + } +} + +#[wasm_bindgen(js_class=PreCalculatedOperation)] +impl PreCalculatedOperationWasm { + #[wasm_bindgen(constructor)] + pub fn new( + storage_cost: JsValue, + processing_cost: JsValue, + js_fee_refunds: Array, + ) -> Result { + let storage_cost = try_to_u64(storage_cost).with_js_error()?; + let processing_cost = try_to_u64(processing_cost).with_js_error()?; + + let mut refunds = vec![]; + for refund in js_fee_refunds.iter() { + let transition: Refunds = refund + .to_wasm::("Refunds")? + .to_owned() + .into_inner(); + refunds.push(transition); + } + + Ok(PreCalculatedOperation::new(storage_cost, processing_cost, refunds).into()) + } + + #[wasm_bindgen(js_name=fromFee)] + pub fn from_fee(dummy_fee_result: &DummyFeesResultWasm) -> PreCalculatedOperationWasm { + let operation = PreCalculatedOperation::from_fee(dummy_fee_result.inner().clone()); + PreCalculatedOperationWasm(operation) + } + + #[wasm_bindgen(js_name = getProcessingCost)] + pub fn processing_cost(&self) -> BigInt { + BigInt::from(self.0.get_processing_cost()) + } + + #[wasm_bindgen(js_name=getStorageCost)] + pub fn storage_cost(&self) -> BigInt { + BigInt::from(self.0.get_storage_cost()) + } + + #[wasm_bindgen(getter)] + pub fn refunds(&self) -> Option { + let array_refunds = Array::new(); + if let Some(refunds) = self.0.get_refunds() { + for refund in refunds { + let refund_wasm: RefundsWasm = refund.into(); + array_refunds.push(&refund_wasm.into()); + } + Some(array_refunds) + } else { + None + } + } +} + +impl Inner for PreCalculatedOperationWasm { + type InnerItem = PreCalculatedOperation; + + fn into_inner(self) -> Self::InnerItem { + self.0 + } + + fn inner(&self) -> &Self::InnerItem { + &self.0 + } + + fn inner_mut(&mut self) -> &mut Self::InnerItem { + &mut self.0 + } +} diff --git a/packages/wasm-dpp/src/state_transition/fee/operations/read_operation.rs b/packages/wasm-dpp/src/state_transition/fee/operations/read_operation.rs new file mode 100644 index 00000000000..6971d484b0a --- /dev/null +++ b/packages/wasm-dpp/src/state_transition/fee/operations/read_operation.rs @@ -0,0 +1,67 @@ +use dpp::state_transition::fee::operations::{OperationLike, ReadOperation}; +use js_sys::{Array, BigInt}; +use wasm_bindgen::prelude::*; + +use crate::{ + fee::refunds::RefundsWasm, + utils::{try_to_u64, Inner, WithJsError}, +}; + +#[wasm_bindgen(js_name = "ReadOperation")] +#[derive(Clone)] +pub struct ReadOperationWasm(ReadOperation); + +impl From for ReadOperationWasm { + fn from(value: ReadOperation) -> Self { + ReadOperationWasm(value) + } +} + +#[wasm_bindgen(js_class=ReadOperation)] +impl ReadOperationWasm { + #[wasm_bindgen(constructor)] + pub fn new(value_size: JsValue) -> Result { + let value_size = try_to_u64(value_size).with_js_error()?; + Ok(ReadOperation::new(value_size).into()) + } + + #[wasm_bindgen(getter,js_name = processingCost)] + pub fn processing_cost(&self) -> BigInt { + BigInt::from(self.0.get_processing_cost()) + } + + #[wasm_bindgen(getter, js_name=storageCost)] + pub fn storage_cost(&self) -> BigInt { + BigInt::from(self.0.get_storage_cost()) + } + + #[wasm_bindgen(getter)] + pub fn refunds(&self) -> Option { + let array_refunds = Array::new(); + if let Some(refunds) = self.0.get_refunds() { + for refund in refunds { + let refund_wasm: RefundsWasm = refund.into(); + array_refunds.push(&refund_wasm.into()); + } + Some(array_refunds) + } else { + None + } + } +} + +impl Inner for ReadOperationWasm { + type InnerItem = ReadOperation; + + fn into_inner(self) -> Self::InnerItem { + self.0 + } + + fn inner(&self) -> &Self::InnerItem { + &self.0 + } + + fn inner_mut(&mut self) -> &mut Self::InnerItem { + &mut self.0 + } +} diff --git a/packages/wasm-dpp/src/state_transition/fee/operations/signature_verification_operation.rs b/packages/wasm-dpp/src/state_transition/fee/operations/signature_verification_operation.rs new file mode 100644 index 00000000000..b09d6005000 --- /dev/null +++ b/packages/wasm-dpp/src/state_transition/fee/operations/signature_verification_operation.rs @@ -0,0 +1,76 @@ +use std::convert::TryFrom; + +use anyhow::anyhow; +use dpp::{ + identity::KeyType, + state_transition::fee::operations::{OperationLike, SignatureVerificationOperation}, +}; +use js_sys::{Array, BigInt}; +use wasm_bindgen::prelude::*; + +use crate::{ + fee::refunds::RefundsWasm, + utils::{Inner, WithJsError}, +}; + +#[wasm_bindgen(js_name = "SignatureVerificationOperation")] +#[derive(Clone)] +pub struct SignatureVerificationOperationWasm(SignatureVerificationOperation); + +impl From for SignatureVerificationOperationWasm { + fn from(value: SignatureVerificationOperation) -> Self { + SignatureVerificationOperationWasm(value) + } +} + +#[wasm_bindgen(js_class=SignatureVerificationOperation)] +impl SignatureVerificationOperationWasm { + #[wasm_bindgen(constructor)] + pub fn new(signature_type: u8) -> Result { + let key_type = KeyType::try_from(signature_type) + .map_err(|e| anyhow!("invalid key type: {}", e)) + .with_js_error()?; + + Ok(SignatureVerificationOperation::new(key_type).into()) + } + + #[wasm_bindgen(js_name = getProcessingCost)] + pub fn get_processing_cost(&self) -> BigInt { + BigInt::from(self.0.get_processing_cost()) + } + + #[wasm_bindgen(js_name=getStorageCost)] + pub fn get_storage_cost(&self) -> BigInt { + BigInt::from(self.0.get_storage_cost()) + } + + #[wasm_bindgen(getter)] + pub fn refunds(&self) -> Option { + let array_refunds = Array::new(); + if let Some(refunds) = self.0.get_refunds() { + for refund in refunds { + let refund_wasm: RefundsWasm = refund.into(); + array_refunds.push(&refund_wasm.into()); + } + Some(array_refunds) + } else { + None + } + } +} + +impl Inner for SignatureVerificationOperationWasm { + type InnerItem = SignatureVerificationOperation; + + fn into_inner(self) -> Self::InnerItem { + self.0 + } + + fn inner(&self) -> &Self::InnerItem { + &self.0 + } + + fn inner_mut(&mut self) -> &mut Self::InnerItem { + &mut self.0 + } +} diff --git a/packages/wasm-dpp/src/state_transition/fee/refunds.rs b/packages/wasm-dpp/src/state_transition/fee/refunds.rs new file mode 100644 index 00000000000..a54bcb46dbd --- /dev/null +++ b/packages/wasm-dpp/src/state_transition/fee/refunds.rs @@ -0,0 +1,59 @@ +use std::collections::HashMap; + +use dpp::state_transition::fee::Refunds; +use js_sys::BigInt; +use wasm_bindgen::prelude::*; + +use crate::{identifier::IdentifierWrapper, utils::Inner}; + +#[derive(Clone)] +#[wasm_bindgen(js_name=Refunds)] +pub struct RefundsWasm(Refunds); + +#[wasm_bindgen(js_class=Refunds)] +impl RefundsWasm { + #[wasm_bindgen(getter)] + pub fn identifier(&self) -> IdentifierWrapper { + self.0.identifier.into() + } + + #[wasm_bindgen(getter)] + pub fn credits_per_epoch(&self) -> js_sys::Map { + convert_hashmap_to_jsmap(&self.0.credits_per_epoch) + } +} + +impl From for RefundsWasm { + fn from(value: Refunds) -> Self { + RefundsWasm(value) + } +} +impl From<&Refunds> for RefundsWasm { + fn from(value: &Refunds) -> Self { + RefundsWasm(value.clone()) + } +} + +impl Inner for RefundsWasm { + type InnerItem = Refunds; + + fn into_inner(self) -> Self::InnerItem { + self.0 + } + + fn inner(&self) -> &Self::InnerItem { + &self.0 + } + + fn inner_mut(&mut self) -> &mut Self::InnerItem { + &mut self.0 + } +} + +pub fn convert_hashmap_to_jsmap(map: &HashMap) -> js_sys::Map { + let mut js_map = js_sys::Map::new(); + for (key, value) in map { + js_map.set(&JsValue::from_str(&key), &BigInt::from(*value)); + } + js_map +} diff --git a/packages/wasm-dpp/src/state_transition/mod.rs b/packages/wasm-dpp/src/state_transition/mod.rs index a755f3db21a..2916d16696f 100644 --- a/packages/wasm-dpp/src/state_transition/mod.rs +++ b/packages/wasm-dpp/src/state_transition/mod.rs @@ -6,6 +6,7 @@ pub mod errors; pub mod state_transition_facade; pub mod state_transition_factory; +pub mod fee; pub mod validation; use crate::utils::Inner; pub use validation::*;