From 37b5ea497ce5e775cbebb037c04005febf2532f2 Mon Sep 17 00:00:00 2001 From: fominok Date: Fri, 4 Oct 2024 13:16:49 +0200 Subject: [PATCH 1/2] chore: bump GroveDB dependency (#2196) Co-authored-by: Quantum Explorer --- Cargo.lock | 37 +++--- packages/rs-drive/Cargo.toml | 12 +- .../mod.rs | 107 +++++++++--------- .../v0/mod.rs | 60 +++++----- packages/rs-platform-version/Cargo.toml | 2 +- 5 files changed, 109 insertions(+), 109 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a05f5b530..819f2b9922 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2064,9 +2064,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "grovedb" -version = "2.0.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77097f0a4cc70c4a69fa400f633c5f18739e446eaed05269a3d76e17fa4d33d2" +checksum = "7d91e8f87926c834c7338d0c69a48816c043e0cddf0062a8a567483db2fb1e24" dependencies = [ "axum 0.7.5", "bincode", @@ -2092,15 +2092,16 @@ dependencies = [ "tempfile", "thiserror", "tokio", + "tokio-util", "tower-http", "zip-extensions", ] [[package]] name = "grovedb-costs" -version = "2.0.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0487d63a68621b910567a911b3708a8246501ae1912fa2f1920474dcb28a207" +checksum = "360f7c8d3b20beafcbf3cde8754bbcfd201ae2a30ec7594a4b9678fd2fa3c7a8" dependencies = [ "integer-encoding", "intmap", @@ -2109,9 +2110,9 @@ dependencies = [ [[package]] name = "grovedb-epoch-based-storage-flags" -version = "2.0.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53eb4b99b056e34bcceef2d604c883aee40daa688ceb7ec558456e10bef27c64" +checksum = "acec1b6962d99d7b079c0fd1532cd3a2c83a3d659ffd9fcf02edda4599334bb4" dependencies = [ "grovedb-costs", "hex", @@ -2122,9 +2123,9 @@ dependencies = [ [[package]] name = "grovedb-merk" -version = "2.0.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daedc296cac3093d244cbda0a11a5ef378bd4f747fcbe45b6cbed040c78cfb36" +checksum = "72057865f239fdd24f92eaa8668acc0d618da168f330546577a62eda1701210e" dependencies = [ "bincode", "blake3", @@ -2148,15 +2149,15 @@ dependencies = [ [[package]] name = "grovedb-path" -version = "2.0.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3552accddbfe6e586853f50a102d665efc0449a63504e5e2113389be924f98c" +checksum = "5d96cc6106e5ca88e548d66f130b877b664da78be226dfdba555fc210f8508f4" [[package]] name = "grovedb-storage" -version = "2.0.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868d74460c6205563e7bc72549f3fa057ed8bd0f83d96e04b2286ca0a216149" +checksum = "e1c9b59bc9fa7123b8485f87f88a886dd109e7aff5f34a29a3812cb64eb897ff" dependencies = [ "blake3", "grovedb-costs", @@ -2174,9 +2175,9 @@ dependencies = [ [[package]] name = "grovedb-version" -version = "2.0.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d62bd20c621681dfd8aa6ca128702de775c67560c1fe412f380c5278d5c48ba" +checksum = "f4be0c1a1ef97068fe93212e7b6f349e0b44a9fc90063c8c28e110cfb8c2fcb2" dependencies = [ "thiserror", "versioned-feature-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2184,9 +2185,9 @@ dependencies = [ [[package]] name = "grovedb-visualize" -version = "2.0.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6cd92c3a11055b1d841d071f801517b98575f9704f5a757a016fe83d35a37b8" +checksum = "5865f4335eb99644512a7d80d6b1698ba1099a8268fdfd3ffb1a3a32dcb4af28" dependencies = [ "hex", "itertools 0.12.1", @@ -2194,9 +2195,9 @@ dependencies = [ [[package]] name = "grovedbg-types" -version = "2.0.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003e5066965932dbb617e5966df5f73a066eb721579840b30ddd46bf04311fc8" +checksum = "921b9a29facf9d3f0de667cd1da083a34695ede9e7bfacd74bb5bd29f8f7c178" dependencies = [ "serde", "serde_with 3.9.0", diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index 50915b06e2..94938455c5 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -51,12 +51,12 @@ enum-map = { version = "2.0.3", optional = true } intmap = { version = "2.0.0", features = ["serde"], optional = true } chrono = { version = "0.4.35", optional = true } itertools = { version = "0.11.0", optional = true } -grovedb = { version = "2.0.3", optional = true, default-features = false } -grovedb-costs = { version = "2.0.3", optional = true } -grovedb-path = { version = "2.0.3" } -grovedb-storage = { version = "2.0.3", optional = true } -grovedb-version = { version = "2.0.3"} -grovedb-epoch-based-storage-flags = { version = "2.0.3"} +grovedb = { version = "2.1.0", optional = true, default-features = false } +grovedb-costs = { version = "2.1.0", optional = true } +grovedb-path = { version = "2.1.0" } +grovedb-storage = { version = "2.1.0", optional = true } +grovedb-version = { version = "2.1.0"} +grovedb-epoch-based-storage-flags = { version = "2.1.0"} [dev-dependencies] criterion = "0.3.5" diff --git a/packages/rs-drive/src/util/grove_operations/grove_insert_if_not_exists_return_existing_element/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_insert_if_not_exists_return_existing_element/mod.rs index 8c5455a038..6727b72014 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_insert_if_not_exists_return_existing_element/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_insert_if_not_exists_return_existing_element/mod.rs @@ -1,54 +1,53 @@ -//todo: uncomment once version 2.1 of GroveDB is released. -// mod v0; -// -// use crate::drive::Drive; -// use crate::error::drive::DriveError; -// use crate::error::Error; -// use crate::fees::op::LowLevelDriveOperation; -// use dpp::version::drive_versions::DriveVersion; -// use grovedb::{Element, TransactionArg}; -// use grovedb_path::SubtreePath; -// -// impl Drive { -// /// Inserts an element into groveDB only if the specified path and key do not exist. -// /// This operation costs are then stored in `drive_operations`. -// /// -// /// # Parameters -// /// * `path`: The groveDB hierarchical authenticated structure path where the new element is to be inserted. -// /// * `key`: The key where the new element should be inserted in the subtree. -// /// * `element`: The element to be inserted. -// /// * `transaction`: The groveDB transaction associated with this operation. -// /// * `drive_operations`: A vector to collect the costs of operations for later computation. In this case, -// /// it collects the cost of this insert operation if the path and key did not exist. -// /// * `platform_version`: The platform version to select the correct function version to run. -// /// -// /// # Returns -// /// * `Ok(true)` if the insertion was successful. -// /// * `Ok(false)` if the path and key already existed. -// /// * `Err(DriveError::UnknownVersionMismatch)` if the platform version does not match known versions. -// pub fn grove_insert_if_not_exists_return_existing_element>( -// &self, -// path: SubtreePath<'_, B>, -// key: &[u8], -// element: Element, -// transaction: TransactionArg, -// drive_operations: Option<&mut Vec>, -// drive_version: &DriveVersion, -// ) -> Result, Error> { -// match drive_version.grove_methods.basic.grove_insert_if_not_exists { -// 0 => self.grove_insert_if_not_exists_return_existing_element_v0( -// path, -// key, -// element, -// transaction, -// drive_operations, -// drive_version, -// ), -// version => Err(Error::Drive(DriveError::UnknownVersionMismatch { -// method: "grove_insert_if_not_exists_return_existing_element".to_string(), -// known_versions: vec![0], -// received: version, -// })), -// } -// } -// } +mod v0; + +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use crate::fees::op::LowLevelDriveOperation; +use dpp::version::drive_versions::DriveVersion; +use grovedb::{Element, TransactionArg}; +use grovedb_path::SubtreePath; + +impl Drive { + /// Inserts an element into groveDB only if the specified path and key do not exist. + /// This operation costs are then stored in `drive_operations`. + /// + /// # Parameters + /// * `path`: The groveDB hierarchical authenticated structure path where the new element is to be inserted. + /// * `key`: The key where the new element should be inserted in the subtree. + /// * `element`: The element to be inserted. + /// * `transaction`: The groveDB transaction associated with this operation. + /// * `drive_operations`: A vector to collect the costs of operations for later computation. In this case, + /// it collects the cost of this insert operation if the path and key did not exist. + /// * `platform_version`: The platform version to select the correct function version to run. + /// + /// # Returns + /// * `Ok(true)` if the insertion was successful. + /// * `Ok(false)` if the path and key already existed. + /// * `Err(DriveError::UnknownVersionMismatch)` if the platform version does not match known versions. + pub fn grove_insert_if_not_exists_return_existing_element>( + &self, + path: SubtreePath<'_, B>, + key: &[u8], + element: Element, + transaction: TransactionArg, + drive_operations: Option<&mut Vec>, + drive_version: &DriveVersion, + ) -> Result, Error> { + match drive_version.grove_methods.basic.grove_insert_if_not_exists { + 0 => self.grove_insert_if_not_exists_return_existing_element_v0( + path, + key, + element, + transaction, + drive_operations, + drive_version, + ), + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "grove_insert_if_not_exists_return_existing_element".to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/util/grove_operations/grove_insert_if_not_exists_return_existing_element/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_insert_if_not_exists_return_existing_element/v0/mod.rs index 5030cd6cc5..69b55ba2d7 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_insert_if_not_exists_return_existing_element/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_insert_if_not_exists_return_existing_element/v0/mod.rs @@ -1,30 +1,30 @@ -// use crate::drive::Drive; -// use crate::error::Error; -// use crate::fees::op::LowLevelDriveOperation; -// use crate::util::grove_operations::push_drive_operation_result_optional; -// use grovedb::{Element, TransactionArg}; -// use grovedb_path::SubtreePath; -// use platform_version::version::drive_versions::DriveVersion; -// -// impl Drive { -// /// Pushes the `OperationCost` of inserting an element in groveDB where the path key does not yet exist -// /// to `drive_operations`. -// pub(crate) fn grove_insert_if_not_exists_return_existing_element_v0>( -// &self, -// path: SubtreePath<'_, B>, -// key: &[u8], -// element: Element, -// transaction: TransactionArg, -// drive_operations: Option<&mut Vec>, -// drive_version: &DriveVersion, -// ) -> Result { -// let cost_context = self.grove.insert_if_not_exists_return_existing_element( -// path, -// key, -// element, -// transaction, -// &drive_version.grove_version, -// ); -// push_drive_operation_result_optional(cost_context, drive_operations) -// } -// } +use crate::drive::Drive; +use crate::error::Error; +use crate::fees::op::LowLevelDriveOperation; +use crate::util::grove_operations::push_drive_operation_result_optional; +use grovedb::{Element, TransactionArg}; +use grovedb_path::SubtreePath; +use platform_version::version::drive_versions::DriveVersion; + +impl Drive { + /// Pushes the `OperationCost` of inserting an element in groveDB where the path key does not yet exist + /// to `drive_operations`. + pub(crate) fn grove_insert_if_not_exists_return_existing_element_v0>( + &self, + path: SubtreePath<'_, B>, + key: &[u8], + element: Element, + transaction: TransactionArg, + drive_operations: Option<&mut Vec>, + drive_version: &DriveVersion, + ) -> Result, Error> { + let cost_context = self.grove.insert_if_not_exists_return_existing_element( + path, + key, + element, + transaction, + &drive_version.grove_version, + ); + push_drive_operation_result_optional(cost_context, drive_operations) + } +} diff --git a/packages/rs-platform-version/Cargo.toml b/packages/rs-platform-version/Cargo.toml index 01b8e5380a..546704554d 100644 --- a/packages/rs-platform-version/Cargo.toml +++ b/packages/rs-platform-version/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" thiserror = { version = "1.0.63" } bincode = { version = "2.0.0-rc.3"} versioned-feature-core = { git = "https://github.com/dashpay/versioned-feature-core", version = "1.0.0" } -grovedb-version = { version = "2.0.3"} +grovedb-version = { version = "2.1.0"} once_cell = "1.19.0" [features] From 8773afae09052cc7c2cc316081874f342cc12947 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 4 Oct 2024 14:21:03 +0300 Subject: [PATCH 2/2] feat(sdk): enable withdrawals v1 in JS SDK (#2201) --- .yarn/cache/fsevents-patch-19706e7e35-10.zip | Bin 0 -> 23750 bytes .../methods/identities/creditWithdrawal.ts | 44 +++++++----- .../rs-dpp/src/identity/identity_facade.rs | 2 +- .../rs-dpp/src/identity/identity_factory.rs | 65 ++++++++++++++---- .../mod.rs | 6 +- .../src/version/dpp_versions.rs | 6 ++ .../src/version/mocks/v2_test.rs | 8 ++- .../src/version/mocks/v3_test.rs | 8 ++- .../rs-platform-version/src/version/v1.rs | 8 ++- .../rs-platform-version/src/version/v2.rs | 8 ++- .../rs-platform-version/src/version/v3.rs | 8 ++- .../rs-platform-version/src/version/v4.rs | 8 ++- ...entityCreditWithdrawalTransitionFixture.js | 2 +- .../wasm-dpp/src/identity/identity_facade.rs | 4 +- .../wasm-dpp/src/identity/identity_factory.rs | 4 +- .../identity/IdentityFacade.spec.js | 2 +- .../unit/identity/IdentityFactory.spec.js | 2 +- ...IdentityCreditWithdrawalTransition.spec.js | 6 +- 18 files changed, 138 insertions(+), 53 deletions(-) create mode 100644 .yarn/cache/fsevents-patch-19706e7e35-10.zip diff --git a/.yarn/cache/fsevents-patch-19706e7e35-10.zip b/.yarn/cache/fsevents-patch-19706e7e35-10.zip new file mode 100644 index 0000000000000000000000000000000000000000..aff1ab12ce57f312cc3bc58c78597020f7980e62 GIT binary patch literal 23750 zcmbrm1yozz);0>XxECvK#oZ~E;tmB$aVzfb5?qQyDNrQEOR-|b2~w;ScMa~YAwY8J zd(Qdpz5l)6`2R7!jEucx&-tupt~vKuD|^qKx2n&c6C?foys4hW_^0yk1MXAl;%a4W z=Iml$(9fiGGLEft5srW3bACa z^20Bo`Gos1=spNzXk~xoaF?yeJLK7|FW{te1+oI^hT|?OQwEDk^DU8C^Xs!=H+qKT z+EDYGD;VxE+nW`Sea)y3Q=u%9ps%`6qz?BX^$Jz?k8&F`UHsOMgJ;U-hW?UyAEb*m z5!T@9rY*G=x};cM^>d8Q;*I-r@y$ryZt9JSE36#F6#8aq)n5@4xR+WBtd<+%c10-0 z1IpdHzS+&K21*J{xD%w>#~sgW#57!z)^uY{@i7^nIim|CEB6L2>=kwL7N1*NhSBX& zjZ05vcTXh3QdS*my}#Tl#IQwZvFtrk@sVqLyq5hO6y!@2&L2$|uCNk6r|GS#nHHjg zotQ}y^~pbP`MiRNdeGvAlx>DzK+Jfd2daq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vv@HHE?~ik)u>my=d2M>&S_qtHnQxOH{SO4f&b0sl literal 0 HcmV?d00001 diff --git a/packages/js-dash-sdk/src/SDK/Client/Platform/methods/identities/creditWithdrawal.ts b/packages/js-dash-sdk/src/SDK/Client/Platform/methods/identities/creditWithdrawal.ts index a2bd513397..4be23a4a67 100644 --- a/packages/js-dash-sdk/src/SDK/Client/Platform/methods/identities/creditWithdrawal.ts +++ b/packages/js-dash-sdk/src/SDK/Client/Platform/methods/identities/creditWithdrawal.ts @@ -28,37 +28,50 @@ const MIN_ASSET_UNLOCK_CORE_FEE_PER_BYTE = 1; const MINIMAL_WITHDRAWAL_AMOUNT = ASSET_UNLOCK_TX_SIZE * MIN_ASSET_UNLOCK_CORE_FEE_PER_BYTE * 1000; type WithdrawalOptions = { - signingKeyIndex: number + signingKeyIndex?: number + toAddress?: string }; /** Creates platform credits withdrawal request * @param identity - identity to withdraw from * @param amount - amount of credits to withdraw - * @param to - Dash L1 address * @param options - withdrawal options + * @param [options] - withdrawal options + * @param [options.toAddress] - withdrawal destination address */ export async function creditWithdrawal( this: Platform, identity: Identity, amount: number, - to: string, - options: WithdrawalOptions = { - signingKeyIndex: 3, - }, + options: WithdrawalOptions = { }, ): Promise { await this.initialize(); + // eslint-disable-next-line no-param-reassign + options = { + ...options, + signingKeyIndex: 3, + }; + const { dpp } = this; - let toAddress: Address; - try { - toAddress = new Address(to, this.client.network); - } catch (e) { - throw new Error(`Invalid core recipient "${to}" for network ${this.client.network}`); + let outputScriptBytes: Buffer | undefined; + if (options.toAddress) { + let toAddress: Address; + try { + toAddress = new Address(options.toAddress, this.client.network); + } catch (e) { + throw new Error(`Invalid core recipient "${options.toAddress}" for network ${this.client.network}`); + } + + const outputScript = Script.buildPublicKeyHashOut(toAddress); + // @ts-ignore + outputScriptBytes = outputScript.toBuffer(); + + this.logger.debug(`[Identity#creditWithdrawal] credits withdrawal from ${identity.getId().toString()} to ${toAddress.toString()} with amount ${amount}`); + } else { + this.logger.debug(`[Identity#creditWithdrawal] credits withdrawal from ${identity.getId().toString()} to recent withdrawal address with amount ${amount}`); } - this.logger.debug(`[Identity#creditWithdrawal] credits withdrawal from ${identity.getId().toString()} to ${toAddress.toString()} with amount ${amount}`); - - const outputScript = Script.buildPublicKeyHashOut(toAddress); const balance = identity.getBalance(); if (amount > balance) { @@ -88,8 +101,7 @@ export async function creditWithdrawal( BigInt(amount), coreFeePerByte, DEFAULT_POOLING, - // @ts-ignore - outputScript.toBuffer(), + outputScriptBytes, BigInt(identityNonce), ); diff --git a/packages/rs-dpp/src/identity/identity_facade.rs b/packages/rs-dpp/src/identity/identity_facade.rs index 919c68c624..eecdf45e6e 100644 --- a/packages/rs-dpp/src/identity/identity_facade.rs +++ b/packages/rs-dpp/src/identity/identity_facade.rs @@ -123,7 +123,7 @@ impl IdentityFacade { amount: u64, core_fee_per_byte: u32, pooling: Pooling, - output_script: CoreScript, + output_script: Option, identity_nonce: u64, ) -> Result { self.factory.create_identity_credit_withdrawal_transition( diff --git a/packages/rs-dpp/src/identity/identity_factory.rs b/packages/rs-dpp/src/identity/identity_factory.rs index c6aface591..48f7369818 100644 --- a/packages/rs-dpp/src/identity/identity_factory.rs +++ b/packages/rs-dpp/src/identity/identity_factory.rs @@ -43,6 +43,8 @@ use crate::state_transition::identity_credit_transfer_transition::IdentityCredit #[cfg(all(feature = "state-transitions", feature = "client"))] use crate::state_transition::identity_credit_withdrawal_transition::v0::IdentityCreditWithdrawalTransitionV0; #[cfg(all(feature = "state-transitions", feature = "client"))] +use crate::state_transition::identity_credit_withdrawal_transition::v1::IdentityCreditWithdrawalTransitionV1; +#[cfg(all(feature = "state-transitions", feature = "client"))] use crate::state_transition::identity_credit_withdrawal_transition::IdentityCreditWithdrawalTransition; #[cfg(all(feature = "state-transitions", feature = "client"))] use crate::state_transition::identity_topup_transition::accessors::IdentityTopUpTransitionAccessorsV0; @@ -233,22 +235,61 @@ impl IdentityFactory { amount: u64, core_fee_per_byte: u32, pooling: Pooling, - output_script: CoreScript, + output_script: Option, identity_nonce: IdentityNonce, ) -> Result { - let identity_credit_withdrawal_transition = IdentityCreditWithdrawalTransitionV0 { - identity_id, - amount, - core_fee_per_byte, - pooling, - output_script, - nonce: identity_nonce, - ..Default::default() + let platform_version = PlatformVersion::get(self.protocol_version)?; + + let identity_credit_withdrawal_transition = match platform_version + .dpp + .state_transitions + .identities + .credit_withdrawal + .default_constructor + { + 0 => { + let output_script = output_script.ok_or_else(|| { + ProtocolError::Generic( + "Output script is required for IdentityCreditWithdrawalTransitionV0" + .to_string(), + ) + })?; + + let transition = IdentityCreditWithdrawalTransitionV0 { + identity_id, + amount, + core_fee_per_byte, + pooling, + output_script, + nonce: identity_nonce, + ..Default::default() + }; + + IdentityCreditWithdrawalTransition::from(transition) + } + 1 => { + let transition = IdentityCreditWithdrawalTransitionV1 { + identity_id, + amount, + core_fee_per_byte, + pooling, + output_script, + nonce: identity_nonce, + ..Default::default() + }; + + IdentityCreditWithdrawalTransition::from(transition) + } + version => { + return Err(ProtocolError::UnknownVersionMismatch { + method: "create_identity_credit_withdrawal_transition".to_string(), + known_versions: vec![0, 1], + received: version, + }); + } }; - Ok(IdentityCreditWithdrawalTransition::from( - identity_credit_withdrawal_transition, - )) + Ok(identity_credit_withdrawal_transition) } #[cfg(all(feature = "state-transitions", feature = "client"))] diff --git a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/mod.rs index 5b93592a36..0badee88b9 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/mod.rs @@ -73,8 +73,10 @@ impl IdentityCreditWithdrawalTransition { pub fn default_versioned(platform_version: &PlatformVersion) -> Result { match platform_version .dpp - .identity_versions - .identity_structure_version + .state_transitions + .identities + .credit_withdrawal + .default_constructor { 0 => Ok(IdentityCreditWithdrawalTransition::V0( IdentityCreditWithdrawalTransitionV0::default(), diff --git a/packages/rs-platform-version/src/version/dpp_versions.rs b/packages/rs-platform-version/src/version/dpp_versions.rs index 7c84e660a4..713f9dc54a 100644 --- a/packages/rs-platform-version/src/version/dpp_versions.rs +++ b/packages/rs-platform-version/src/version/dpp_versions.rs @@ -27,6 +27,12 @@ pub struct StateTransitionVersions { pub struct IdentityTransitionVersions { pub max_public_keys_in_creation: u16, pub asset_locks: IdentityTransitionAssetLockVersions, + pub credit_withdrawal: IdentityCreditWithdrawalTransitionVersions, +} + +#[derive(Clone, Debug, Default)] +pub struct IdentityCreditWithdrawalTransitionVersions { + pub default_constructor: FeatureVersion, } #[derive(Clone, Debug, Default)] diff --git a/packages/rs-platform-version/src/version/mocks/v2_test.rs b/packages/rs-platform-version/src/version/mocks/v2_test.rs index 1869831859..28db2e2a7b 100644 --- a/packages/rs-platform-version/src/version/mocks/v2_test.rs +++ b/packages/rs-platform-version/src/version/mocks/v2_test.rs @@ -7,8 +7,9 @@ use crate::version::dpp_versions::{ DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityKeyTypeMethodVersions, IdentityTransitionAssetLockVersions, IdentityTransitionVersions, - IdentityVersions, JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, + IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, + IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, + JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, VotingValidationVersions, VotingVersions, @@ -1183,6 +1184,9 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { validate_asset_lock_transaction_structure: 0, validate_instant_asset_lock_proof_structure: 0, }, + credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { + default_constructor: 0, + }, }, }, contract_versions: ContractVersions { diff --git a/packages/rs-platform-version/src/version/mocks/v3_test.rs b/packages/rs-platform-version/src/version/mocks/v3_test.rs index 9fef855e85..aab569b63e 100644 --- a/packages/rs-platform-version/src/version/mocks/v3_test.rs +++ b/packages/rs-platform-version/src/version/mocks/v3_test.rs @@ -7,8 +7,9 @@ use crate::version::dpp_versions::{ DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityKeyTypeMethodVersions, IdentityTransitionAssetLockVersions, IdentityTransitionVersions, - IdentityVersions, JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, + IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, + IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, + JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, VotingValidationVersions, VotingVersions, @@ -1183,6 +1184,9 @@ pub const TEST_PLATFORM_V3: PlatformVersion = PlatformVersion { validate_asset_lock_transaction_structure: 0, validate_instant_asset_lock_proof_structure: 0, }, + credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { + default_constructor: 0, + }, }, }, contract_versions: ContractVersions { diff --git a/packages/rs-platform-version/src/version/v1.rs b/packages/rs-platform-version/src/version/v1.rs index 38200b9a61..8104775a5e 100644 --- a/packages/rs-platform-version/src/version/v1.rs +++ b/packages/rs-platform-version/src/version/v1.rs @@ -7,8 +7,9 @@ use crate::version::dpp_versions::{ DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityKeyTypeMethodVersions, IdentityTransitionAssetLockVersions, IdentityTransitionVersions, - IdentityVersions, JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, + IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, + IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, + JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, VotingValidationVersions, VotingVersions, @@ -1182,6 +1183,9 @@ pub const PLATFORM_V1: PlatformVersion = PlatformVersion { validate_asset_lock_transaction_structure: 0, validate_instant_asset_lock_proof_structure: 0, }, + credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { + default_constructor: 0, + }, }, }, contract_versions: ContractVersions { diff --git a/packages/rs-platform-version/src/version/v2.rs b/packages/rs-platform-version/src/version/v2.rs index 591e17d0c4..3f9931df8a 100644 --- a/packages/rs-platform-version/src/version/v2.rs +++ b/packages/rs-platform-version/src/version/v2.rs @@ -7,8 +7,9 @@ use crate::version::dpp_versions::{ DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityKeyTypeMethodVersions, IdentityTransitionAssetLockVersions, IdentityTransitionVersions, - IdentityVersions, JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, + IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, + IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, + JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, VotingValidationVersions, VotingVersions, @@ -1182,6 +1183,9 @@ pub const PLATFORM_V2: PlatformVersion = PlatformVersion { validate_asset_lock_transaction_structure: 0, validate_instant_asset_lock_proof_structure: 0, }, + credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { + default_constructor: 0, + }, }, }, contract_versions: ContractVersions { diff --git a/packages/rs-platform-version/src/version/v3.rs b/packages/rs-platform-version/src/version/v3.rs index 543c759df7..8a57cb65a6 100644 --- a/packages/rs-platform-version/src/version/v3.rs +++ b/packages/rs-platform-version/src/version/v3.rs @@ -7,8 +7,9 @@ use crate::version::dpp_versions::{ DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityKeyTypeMethodVersions, IdentityTransitionAssetLockVersions, IdentityTransitionVersions, - IdentityVersions, JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, + IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, + IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, + JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, VotingValidationVersions, VotingVersions, @@ -1189,6 +1190,9 @@ pub const PLATFORM_V3: PlatformVersion = PlatformVersion { validate_asset_lock_transaction_structure: 0, validate_instant_asset_lock_proof_structure: 0, }, + credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { + default_constructor: 1, + }, }, }, contract_versions: ContractVersions { diff --git a/packages/rs-platform-version/src/version/v4.rs b/packages/rs-platform-version/src/version/v4.rs index 7c2752f29a..0082ec2743 100644 --- a/packages/rs-platform-version/src/version/v4.rs +++ b/packages/rs-platform-version/src/version/v4.rs @@ -7,8 +7,9 @@ use crate::version::dpp_versions::{ DocumentTypeClassMethodVersions, DocumentTypeIndexVersions, DocumentTypeMethodVersions, DocumentTypeSchemaVersions, DocumentTypeValidationVersions, DocumentTypeVersions, DocumentVersions, DocumentsBatchTransitionValidationVersions, DocumentsBatchTransitionVersions, - IdentityKeyTypeMethodVersions, IdentityTransitionAssetLockVersions, IdentityTransitionVersions, - IdentityVersions, JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, + IdentityCreditWithdrawalTransitionVersions, IdentityKeyTypeMethodVersions, + IdentityTransitionAssetLockVersions, IdentityTransitionVersions, IdentityVersions, + JsonSchemaValidatorVersions, PublicKeyInCreationMethodVersions, RecursiveSchemaValidatorVersions, StateTransitionConversionVersions, StateTransitionMethodVersions, StateTransitionSerializationVersions, StateTransitionVersions, VotingValidationVersions, VotingVersions, @@ -1184,6 +1185,9 @@ pub const PLATFORM_V4: PlatformVersion = PlatformVersion { validate_asset_lock_transaction_structure: 0, validate_instant_asset_lock_proof_structure: 0, }, + credit_withdrawal: IdentityCreditWithdrawalTransitionVersions { + default_constructor: 1, + }, }, }, contract_versions: ContractVersions { diff --git a/packages/wasm-dpp/lib/test/fixtures/getIdentityCreditWithdrawalTransitionFixture.js b/packages/wasm-dpp/lib/test/fixtures/getIdentityCreditWithdrawalTransitionFixture.js index 892acc55c1..2bc8478f3b 100644 --- a/packages/wasm-dpp/lib/test/fixtures/getIdentityCreditWithdrawalTransitionFixture.js +++ b/packages/wasm-dpp/lib/test/fixtures/getIdentityCreditWithdrawalTransitionFixture.js @@ -6,7 +6,7 @@ module.exports = function getIdentityCreditWithdrawalTransitionFixture() { const privateKey = new PrivateKey('cSBnVM4xvxarwGQuAfQFwqDg9k5tErHUHzgWsEfD4zdwUasvqRVY'); const address = privateKey.toAddress(); - const stateTransition = new IdentityCreditWithdrawalTransition(1); + const stateTransition = new IdentityCreditWithdrawalTransition(3); stateTransition.setIdentityId(generateRandomIdentifier()); // eslint-disable-next-line stateTransition.setAmount(BigInt(1000)); diff --git a/packages/wasm-dpp/src/identity/identity_facade.rs b/packages/wasm-dpp/src/identity/identity_facade.rs index d14892d4f9..bd4db7d491 100644 --- a/packages/wasm-dpp/src/identity/identity_facade.rs +++ b/packages/wasm-dpp/src/identity/identity_facade.rs @@ -206,7 +206,7 @@ impl IdentityFacadeWasm { amount: u64, core_fee_per_byte: u32, pooling: u8, - output_script: Vec, + output_script: Option>, identity_nonce: u64, ) -> Result { let pooling = match pooling { @@ -222,7 +222,7 @@ impl IdentityFacadeWasm { amount, core_fee_per_byte, pooling, - CoreScript::from_bytes(output_script), + output_script.map(CoreScript::from_bytes), identity_nonce as IdentityNonce, ) .map(Into::into) diff --git a/packages/wasm-dpp/src/identity/identity_factory.rs b/packages/wasm-dpp/src/identity/identity_factory.rs index b4fcf35d55..799598b456 100644 --- a/packages/wasm-dpp/src/identity/identity_factory.rs +++ b/packages/wasm-dpp/src/identity/identity_factory.rs @@ -210,7 +210,7 @@ impl IdentityFactoryWasm { amount: u64, core_fee_per_byte: u32, pooling: u8, - output_script: Vec, + output_script: Option>, identity_nonce: u64, ) -> Result { let pooling = match pooling { @@ -226,7 +226,7 @@ impl IdentityFactoryWasm { amount, core_fee_per_byte, pooling, - CoreScript::from_bytes(output_script), + output_script.map(CoreScript::from_bytes), identity_nonce as IdentityNonce, ) .map(Into::into) diff --git a/packages/wasm-dpp/test/integration/identity/IdentityFacade.spec.js b/packages/wasm-dpp/test/integration/identity/IdentityFacade.spec.js index 90778aa72e..2ed05d3bcb 100644 --- a/packages/wasm-dpp/test/integration/identity/IdentityFacade.spec.js +++ b/packages/wasm-dpp/test/integration/identity/IdentityFacade.spec.js @@ -24,7 +24,7 @@ describe('IdentityFacade', () => { beforeEach(async () => { dpp = new DashPlatformProtocol( { generate: () => crypto.randomBytes(32) }, - 1, + 3, ); const chainAssetLockProofJS = getChainAssetLockProofFixture(); diff --git a/packages/wasm-dpp/test/unit/identity/IdentityFactory.spec.js b/packages/wasm-dpp/test/unit/identity/IdentityFactory.spec.js index 25c23be0c9..1cd8fc8469 100644 --- a/packages/wasm-dpp/test/unit/identity/IdentityFactory.spec.js +++ b/packages/wasm-dpp/test/unit/identity/IdentityFactory.spec.js @@ -26,7 +26,7 @@ describe('IdentityFactory', () => { // const identityValidator = new IdentityValidator(blsAdapter); - factory = new IdentityFactory(1); + factory = new IdentityFactory(3); identity = await getIdentityFixture(instantAssetLockProof.createIdentifier()); identity.setBalance(0); diff --git a/packages/wasm-dpp/test/unit/identity/stateTransition/IdentityCreditWithdrawalTransition/IdentityCreditWithdrawalTransition.spec.js b/packages/wasm-dpp/test/unit/identity/stateTransition/IdentityCreditWithdrawalTransition/IdentityCreditWithdrawalTransition.spec.js index b80c611116..503ecf4bef 100644 --- a/packages/wasm-dpp/test/unit/identity/stateTransition/IdentityCreditWithdrawalTransition/IdentityCreditWithdrawalTransition.spec.js +++ b/packages/wasm-dpp/test/unit/identity/stateTransition/IdentityCreditWithdrawalTransition/IdentityCreditWithdrawalTransition.spec.js @@ -75,7 +75,7 @@ describe('IdentityCreditWithdrawalTransition', () => { rawStateTransition = stateTransition.toObject(); expect(rawStateTransition).to.deep.equal({ - $version: '0', + $version: '1', type: StateTransitionTypes.IdentityCreditWithdrawal, identityId: stateTransition.getIdentityId().toBuffer(), amount: stateTransition.getAmount(), @@ -92,7 +92,7 @@ describe('IdentityCreditWithdrawalTransition', () => { rawStateTransition = stateTransition.toObject({ skipSignature: true }); expect(rawStateTransition).to.deep.equal({ - $version: '0', + $version: '1', type: StateTransitionTypes.IdentityCreditWithdrawal, identityId: stateTransition.getIdentityId().toBuffer(), amount: stateTransition.getAmount(), @@ -109,7 +109,7 @@ describe('IdentityCreditWithdrawalTransition', () => { const jsonStateTransition = stateTransition.toJSON(); expect(jsonStateTransition).to.deep.equal({ - $version: '0', + $version: '1', type: StateTransitionTypes.IdentityCreditWithdrawal, identityId: stateTransition.getIdentityId().toString(), amount: stateTransition.getAmount().toString(),