Skip to content

Commit

Permalink
feat(loadgen): handle AMM method renames (#84)
Browse files Browse the repository at this point in the history
Handles the upcoming rename in Agoric/agoric-sdk#5377
  • Loading branch information
mhofman authored May 24, 2022
1 parent 7c8f64a commit 1a9c9c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions loadgen/contract/agent-prepare-loadgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ export default async function startAgent({
brand: secondaryBrandP,
purse: secondaryPurse,
} = E.get(tokenKit);
const liquidityIssuer = E(amm).addPool(
secondaryIssuer,
issuerPetnames[tokenBrandPetname],
const liquidityIssuer = fallback(
E(amm).addIssuer(secondaryIssuer, issuerPetnames[tokenBrandPetname]),
E(amm).addPool(secondaryIssuer, issuerPetnames[tokenBrandPetname]),
);
const liquidityBrandP = E(liquidityIssuer).getBrand();

Expand Down Expand Up @@ -312,7 +312,7 @@ export default async function startAgent({
});

const addLiquiditySeat = E(zoe).offer(
E(amm).makeAddLiquidityInvitation(),
fallback(E(amm).addPoolInvitation(), E(amm).makeAddLiquidityInvitation()),
proposal,
harden({
Secondary: secondaryAMMPayment,
Expand Down
4 changes: 3 additions & 1 deletion loadgen/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export {};
* XYKAMMPublicFacet,
* 'getPriceAuthorities' | 'makeSwapInInvitation' | 'makeAddLiquidityInvitation'
* > & {
* addPool: (issuer: ERef<Issuer>, keyword: Keyword) => Promise<Issuer>
* addPool?: (issuer: ERef<Issuer>, keyword: Keyword) => Promise<Issuer>;
* addIssuer?: (issuer: ERef<Issuer>, keyword: Keyword) => Promise<Issuer>;
* addPoolInvitation?: () => Promise<Invitation>;
* } } AttenuatedAMM
*/

Expand Down

0 comments on commit 1a9c9c2

Please sign in to comment.