Closed migueldingli1997 closed 1 year ago
Hi @migueldingli1997. Sorry for the late reply...
We have discussed this issue and we have a proposal: we would like to keep RelayPacket
as is, but instead add a new function (tentatively called RelayPacketWithResults
), with the same functionality as RelayPacket
, but that will return what you need (i.e (res *sdk.Result, ack []byte, err error)
). That way the existing RelayPacket
function doesn't need to change and usages of it can remain the same.
How does this sound? Would it work for you?
That would work @crodriguezvega :)
Summary
Return result and acknowledgement from RelayPacket function for possibility of applying checks or further operations based on these values.
Problem Definition
I have found the RelayPacket function to be very useful for tests where the packet is parsed from events and then relayed. An example from this repository that served as inspiration is the following: https://github.com/cosmos/ibc-go/blob/c86d27fc280cfb342a9e4689b381e5823441b694/modules/apps/transfer/keeper/relay_test.go#L223-L230
As my code has gotten more complex I have found myself wanting to relay packets that were committed on the counterparty chain as a result of a packet relayed on the original chain. For example, an interchain accounts transaction with a
MsgTransfer
will create a packet on the counterparty chain during the ICA host'sOnRecvPacket
.The way I see it, the easiest way to then relay this second packet would be to get a hold of the
OnRecvPacket
's events and look for the packet there. However theRelayPacket
function currently discards the result containing the events.So what I'm hoping for here is:
Proposal
From:
To:
For Admin Use