Skip to content

Commit

Permalink
move sender propery bag down a layer to ics packet
Browse files Browse the repository at this point in the history
  • Loading branch information
iomekam committed Nov 9, 2023
1 parent a3129ed commit e59d677
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/pegasus/src/ics20.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const makeICS20TransferPacket = async ({
remoteDenom,
depositAddress,
memo,
opts,
opts: { sender = DEFAULT_SENDER_ADDRESS },
}) => {
// We're using Nat as a dynamic check for overflow.
const stringValue = String(Nat(value));
Expand All @@ -100,7 +100,7 @@ export const makeICS20TransferPacket = async ({
amount: stringValue,
denom: remoteDenom,
receiver: depositAddress,
sender: opts.sender,
sender,
memo,
};

Expand Down
13 changes: 4 additions & 9 deletions packages/pegasus/src/pegasus.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import '@agoric/zoe/exported.js';

import '../exported.js';
import { IBCSourceTraceDenomTransformer } from './ibc-trace.js';
import { DEFAULT_SENDER_ADDRESS, ICS20TransferProtocol } from './ics20.js';
import { ICS20TransferProtocol } from './ics20.js';
import { makeCourierMaker, getCourierPK } from './courier.js';

const DEFAULT_DENOM_TRANSFORMER = IBCSourceTraceDenomTransformer;
Expand Down Expand Up @@ -113,7 +113,7 @@ const makePegasus = (zcf, board, namesByAddress) => {
transferProtocol,
denomTransformer,
}) => {
let checkAbort = () => {};
let checkAbort = () => { };

Check warning on line 116 in packages/pegasus/src/pegasus.js

View workflow job for this annotation

GitHub Actions / lint-rest

Delete `·`

/** @type {Set<Peg>} */
const pegs = new Set();
Expand Down Expand Up @@ -143,7 +143,7 @@ const makePegasus = (zcf, board, namesByAddress) => {
// If rejected, the rejection is returned to our caller, so we have
// handled it correctly and that flow doesn't need to trigger an
// additional UnhandledRejectionWarning in our vat.
promise.catch(() => {});
promise.catch(() => { });

Check warning on line 146 in packages/pegasus/src/pegasus.js

View workflow job for this annotation

GitHub Actions / lint-rest

Delete `·`
reject(assert.error(X`${receiveDenom} is temporarily unavailable`));

// Allow new transfers to be initiated after this rejection.
Expand Down Expand Up @@ -460,12 +460,7 @@ const makePegasus = (zcf, board, namesByAddress) => {
* @param {SenderOptions} [opts] additional sender options
* @returns {Promise<Invitation>} to transfer, make an offer of { give: { Transfer: pegAmount } } to this invitation
*/
async makeInvitationToTransfer(
pegP,
depositAddress,
memo = '',
opts = { sender: DEFAULT_SENDER_ADDRESS },
) {
async makeInvitationToTransfer(pegP, depositAddress, memo = '', opts = {}) {
// Verify the peg.
const peg = await pegP;
const denomState = pegToDenomState.get(peg);
Expand Down
2 changes: 1 addition & 1 deletion packages/pegasus/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,5 @@

/**
* @typedef {object} SenderOptions
* @property {string} sender the sender to attach to ics transfer packet
* @property {string} [sender] the sender address attached to the packet to receive any refund
*/

0 comments on commit e59d677

Please sign in to comment.