Skip to content

Commit 4abf1de

Browse files
AlbertoMolinaIoBuildersMiguelLZPF
authored andcommitted
fix: tests and scripts updated
Signed-off-by: Alberto Molina <[email protected]>
1 parent 1b8f813 commit 4abf1de

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-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
@@ -31,6 +31,7 @@ describe("DiamondCutManager", () => {
3131
let pause: Pause;
3232
let equityFacetIdList: string[] = [];
3333
let bondFacetIdList: string[] = [];
34+
let bondFixedRateFacetIdList: string[] = [];
3435
let equityFacetVersionList: number[] = [];
3536

3637
before(async () => {
@@ -49,6 +50,7 @@ describe("DiamondCutManager", () => {
4950
diamondCutManager = await ethers.getContractAt("DiamondCutManager", businessLogicResolver.address, signer_A);
5051
equityFacetIdList = Object.values(infrastructure.equityFacetKeys);
5152
bondFacetIdList = Object.values(infrastructure.bondFacetKeys);
53+
bondFixedRateFacetIdList = Object.values(infrastructure.bondFixedRateFacetKeys);
5254
equityFacetVersionList = Array(equityFacetIdList.length).fill(1);
5355
});
5456

@@ -251,7 +253,13 @@ describe("DiamondCutManager", () => {
251253
expect(facetAddresses).to.have.members(facetAddresses_2);
252254

253255
const expectedFacetIdList =
254-
configId === EQUITY_CONFIG_ID ? equityFacetIdList : configId === BOND_CONFIG_ID ? bondFacetIdList : null;
256+
configId === EQUITY_CONFIG_ID
257+
? equityFacetIdList
258+
: configId === BOND_CONFIG_ID
259+
? bondFacetIdList
260+
: configId == BOND_FIXED_RATE_CONFIG_ID
261+
? bondFixedRateFacetIdList
262+
: null;
255263

256264
if (!expectedFacetIdList) {
257265
expect.fail("Unknown configId");
@@ -422,7 +430,7 @@ describe("DiamondCutManager", () => {
422430
const originalDiamondCutManager = diamondCutManager;
423431
diamondCutManager = batchDiamondCutManager;
424432

425-
for (const configId of [EQUITY_CONFIG_ID, BOND_CONFIG_ID]) {
433+
for (const configId of [EQUITY_CONFIG_ID, BOND_CONFIG_ID, BOND_FIXED_RATE_CONFIG_ID]) {
426434
const configLatestVersion = (await batchDiamondCutManager.getLatestVersionByConfiguration(configId)).toNumber();
427435
expect(configLatestVersion).to.equal(0);
428436

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,12 @@ export async function deployAtsInfrastructureFixture(
102102
},
103103
{} as Record<string, string>,
104104
),
105+
bondFixedRateFacetKeys: deployment.helpers.getBondFacets().reduce(
106+
(acc, f) => {
107+
acc[f.name] = f.key;
108+
return acc;
109+
},
110+
{} as Record<string, string>,
111+
),
105112
};
106113
}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ describe("Checkpoint Utilities", () => {
131131
);
132132
expect(output.configurations.bond.version).to.equal(1);
133133
expect(output.configurations.bond.facetCount).to.equal(43);
134+
expect(output.configurations.bondFixedRate.configId).to.equal(
135+
"0x0000000000000000000000000000000000000000000000000000000000000003",
136+
);
137+
expect(output.configurations.bondFixedRate.version).to.equal(1);
138+
expect(output.configurations.bondFixedRate.facetCount).to.equal(44);
134139

135140
// Summary
136141
expect(output.summary.totalContracts).to.equal(5); // ProxyAdmin + BLR + Factory + 2 facets
@@ -218,6 +223,12 @@ describe("Checkpoint Utilities", () => {
218223
facetCount: 0,
219224
txHash: "0xpqr678",
220225
},
226+
bondFixedRate: {
227+
configId: "0x0000000000000000000000000000000000000000000000000000000000000003",
228+
version: 1,
229+
facetCount: 0,
230+
txHash: "0xabc789",
231+
},
221232
},
222233
},
223234
options: {},

0 commit comments

Comments
 (0)