Skip to content

Commit

Permalink
fix(pegasus): use dummy ICS20-1 transfer sender
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Feb 8, 2022
1 parent 265cd22 commit c4056bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/pegasus/src/ics20.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -78,6 +83,7 @@ export const makeICS20TransferPacket = async ({
amount: stringValue,
denom: remoteDenom,
receiver: depositAddress,
sender: DUMMY_SENDER_ADDRESS,
};

return JSON.stringify(ics20);
Expand Down
1 change: 1 addition & 0 deletions packages/pegasus/test/test-peg.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ async function testRemotePeg(t) {
amount: '100000000000000000001',
denom: 'uatom',
receiver: 'markaccount',
sender: 'pegasus',
},
'expected transfer packet',
);
Expand Down

0 comments on commit c4056bc

Please sign in to comment.