Skip to content

Commit 70c7b72

Browse files
fix: sdk and contracts tests
Signed-off-by: Axel Loupias <[email protected]>
1 parent f8b2265 commit 70c7b72

File tree

12 files changed

+29
-29
lines changed

12 files changed

+29
-29
lines changed

apps/ats/web/eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ const webConfig = baseConfig
5252
},
5353
]);
5454

55-
export default webConfig;
55+
export default webConfig;

apps/ats/web/prettier.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
*/
55
import baseConfig from '../../../prettier.config.mjs';
66

7-
export default baseConfig;
7+
export default baseConfig;

packages/ats/contracts/test/unitTests/layer_1/beneficiaries/beneficiaries.test.ts

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const BENEFICIARY_2 = '0x2345678901234567890123456789012345678901'
3030
const BENEFICIARY_2_DATA = '0x88888888'
3131
const numberOfUnits = 1000
3232
let startingDate = 999999999999990
33+
const couponRateDecimals = 2
3334
const couponFrequency = 0
3435
const couponRate = 0
3536
let maturityDate = 999999999999999
@@ -90,6 +91,7 @@ describe('Beneficiaries Tests', () => {
9091
maturityDate,
9192
couponFrequency,
9293
couponRate,
94+
couponRateDecimals,
9395
firstCouponDate,
9496
regulationType: RegulationType.REG_D,
9597
regulationSubType: RegulationSubType.REG_D_506_C,
@@ -136,14 +138,12 @@ describe('Beneficiaries Tests', () => {
136138

137139
describe('Add Tests', () => {
138140
it('GIVEN an unlisted beneficiary WHEN unauthorized user adds it THEN it reverts with AccountHasNoRole', async () => {
139-
beneficiariesFacet = beneficiariesFacet.connect(signer_B)
140-
141141
await expect(
142-
beneficiariesFacet.addBeneficiary(
143-
BENEFICIARY_1,
144-
BENEFICIARY_1_DATA,
145-
{ gasLimit: GAS_LIMIT.default }
146-
)
142+
beneficiariesFacet
143+
.connect(signer_B)
144+
.addBeneficiary(BENEFICIARY_1, BENEFICIARY_1_DATA, {
145+
gasLimit: GAS_LIMIT.default,
146+
})
147147
).to.be.revertedWithCustomError(
148148
beneficiariesFacet,
149149
'AccountHasNoRole'
@@ -203,12 +203,12 @@ describe('Beneficiaries Tests', () => {
203203

204204
describe('Remove Tests', () => {
205205
it('GIVEN a listed beneficiary WHEN unauthorized user removes it THEN it reverts with AccountHasNoRole', async () => {
206-
beneficiariesFacet = beneficiariesFacet.connect(signer_B)
207-
208206
await expect(
209-
beneficiariesFacet.removeBeneficiary(BENEFICIARY_2, {
210-
gasLimit: GAS_LIMIT.default,
211-
})
207+
beneficiariesFacet
208+
.connect(signer_B)
209+
.removeBeneficiary(BENEFICIARY_2, {
210+
gasLimit: GAS_LIMIT.default,
211+
})
212212
).to.be.revertedWithCustomError(
213213
beneficiariesFacet,
214214
'AccountHasNoRole'
@@ -217,7 +217,6 @@ describe('Beneficiaries Tests', () => {
217217

218218
it('GIVEN an listed beneficiary WHEN user removes it if token is paused THEN it reverts with TokenIsPaused', async () => {
219219
await pauseFacet.pause({ gasLimit: GAS_LIMIT.default })
220-
221220
await expect(
222221
beneficiariesFacet.removeBeneficiary(BENEFICIARY_2, {
223222
gasLimit: GAS_LIMIT.default,
@@ -258,14 +257,12 @@ describe('Beneficiaries Tests', () => {
258257

259258
describe('Update Data Tests', () => {
260259
it('GIVEN a listed beneficiary WHEN unauthorized user updates its data THEN it reverts with AccountHasNoRole', async () => {
261-
beneficiariesFacet = beneficiariesFacet.connect(signer_B)
262-
263260
await expect(
264-
beneficiariesFacet.updateBeneficiaryData(
265-
BENEFICIARY_2,
266-
BENEFICIARY_1_DATA,
267-
{ gasLimit: GAS_LIMIT.default }
268-
)
261+
beneficiariesFacet
262+
.connect(signer_B)
263+
.updateBeneficiaryData(BENEFICIARY_2, BENEFICIARY_1_DATA, {
264+
gasLimit: GAS_LIMIT.default,
265+
})
269266
).to.be.revertedWithCustomError(
270267
beneficiariesFacet,
271268
'AccountHasNoRole'
@@ -274,7 +271,6 @@ describe('Beneficiaries Tests', () => {
274271

275272
it('GIVEN an listed beneficiary WHEN user updates its data if token is paused THEN it reverts with TokenIsPaused', async () => {
276273
await pauseFacet.pause({ gasLimit: GAS_LIMIT.default })
277-
278274
await expect(
279275
beneficiariesFacet.updateBeneficiaryData(
280276
BENEFICIARY_2,

packages/ats/sdk/__tests__/fixtures/shared/SecurityFixture.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ export const SecurityPropsFixture = createFixture<SecurityProps>((security) => {
229229
);
230230
security.decimals.faker((faker) => faker.number.int({ min: 0, max: 18 }));
231231
security.isWhiteList.faker((faker) => faker.datatype.boolean());
232+
security.erc20VotesActivated?.faker((faker) => faker.datatype.boolean());
232233
security.isControllable.faker((faker) => faker.datatype.boolean());
233234
security.arePartitionsProtected.faker((faker) => faker.datatype.boolean());
234235
security.clearingActive.faker((faker) => faker.datatype.boolean());

packages/ats/sdk/eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ const sdkConfig = baseConfig
6262
},
6363
]);
6464

65-
export default sdkConfig;
65+
export default sdkConfig;

packages/ats/sdk/prettier.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
*/
55
import baseConfig from '../../../prettier.config.mjs';
66

7-
export default baseConfig;
7+
export default baseConfig;

packages/ats/sdk/src/app/usecase/command/bond/create/CreateBondCommandHandler.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ describe('CreateBondCommandHandler', () => {
383383
);
384384
expect(
385385
contractServiceMock.getEvmAddressesFromHederaIds,
386-
).toHaveBeenCalledTimes(4);
386+
).toHaveBeenCalledTimes(3);
387387
expect(accountServiceMock.getAccountEvmAddress).toHaveBeenCalledTimes(
388388
1,
389389
);

packages/ats/sdk/src/app/usecase/command/bond/createTrexSuite/CreateTrexSuiteBondCommandHandler.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ describe('CreateTrexSuiteBondCommandHandler', () => {
329329
);
330330
expect(
331331
contractServiceMock.getEvmAddressesFromHederaIds,
332-
).toHaveBeenCalledTimes(4);
332+
).toHaveBeenCalledTimes(3);
333333
expect(accountServiceMock.getAccountEvmAddress).toHaveBeenCalledTimes(
334334
1,
335335
);

packages/ats/sdk/src/app/usecase/command/security/beneficiaries/updateBeneficiaryData/UpdateBeneficiaryDataCommandHandler.unit.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ describe('UpdateBeneficiaryDataCommandHandler', () => {
303303
).toHaveBeenCalledWith(
304304
evmAddress,
305305
beneficiaryEvmAddress,
306+
command.data,
306307
command.securityId,
307308
);
308309
});

packages/ats/sdk/src/port/in/bond/Bond.unit.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,8 @@ describe('Bond', () => {
396396
createBondRequest.externalKycListsIds,
397397
createBondRequest.complianceId,
398398
createBondRequest.identityRegistryId,
399+
createBondRequest.beneficiariesIds,
400+
createBondRequest.beneficiariesData,
399401
),
400402
);
401403

0 commit comments

Comments
 (0)