Skip to content

Commit

Permalink
fixing SGC remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
gaetbout committed Jul 1, 2024
1 parent 7c3384c commit a07a009
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/signers/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ export class LongSigner extends LegacyStarknetKeyPair {

export class WrongSigner extends LegacyStarknetKeyPair {
public async signRaw(messageHash: string): Promise<string[]> {
return ["", ""];
return ["0x1", "0x1"];
}
}
16 changes: 4 additions & 12 deletions tests-integration/claim_internal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
calculateEscrowAddress,
claimInternal,
defaultDepositTestSetup,
deployMockERC20,
expectRevertWithErrorMessage,
getEscrowAccount,
manager,
Expand All @@ -30,23 +29,16 @@ describe("Claim Internal", function () {
await manager.tokens.tokenBalance(receiver, gift.gift_token).should.eventually.equal(gift.gift_amount);
});

it(`fee token not ETH nor STRK using txV3: ${useTxV3}`, async function () {
it(`Invalid gift data txV3: ${useTxV3}`, async function () {
const { factory } = await setupGiftProtocol();
const { gift, giftPrivateKey } = await defaultDepositTestSetup({ factory, useTxV3 });
const receiver = randomReceiver();
const escrowAddress = calculateEscrowAddress(gift);

const escrowAccount = getEscrowAccount(gift, giftPrivateKey, escrowAddress);
const mockERC20 = await deployMockERC20();
gift.fee_token = mockERC20.address;
const escrowAccountAddress = getEscrowAccount(gift, giftPrivateKey, escrowAddress).address;
gift.fee_amount = 42n;
await expectRevertWithErrorMessage("escrow/invalid-escrow-address", () =>
escrowAccount.execute([
{
contractAddress: escrowAddress,
calldata: [buildGiftCallData(gift), receiver],
entrypoint: "claim_internal",
},
]),
claimInternal({ gift, receiver, giftPrivateKey, overrides: { escrowAccountAddress } }),
);
});

Expand Down

0 comments on commit a07a009

Please sign in to comment.