diff --git a/packages/platform-test-suite/test/functional/platform/Identity.spec.js b/packages/platform-test-suite/test/functional/platform/Identity.spec.js index 80c10d08cf1..792c0804cbd 100644 --- a/packages/platform-test-suite/test/functional/platform/Identity.spec.js +++ b/packages/platform-test-suite/test/functional/platform/Identity.spec.js @@ -23,14 +23,13 @@ const { IdentityPublicKey, InvalidInstantAssetLockProofSignatureError, IdentityAssetLockTransactionOutPointAlreadyExistsError, - BalanceIsNotEnoughError, BasicECDSAError, IdentityPublicKeyWithWitness, IdentityInsufficientBalanceError, }, } = Dash; -describe('Platform',() => { +describe('Platform', () => { describe('Identity', function describeIdentity() { this.bail(true); // bail on first failure @@ -103,7 +102,7 @@ describe('Platform',() => { transaction, privateKey, outputIndex, - } = await client.platform.identities.utils.createAssetLockTransaction(100000); + } = await client.platform.identities.utils.createAssetLockTransaction(150000); const account = await client.getWalletAccount(); @@ -248,7 +247,7 @@ describe('Platform',() => { transaction, privateKey, outputIndex, - } = await client.platform.identities.utils.createAssetLockTransaction(100000); + } = await client.platform.identities.utils.createAssetLockTransaction(150000); const account = await client.getWalletAccount(); @@ -325,9 +324,11 @@ describe('Platform',() => { }); }); - // TODO: there is a bug in identity create balance validation - it.skip('should fail to create more documents if there are no more credits', async () => { - const lowBalanceIdentity = await client.platform.identities.register(80000); + it('should fail to create more documents if there are no more credits', async () => { + const lowBalanceIdentity = await client.platform.identities.register(150000); + + // Additional wait time to mitigate testnet latency + await waitForSTPropagated(); const document = await client.platform.documents.create( 'customContracts.niceDocument', @@ -350,7 +351,7 @@ describe('Platform',() => { expect(broadcastError).to.exist(); expect(broadcastError).to.be.an.instanceOf(StateTransitionBroadcastError); expect(broadcastError.getCause()).to.be.an.instanceOf( - BalanceIsNotEnoughError, + IdentityInsufficientBalanceError, ); }); @@ -458,7 +459,10 @@ describe('Platform',() => { // Creating ST that tries to spend the same output - const anotherIdentity = await client.platform.identities.register(100000); + const anotherIdentity = await client.platform.identities.register(150000); + + // Additional wait time to mitigate testnet latency + await waitForSTPropagated(); const conflictingTopUpStateTransition = await client.platform.identities.utils .createIdentityTopUpTransition(assetLockProof, privateKey, anotherIdentity.getId()); @@ -490,6 +494,8 @@ describe('Platform',() => { let recipient; before(async () => { recipient = await client.platform.identities.register(400000); + + // Additional wait time to mitigate testnet latency await waitForSTPropagated(); }); @@ -510,6 +516,7 @@ describe('Platform',() => { transferAmount, ); + // Additional wait time to mitigate testnet latency await waitForSTPropagated(); const identityAfterTransfer = await client.platform.identities.get( diff --git a/packages/platform-test-suite/test/functional/platform/proofs.spec.js b/packages/platform-test-suite/test/functional/platform/proofs.spec.js index 7291d1d513f..2eca4a13646 100644 --- a/packages/platform-test-suite/test/functional/platform/proofs.spec.js +++ b/packages/platform-test-suite/test/functional/platform/proofs.spec.js @@ -34,7 +34,7 @@ describe('Platform', () => { await hashFunction.init(); blake3 = hashFunction.hashFunction; - dashClient = await createClientWithFundedWallet(400000); + dashClient = await createClientWithFundedWallet(500000); await dashClient.platform.initialize(); @@ -137,11 +137,11 @@ describe('Platform', () => { let identity8PublicKeyHash; before(async () => { - identityAtKey5 = await dashClient.platform.identities.register(100000); + identityAtKey5 = await dashClient.platform.identities.register(150000); - identityAtKey6 = await dashClient.platform.identities.register(100000); + identityAtKey6 = await dashClient.platform.identities.register(150000); - identityAtKey8 = await dashClient.platform.identities.register(100000); + identityAtKey8 = await dashClient.platform.identities.register(150000); // await waitForBalanceToChange(walletAccount); diff --git a/packages/rs-drive-abci/src/execution/types/execution_event/mod.rs b/packages/rs-drive-abci/src/execution/types/execution_event/mod.rs index d6574c6906a..9e799bd0648 100644 --- a/packages/rs-drive-abci/src/execution/types/execution_event/mod.rs +++ b/packages/rs-drive-abci/src/execution/types/execution_event/mod.rs @@ -85,12 +85,11 @@ impl<'a> ExecutionEvent<'a> { match &action { StateTransitionAction::IdentityCreateAction(identity_create_action) => { let identity = identity_create_action.into(); - let added_balance = identity_create_action.initial_balance_amount(); let operations = action.into_high_level_drive_operations(epoch, platform_version)?; Ok(PaidFromAssetLockDriveEvent { identity, - added_balance, + added_balance: 0, operations, }) }