Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
fix: prune call to obsolete getFeePurse (#45)
Browse files Browse the repository at this point in the history
* prune call to obsolete getFeePurse

`getFeePurse` is not in the agoric sdk since Agoric/agoric-sdk#4225

* style: prune unused names
  • Loading branch information
dckc authored May 14, 2022
1 parent d97d195 commit 30d48e0
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions contract/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import '@agoric/zoe/exported.js';
import { E } from '@endo/eventual-send';
import bundleSource from '@endo/bundle-source';

import { pursePetnames } from './petnames.js';

// This script takes our contract code, installs it on Zoe, and makes
// the installation publicly available. Our backend API script will
// use this installation in a later step.
Expand Down Expand Up @@ -57,22 +55,6 @@ const installBundle = async (pathResolve, zoe, board) => {
return { CONTRACT_NAME, INSTALLATION_BOARD_ID };
};

/**
* @param {ERef<Object>} wallet
* @param {ERef<Object>} faucet
*/
const sendDeposit = async (wallet, faucet) => {
// We must first fund our "feePurse", the purse that we will use to
// pay for our interactions with Zoe.
const RUNPurse = E(wallet).getPurse(pursePetnames.RUN);
const runAmount = await E(RUNPurse).getCurrentAmount();
const feePurse = E(faucet).getFeePurse();
const feePayment = await E(E(wallet).getPurse(pursePetnames.RUN)).withdraw(
runAmount,
);
await E(feePurse).deposit(feePayment);
};

/**
* @param {Promise<{zoe: ERef<ZoeService>, board: ERef<Board>, agoricNames:
* Object, wallet: ERef<Object>, faucet: ERef<Object>}>} homePromise
Expand Down Expand Up @@ -102,15 +84,8 @@ const deployContract = async (homePromise, { pathResolve }) => {
// have a one-to-one bidirectional mapping. If a value is added a
// second time, the original id is just returned.
board,

// The wallet holds and manages assets for the user.
wallet,

// The faucet provides an initial amount of RUN for the user to use.
faucet,
} = home;

await sendDeposit(wallet, faucet);
const { CONTRACT_NAME, INSTALLATION_BOARD_ID } = await installBundle(
pathResolve,
zoe,
Expand Down

0 comments on commit 30d48e0

Please sign in to comment.