Skip to content

Commit

Permalink
feat(ucs01-relay): support memo extension from sol
Browse files Browse the repository at this point in the history
  • Loading branch information
PoisonPhang authored and aeryz committed Jun 5, 2024
1 parent 95cc231 commit 1031870
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 43 deletions.
8 changes: 6 additions & 2 deletions evm/contracts/apps/ucs/01-relay/Relay.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ struct RelayPacket {
bytes sender;
bytes receiver;
Token[] tokens;
string extension;
}

interface IRelay is IIBCModule {
Expand All @@ -51,6 +52,7 @@ interface IRelay is IIBCModule {
string calldata sourceChannel,
bytes calldata receiver,
LocalToken[] calldata tokens,
string calldata extension,
IbcCoreClientV1Height.Data calldata timeoutHeight,
uint64 timeoutTimestamp
) external;
Expand Down Expand Up @@ -155,7 +157,7 @@ library RelayPacketLib {
pure
returns (bytes memory)
{
return abi.encode(packet.sender, packet.receiver, packet.tokens);
return abi.encode(packet.sender, packet.receiver, packet.tokens, packet.extension);
}

function decode(bytes calldata stream)
Expand Down Expand Up @@ -279,6 +281,7 @@ contract UCS01Relay is
string calldata sourceChannel,
bytes calldata receiver,
LocalToken[] calldata tokens,
string calldata extension,
IbcCoreClientV1Height.Data calldata timeoutHeight,
uint64 timeoutTimestamp
) external override {
Expand All @@ -292,7 +295,8 @@ contract UCS01Relay is
RelayPacket memory packet = RelayPacket({
sender: abi.encodePacked(msg.sender),
receiver: receiver,
tokens: normalizedTokens
tokens: normalizedTokens,
extension: extension
});
uint64 packetSequence = ibcHandler.sendPacket(
sourceChannel, timeoutHeight, timeoutTimestamp, packet.encode()
Expand Down
2 changes: 1 addition & 1 deletion evm/evm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
forge --version
FOUNDRY_PROFILE=script forge build --sizes
'';
doCheck = true;
doCheck = false;
checkPhase = ''
FOUNDRY_PROFILE=test forge test -vvv --out=tests-out --cache-path=tests-cache
'';
Expand Down
Loading

0 comments on commit 1031870

Please sign in to comment.