Skip to content

Commit 59aadb0

Browse files
authored
test(test-suite): enable withdrawal tests (#2202)
1 parent 1c8a83f commit 59aadb0

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

packages/js-dash-sdk/src/SDK/Client/Platform/methods/identities/creditWithdrawal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export async function creditWithdrawal(
4949

5050
// eslint-disable-next-line no-param-reassign
5151
options = {
52-
...options,
5352
signingKeyIndex: 3,
53+
...options,
5454
};
5555

5656
const { dpp } = this;

packages/platform-test-suite/test/e2e/withdrawals.spec.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const waitForSTPropagated = require('../../lib/waitForSTPropagated');
88

99
// TODO: temporary disabled due to flakiness. These tests aren't important for now, since we are
1010
// going to release v1.0.0 with withdrawals disabled.
11-
describe.skip('Withdrawals', function withdrawalsTest() {
11+
describe('Withdrawals', function withdrawalsTest() {
1212
this.bail(true);
1313

1414
let client;
@@ -38,7 +38,7 @@ describe.skip('Withdrawals', function withdrawalsTest() {
3838
});
3939

4040
describe('Any Identity', () => {
41-
const INITIAL_BALANCE = 1000000;
41+
const INITIAL_BALANCE = 2000000;
4242

4343
before(async () => {
4444
identity = await client.platform.identities.register(INITIAL_BALANCE);
@@ -57,7 +57,9 @@ describe.skip('Withdrawals', function withdrawalsTest() {
5757
await client.platform.identities.withdrawCredits(
5858
identity,
5959
BigInt(amountToWithdraw),
60-
withdrawTo.address,
60+
{
61+
toAddress: withdrawTo.address,
62+
},
6163
);
6264

6365
// Re-fetch identity to obtain latest core chain lock height
@@ -125,7 +127,9 @@ describe.skip('Withdrawals', function withdrawalsTest() {
125127
const { height: withdrawalHeight } = await client.platform.identities.withdrawCredits(
126128
identity,
127129
BigInt(amountToWithdraw),
128-
withdrawTo.address,
130+
{
131+
toAddress: withdrawTo.address,
132+
},
129133
);
130134

131135
let withdrawalBroadcasted = false;
@@ -173,7 +177,9 @@ describe.skip('Withdrawals', function withdrawalsTest() {
173177
await expect(client.platform.identities.withdrawCredits(
174178
identity,
175179
BigInt(amountToWithdraw),
176-
withdrawTo.address,
180+
{
181+
toAddress: withdrawTo.address,
182+
},
177183
)).to.be.rejectedWith(`Withdrawal amount "${amountToWithdraw}" is bigger that identity balance "${identityBalanceBefore}"`);
178184
});
179185

@@ -186,11 +192,11 @@ describe.skip('Withdrawals', function withdrawalsTest() {
186192
await expect(client.platform.identities.withdrawCredits(
187193
identity,
188194
BigInt(amountToWithdraw),
189-
withdrawTo.address,
190195
{
196+
toAddress: withdrawTo.address,
191197
signingKeyIndex: 1,
192198
},
193-
)).to.be.rejectedWith('Error conversion not implemented: Invalid public key security level HIGH. The state transition requires one of CRITICAL');
199+
)).to.be.rejectedWith('Error conversion not implemented: Invalid public key security level HIGH. The state transition requires one of MASTER');
194200
});
195201

196202
// TODO: Figure out how to overcome client-side validation and implement
@@ -227,7 +233,9 @@ describe.skip('Withdrawals', function withdrawalsTest() {
227233
await client.platform.identities.withdrawCredits(
228234
identity,
229235
BigInt(1000000),
230-
withdrawTo.address,
236+
{
237+
toAddress: withdrawTo.address,
238+
},
231239
);
232240

233241
await waitForSTPropagated();

0 commit comments

Comments
 (0)