From c4056bcd48800b6bfadb4de5eaccb66af6446ef4 Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Tue, 8 Feb 2022 10:56:01 -0600 Subject: [PATCH] fix(pegasus): use dummy ICS20-1 transfer `sender` --- packages/pegasus/src/ics20.js | 8 +++++++- packages/pegasus/test/test-peg.js | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/pegasus/src/ics20.js b/packages/pegasus/src/ics20.js index b8cd79091d0..7a9b3c470a9 100644 --- a/packages/pegasus/src/ics20.js +++ b/packages/pegasus/src/ics20.js @@ -8,10 +8,15 @@ import { assert, details as X } from '@agoric/assert'; * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures * @property {string} amount The extent of the amount * @property {Denom} denom The denomination of the amount - * @property {string} [sender] The sender address + * @property {string} sender The sender address * @property {DepositAddress} receiver The receiver deposit address */ +// ibc-go as late as v3 requires the `sender` to be nonempty, but doesn't +// actually use it on the receiving side. We don't need it on the sending side, +// either, so we can just omit it. +export const DUMMY_SENDER_ADDRESS = 'pegasus'; + /** * @param {string} s */ @@ -78,6 +83,7 @@ export const makeICS20TransferPacket = async ({ amount: stringValue, denom: remoteDenom, receiver: depositAddress, + sender: DUMMY_SENDER_ADDRESS, }; return JSON.stringify(ics20); diff --git a/packages/pegasus/test/test-peg.js b/packages/pegasus/test/test-peg.js index 639cfb2c582..19b7999168b 100644 --- a/packages/pegasus/test/test-peg.js +++ b/packages/pegasus/test/test-peg.js @@ -104,6 +104,7 @@ async function testRemotePeg(t) { amount: '100000000000000000001', denom: 'uatom', receiver: 'markaccount', + sender: 'pegasus', }, 'expected transfer packet', );