Skip to content

Commit ef05fb8

Browse files
committed
fix: copilot suggestions
1 parent f7992c3 commit ef05fb8

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

contracts/PegInContract.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ contract PegInContract is
309309
uint256 height,
310310
bytes32 derivationHash
311311
) private returns (int256) {
312+
Registry memory callRegistry = _callRegistry[derivationHash];
312313
return _bridge.registerFastBridgeBtcTransaction(
313314
btcRawTransaction,
314315
height,
@@ -317,7 +318,7 @@ contract PegInContract is
317318
quote.btcRefundAddress,
318319
payable(this),
319320
quote.liquidityProviderBtcAddress,
320-
_callRegistry[derivationHash].timestamp > 0 && _callRegistry[derivationHash].success
321+
callRegistry.timestamp > 0 && callRegistry.success
321322
);
322323
}
323324

test/pegin/register-pegin.test.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,17 @@ describe("PegInContract registerPegIn function should", () => {
504504
nConfirmationHeader
505505
);
506506

507-
const fakeSignature = await liquidityProvider.signMessage(
508-
"0x9e1ff8110dede851f2d517bf6567987d9f4555f70e27054cb1d2769cc4e9005d"
509-
);
507+
const fakeQuote = getTestPeginQuote({
508+
lbcAddress: await contract.getAddress(),
509+
liquidityProvider: liquidityProvider,
510+
value: ethers.parseEther("1.2"),
511+
destinationAddress: liquidityProvider.address,
512+
refundAddress: liquidityProvider.address,
513+
});
514+
const fakeQuoteHash = await contract
515+
.hashPegInQuote(fakeQuote)
516+
.then((result) => ethers.getBytes(result));
517+
const fakeSignature = await liquidityProvider.signMessage(fakeQuoteHash);
510518

511519
await expect(
512520
contract
@@ -1087,7 +1095,7 @@ describe("PegInContract registerPegIn function should", () => {
10871095
await expect(tx)
10881096
.to.emit(collateralManagement, "Penalized")
10891097
.withArgs(
1090-
fullLp,
1098+
fullLp.address,
10911099
quoteHash,
10921100
ProviderType.PegIn,
10931101
quote.penaltyFee,

0 commit comments

Comments
 (0)