Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
andresaiello committed Feb 6, 2024
1 parent c320f5a commit 6bedfc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@ contract MultiChainValue is ZetaInteractor, MultiChainValueErrors {
}

function onZetaRevert(ZetaInterfaces.ZetaRevert calldata zetaRevert) external isValidRevertCall(zetaRevert) {
bool success1 = ZetaEth(zetaToken).approve(address(this), zetaRevert.remainingZetaValue);
bool success2 = ZetaEth(zetaToken).transferFrom(
address(this),
zetaRevert.zetaTxSenderAddress,
zetaRevert.remainingZetaValue
);
if (!(success1 && success2)) revert ErrorTransferringZeta();
//@dev this version do not handle revert
}
}
11 changes: 2 additions & 9 deletions packages/zeta-app-contracts/test/MultiChainValue.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,7 @@ describe("MultiChainValue tests", () => {

await expect(tx)
.to.be.emit(zetaConnectorMockContract, "Send")
.withArgs(
chainBId,
account1Address.toLowerCase(),
300000,
defaultAbiCoder.encode(["address"], [deployer.address]),
10,
defaultAbiCoder.encode(["string"], [""])
);
.withArgs(chainBId, account1Address.toLowerCase(), 300000, "0x", 10, defaultAbiCoder.encode(["string"], [""]));
});

it("Should send native token", async () => {
Expand Down Expand Up @@ -138,7 +131,7 @@ describe("MultiChainValue tests", () => {
ethers.utils.hexZeroPad("0x0", 32)
);

const balance = await zetaEthMockContract.balanceOf(account1.address);
const balance = await zetaEthMockContract.balanceOf(multiChainValueContractA.address);
await expect(balance).to.be.eq(remainingZetaValue);
});

Expand Down

0 comments on commit 6bedfc1

Please sign in to comment.