From a61644dce48e9d9b5aa688bcbb27594b13281b8b Mon Sep 17 00:00:00 2001 From: Gjermund Garaba Date: Fri, 22 Nov 2024 10:24:41 +0100 Subject: [PATCH] lint --- src/utils/ICS20Lib.sol | 16 ++++++------ test/ICS20LibTest.t.sol | 1 - test/ICS20TransferTest.t.sol | 5 +--- test/IntegrationTest.t.sol | 48 ++++++++++++++++++++---------------- 4 files changed, 37 insertions(+), 33 deletions(-) diff --git a/src/utils/ICS20Lib.sol b/src/utils/ICS20Lib.sol index bc43682..d514dbf 100644 --- a/src/utils/ICS20Lib.sol +++ b/src/utils/ICS20Lib.sol @@ -145,13 +145,15 @@ library ICS20Lib { } // We are encoding the payload in ABI format - bytes memory packetData = ICS20Lib.encodePayload(ICS20Lib.FungibleTokenPacketData({ - denom: fullDenomPath, - sender: Strings.toHexString(sender), - receiver: msg_.receiver, - amount: msg_.amount, - memo: msg_.memo - })); + bytes memory packetData = ICS20Lib.encodePayload( + ICS20Lib.FungibleTokenPacketData({ + denom: fullDenomPath, + sender: Strings.toHexString(sender), + receiver: msg_.receiver, + amount: msg_.amount, + memo: msg_.memo + }) + ); IICS26RouterMsgs.Payload[] memory payloads = new IICS26RouterMsgs.Payload[](1); payloads[0] = IICS26RouterMsgs.Payload({ diff --git a/test/ICS20LibTest.t.sol b/test/ICS20LibTest.t.sol index 91b462e..057d6d1 100644 --- a/test/ICS20LibTest.t.sol +++ b/test/ICS20LibTest.t.sol @@ -5,7 +5,6 @@ pragma solidity ^0.8.28; import { Test } from "forge-std/Test.sol"; import { ICS20Lib } from "../src/utils/ICS20Lib.sol"; -import { IICS20Errors } from "../src/errors/IICS20Errors.sol"; contract ICS20LibTest is Test { struct IBCDenomTestCase { diff --git a/test/ICS20TransferTest.t.sol b/test/ICS20TransferTest.t.sol index 1d8d0a2..9423739 100644 --- a/test/ICS20TransferTest.t.sol +++ b/test/ICS20TransferTest.t.sol @@ -271,7 +271,6 @@ contract ICS20TransferTest is Test { defaultSendPacketData.amount = defaultAmount; // reset amount packet.payloads[0].value = ICS20Lib.encodePayload(defaultSendPacketData); - // test invalid data packet.payloads[0].value = bytes("invalid"); vm.expectRevert(); // Given the data is invalid, we expect the abi.decodePayload to fail with a generic revert @@ -426,9 +425,7 @@ contract ICS20TransferTest is Test { assertEq(contractBalanceAfterSend, defaultAmount); vm.expectEmit(); - emit IICS20Transfer.ICS20Acknowledgement( - defaultSendPacketData, ICS20Lib.SUCCESSFUL_ACKNOWLEDGEMENT_JSON - ); + emit IICS20Transfer.ICS20Acknowledgement(defaultSendPacketData, ICS20Lib.SUCCESSFUL_ACKNOWLEDGEMENT_JSON); ics20Transfer.onAcknowledgementPacket( IIBCAppCallbacks.OnAcknowledgementPacketCallback({ sourceChannel: packet.sourceChannel, diff --git a/test/IntegrationTest.t.sol b/test/IntegrationTest.t.sol index d2660fb..f10677d 100644 --- a/test/IntegrationTest.t.sol +++ b/test/IntegrationTest.t.sol @@ -126,13 +126,15 @@ contract IntegrationTest is Test { uint32 sequence = ics20Transfer.sendTransfer(transferMsg); assertEq(sequence, 1); - bytes memory value = ICS20Lib.encodePayload(ICS20Lib.FungibleTokenPacketData({ - denom: erc20AddressStr, - sender: senderStr, - receiver: receiverStr, - amount: transferAmount, - memo: "memo" - })); + bytes memory value = ICS20Lib.encodePayload( + ICS20Lib.FungibleTokenPacketData({ + denom: erc20AddressStr, + sender: senderStr, + receiver: receiverStr, + amount: transferAmount, + memo: "memo" + }) + ); IICS26RouterMsgs.Payload[] memory packetPayloads = new IICS26RouterMsgs.Payload[](1); packetPayloads[0] = IICS26RouterMsgs.Payload({ @@ -455,13 +457,15 @@ contract IntegrationTest is Test { destPort: ICS20Lib.DEFAULT_PORT_ID, version: ICS20Lib.ICS20_VERSION, encoding: ICS20Lib.ICS20_ENCODING, - value: ICS20Lib.encodePayload(ICS20Lib.FungibleTokenPacketData({ - denom: receivedDenom, - sender: senderStr, - receiver: receiverStr, - amount: transferAmount, - memo: "backmemo" - })) + value: ICS20Lib.encodePayload( + ICS20Lib.FungibleTokenPacketData({ + denom: receivedDenom, + sender: senderStr, + receiver: receiverStr, + amount: transferAmount, + memo: "backmemo" + }) + ) }); packet = IICS26RouterMsgs.Packet({ sequence: 1, @@ -529,13 +533,15 @@ contract IntegrationTest is Test { destPort: ICS20Lib.DEFAULT_PORT_ID, version: ICS20Lib.ICS20_VERSION, encoding: ICS20Lib.ICS20_ENCODING, - value: ICS20Lib.encodePayload(ICS20Lib.FungibleTokenPacketData({ - denom: receivedDenom, - sender: senderStr, - receiver: receiverStr, - amount: transferAmount, - memo: "backmemo" - })) + value: ICS20Lib.encodePayload( + ICS20Lib.FungibleTokenPacketData({ + denom: receivedDenom, + sender: senderStr, + receiver: receiverStr, + amount: transferAmount, + memo: "backmemo" + }) + ) }); packet = IICS26RouterMsgs.Packet({ sequence: 1,