From 1ea9888695a60799114e65d15337574a7026b86f Mon Sep 17 00:00:00 2001 From: Sean King Date: Fri, 16 Jul 2021 15:42:35 +0200 Subject: [PATCH] adding getInterchainAccount to onRecvPacket --- spec/app/ics-027-interchain-accounts/README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spec/app/ics-027-interchain-accounts/README.md b/spec/app/ics-027-interchain-accounts/README.md index af77b8568..4aa237350 100644 --- a/spec/app/ics-027-interchain-accounts/README.md +++ b/spec/app/ics-027-interchain-accounts/README.md @@ -241,10 +241,14 @@ function onRecvPacket(packet: Packet) { InterchainAccountPacketData data = packet.data const tx = deserialiseTx(packet.data.txBytes) try { - const result = executeTx(tx) - + executeTx(tx) + + // Gets the interchain account address, and returns it to the controller chain + // This step is necessary in order for the controller chain to know the address of the registered interchain account + // We should only return the interchain account on packet sequence 1 + const interchainAccount = getInterchainAccount(ctx, SourcePortId) return Acknowledgement{ - result: result + result: interchainAccount } } catch (e) { // Return ack with error.