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 4be23a4a67..359c569b4b 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 @@ -49,8 +49,8 @@ export async function creditWithdrawal( // eslint-disable-next-line no-param-reassign options = { - ...options, signingKeyIndex: 3, + ...options, }; const { dpp } = this; diff --git a/packages/platform-test-suite/test/e2e/withdrawals.spec.js b/packages/platform-test-suite/test/e2e/withdrawals.spec.js index ecbac9b8de..9c5dbee62b 100644 --- a/packages/platform-test-suite/test/e2e/withdrawals.spec.js +++ b/packages/platform-test-suite/test/e2e/withdrawals.spec.js @@ -8,7 +8,7 @@ const waitForSTPropagated = require('../../lib/waitForSTPropagated'); // TODO: temporary disabled due to flakiness. These tests aren't important for now, since we are // going to release v1.0.0 with withdrawals disabled. -describe.skip('Withdrawals', function withdrawalsTest() { +describe('Withdrawals', function withdrawalsTest() { this.bail(true); let client; @@ -38,7 +38,7 @@ describe.skip('Withdrawals', function withdrawalsTest() { }); describe('Any Identity', () => { - const INITIAL_BALANCE = 1000000; + const INITIAL_BALANCE = 2000000; before(async () => { identity = await client.platform.identities.register(INITIAL_BALANCE); @@ -57,7 +57,9 @@ describe.skip('Withdrawals', function withdrawalsTest() { await client.platform.identities.withdrawCredits( identity, BigInt(amountToWithdraw), - withdrawTo.address, + { + toAddress: withdrawTo.address, + }, ); // Re-fetch identity to obtain latest core chain lock height @@ -125,7 +127,9 @@ describe.skip('Withdrawals', function withdrawalsTest() { const { height: withdrawalHeight } = await client.platform.identities.withdrawCredits( identity, BigInt(amountToWithdraw), - withdrawTo.address, + { + toAddress: withdrawTo.address, + }, ); let withdrawalBroadcasted = false; @@ -173,7 +177,9 @@ describe.skip('Withdrawals', function withdrawalsTest() { await expect(client.platform.identities.withdrawCredits( identity, BigInt(amountToWithdraw), - withdrawTo.address, + { + toAddress: withdrawTo.address, + }, )).to.be.rejectedWith(`Withdrawal amount "${amountToWithdraw}" is bigger that identity balance "${identityBalanceBefore}"`); }); @@ -186,11 +192,11 @@ describe.skip('Withdrawals', function withdrawalsTest() { await expect(client.platform.identities.withdrawCredits( identity, BigInt(amountToWithdraw), - withdrawTo.address, { + toAddress: withdrawTo.address, signingKeyIndex: 1, }, - )).to.be.rejectedWith('Error conversion not implemented: Invalid public key security level HIGH. The state transition requires one of CRITICAL'); + )).to.be.rejectedWith('Error conversion not implemented: Invalid public key security level HIGH. The state transition requires one of MASTER'); }); // TODO: Figure out how to overcome client-side validation and implement @@ -227,7 +233,9 @@ describe.skip('Withdrawals', function withdrawalsTest() { await client.platform.identities.withdrawCredits( identity, BigInt(1000000), - withdrawTo.address, + { + toAddress: withdrawTo.address, + }, ); await waitForSTPropagated();