Skip to content

Commit 1d98568

Browse files
committed
test: add resign tests
1 parent 15b998b commit 1d98568

File tree

7 files changed

+655
-24
lines changed

7 files changed

+655
-24
lines changed

test/collateral/fixtures.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,33 @@ export async function deployCollateralManagementWithRoles() {
5454

5555
return { adder, slasher, ...deployResult };
5656
}
57+
58+
export async function deployCollateralManagementWithProviders() {
59+
const deployResult = await deployCollateralManagementWithRoles();
60+
const signers = deployResult.signers;
61+
const pegInLp = signers.pop();
62+
const pegOutLp = signers.pop();
63+
const fullLp = signers.pop();
64+
if (!pegInLp || !pegOutLp || !fullLp)
65+
throw new Error("All providers should be defined");
66+
const { collateralManagement, adder } = deployResult;
67+
const BASE_COLLATERAL_TX = { value: ethers.parseEther("10") };
68+
await collateralManagement
69+
.connect(adder)
70+
.addPegInCollateralTo(pegInLp.address, BASE_COLLATERAL_TX);
71+
await collateralManagement
72+
.connect(adder)
73+
.addPegOutCollateralTo(pegOutLp.address, BASE_COLLATERAL_TX);
74+
await collateralManagement
75+
.connect(adder)
76+
.addPegInCollateralTo(fullLp.address, BASE_COLLATERAL_TX);
77+
await collateralManagement
78+
.connect(adder)
79+
.addPegOutCollateralTo(fullLp.address, BASE_COLLATERAL_TX);
80+
const providers = [
81+
{ signer: pegInLp, pegIn: true, pegOut: false },
82+
{ signer: pegOutLp, pegIn: false, pegOut: true },
83+
{ signer: fullLp, pegIn: true, pegOut: true },
84+
];
85+
return { providers, pegInLp, pegOutLp, fullLp, ...deployResult };
86+
}

0 commit comments

Comments
 (0)