Skip to content

Commit 914428d

Browse files
test: bugs fixed
Signed-off-by: Alberto Molina <[email protected]>
1 parent e01e2c8 commit 914428d

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

packages/ats/contracts/test/contracts/unit/resolver/diamondCutManager.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
BOND_CONFIG_ID,
1616
BOND_FIXED_RATE_CONFIG_ID,
1717
BOND_KPI_LINKED_RATE_CONFIG_ID,
18+
BOND_SUSTAINABILITY_PERFORMANCE_TARGET_RATE_CONFIG_ID,
1819
EQUITY_CONFIG_ID,
1920
} from "@scripts";
2021
import { deployAtsInfrastructureFixture } from "@test";
@@ -39,6 +40,7 @@ describe("DiamondCutManager", () => {
3940
let bondFacetIdList: string[] = [];
4041
let bondFixedRateFacetIdList: string[] = [];
4142
let bondKpiLinkedRateFacetIdList: string[] = [];
43+
let bondSustainabilityPerformanceTargetRateFacetIdList: string[] = [];
4244
let equityFacetVersionList: number[] = [];
4345

4446
before(async () => {
@@ -59,6 +61,9 @@ describe("DiamondCutManager", () => {
5961
bondFacetIdList = Object.values(infrastructure.bondFacetKeys);
6062
bondFixedRateFacetIdList = Object.values(infrastructure.bondFixedRateFacetKeys);
6163
bondKpiLinkedRateFacetIdList = Object.values(infrastructure.bondKpiLinkedRateFacetKeys);
64+
bondSustainabilityPerformanceTargetRateFacetIdList = Object.values(
65+
infrastructure.bondSustainabilityPerformanceTargetRateFacetKeys,
66+
);
6267
equityFacetVersionList = Array(equityFacetIdList.length).fill(1);
6368
});
6469

@@ -274,7 +279,9 @@ describe("DiamondCutManager", () => {
274279
? bondFixedRateFacetIdList
275280
: configId == BOND_KPI_LINKED_RATE_CONFIG_ID
276281
? bondKpiLinkedRateFacetIdList
277-
: null;
282+
: configId == BOND_SUSTAINABILITY_PERFORMANCE_TARGET_RATE_CONFIG_ID
283+
? bondSustainabilityPerformanceTargetRateFacetIdList
284+
: null;
278285

279286
if (!expectedFacetIdList) {
280287
expect.fail("Unknown configId");
@@ -286,14 +293,15 @@ describe("DiamondCutManager", () => {
286293

287294
it("GIVEN a resolver WHEN reading configuration information THEN everything matches", async () => {
288295
const configLength = (await diamondCutManager.getConfigurationsLength()).toNumber();
289-
expect(configLength).to.equal(4);
296+
expect(configLength).to.equal(5);
290297

291298
const configIds = await diamondCutManager.getConfigurations(0, configLength);
292299
expect(configIds).to.have.members([
293300
EQUITY_CONFIG_ID,
294301
BOND_CONFIG_ID,
295302
BOND_FIXED_RATE_CONFIG_ID,
296303
BOND_KPI_LINKED_RATE_CONFIG_ID,
304+
BOND_SUSTAINABILITY_PERFORMANCE_TARGET_RATE_CONFIG_ID,
297305
]);
298306

299307
for (const configId of configIds) {

packages/ats/contracts/test/fixtures/infrastructure.fixture.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,14 @@ export async function deployAtsInfrastructureFixture(
116116
},
117117
{} as Record<string, string>,
118118
),
119+
bondSustainabilityPerformanceTargetRateFacetKeys: deployment.helpers
120+
.getBondSustainabilityPerformanceTargetRateFacets()
121+
.reduce(
122+
(acc, f) => {
123+
acc[f.name] = f.key;
124+
return acc;
125+
},
126+
{} as Record<string, string>,
127+
),
119128
};
120129
}

packages/ats/contracts/test/scripts/unit/checkpoint/utils.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ describe("Checkpoint Utilities", () => {
8787
facetCount: 47,
8888
txHash: "0xdef123",
8989
},
90+
bondSustainabilityPerformanceTargetRate: {
91+
configId: "0x0000000000000000000000000000000000000000000000000000000000000005",
92+
version: 1,
93+
facetCount: 47,
94+
txHash: "0xghi568",
95+
},
9096
},
9197
factory: {
9298
address: "0x5555555555555555555555555555555555555555",
@@ -245,6 +251,12 @@ describe("Checkpoint Utilities", () => {
245251
facetCount: 0,
246252
txHash: "0xdef123",
247253
},
254+
bondSustainabilityPerformanceTargetRate: {
255+
configId: "0x0000000000000000000000000000000000000000000000000000000000000005",
256+
version: 1,
257+
facetCount: 0,
258+
txHash: "0xghi568",
259+
},
248260
},
249261
},
250262
options: {},

0 commit comments

Comments
 (0)