@agoric/deploy-script-support 0.10.4-dev-68817f5.0.68817f5 → 0.10.4-dev-aa56b38.0.aa56b38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/deploy-script-support",
3
- "version": "0.10.4-dev-68817f5.0.68817f5",
3
+ "version": "0.10.4-dev-aa56b38.0.aa56b38",
4
4
  "description": "Helpers and other support for writing deploy scripts",
5
5
  "type": "module",
6
6
  "main": "src/helpers.js",
@@ -34,14 +34,14 @@
34
34
  },
35
35
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
36
36
  "dependencies": {
37
- "@agoric/ertp": "0.16.3-dev-68817f5.0.68817f5",
38
- "@agoric/import-manager": "0.3.12-dev-68817f5.0.68817f5",
39
- "@agoric/internal": "0.3.3-dev-68817f5.0.68817f5",
40
- "@agoric/notifier": "0.6.3-dev-68817f5.0.68817f5",
41
- "@agoric/pola-io": "0.1.1-dev-68817f5.0.68817f5",
42
- "@agoric/store": "0.9.3-dev-68817f5.0.68817f5",
43
- "@agoric/time": "0.3.3-dev-68817f5.0.68817f5",
44
- "@agoric/zoe": "0.26.3-dev-68817f5.0.68817f5",
37
+ "@agoric/ertp": "0.16.3-dev-aa56b38.0.aa56b38",
38
+ "@agoric/import-manager": "0.3.12-dev-aa56b38.0.aa56b38",
39
+ "@agoric/internal": "0.3.3-dev-aa56b38.0.aa56b38",
40
+ "@agoric/notifier": "0.6.3-dev-aa56b38.0.aa56b38",
41
+ "@agoric/pola-io": "0.1.1-dev-aa56b38.0.aa56b38",
42
+ "@agoric/store": "0.9.3-dev-aa56b38.0.aa56b38",
43
+ "@agoric/time": "0.3.3-dev-aa56b38.0.aa56b38",
44
+ "@agoric/zoe": "0.26.3-dev-aa56b38.0.aa56b38",
45
45
  "@endo/base64": "^1.0.12",
46
46
  "@endo/bundle-source": "^4.1.2",
47
47
  "@endo/errors": "^1.2.13",
@@ -52,7 +52,7 @@
52
52
  "@endo/zip": "^1.0.11"
53
53
  },
54
54
  "devDependencies": {
55
- "@agoric/vats": "0.15.2-dev-68817f5.0.68817f5",
55
+ "@agoric/vats": "0.15.2-dev-aa56b38.0.aa56b38",
56
56
  "@endo/init": "^1.1.12",
57
57
  "ava": "^5.3.0",
58
58
  "import-meta-resolve": "^4.1.0"
@@ -75,5 +75,5 @@
75
75
  "typeCoverage": {
76
76
  "atLeast": 83.14
77
77
  },
78
- "gitHead": "68817f5dee5a74c1a68552af7787b5ee91f0e647"
78
+ "gitHead": "aa56b38413f86f364c891fb00bc67a7ca1b64bc0"
79
79
  }
@@ -13,7 +13,11 @@
13
13
  import { E } from '@endo/far';
14
14
  import url from 'url';
15
15
 
16
- /** @typedef {ReturnType<typeof import('./endo-pieces-contract.js').start>['publicFacet']} BundleMaker */
16
+ /**
17
+ * @import {start} from './endo-pieces-contract.js';
18
+ */
19
+
20
+ /** @typedef {ReturnType<typeof start>['publicFacet']} BundleMaker */
17
21
  /** @typedef {ReturnType<BundleMaker['makeBundler']>} Bundler */
18
22
 
19
23
  export const makeGetBundlerMaker =
package/src/offer.js CHANGED
@@ -3,6 +3,7 @@ import { assert } from '@endo/errors';
3
3
  import { E } from '@endo/far';
4
4
  // Avoid pulling in too many dependencies like notifiers
5
5
  import { AmountMath } from '@agoric/ertp/src/amountMath.js';
6
+ import { objectMap } from '@agoric/internal';
6
7
 
7
8
  /**
8
9
  * @import {Petname} from '@agoric/deploy-script-support/src/externalTypes.js';
@@ -53,17 +54,22 @@ export const makeOfferAndFindInvitationAmount = (
53
54
  return AmountMath.make(invitationAmount.brand, value);
54
55
  };
55
56
 
57
+ /**
58
+ * @param {Partial<ProposalRecord>} proposal
59
+ * @param {Record<Keyword, Petname>} paymentsWithPursePetnames
60
+ * @returns {Record<Keyword, ERef<Payment>>} payments
61
+ */
56
62
  const withdrawPayments = (proposal, paymentsWithPursePetnames) => {
57
- return Object.fromEntries(
58
- Object.entries(paymentsWithPursePetnames).map(
59
- ([keyword, pursePetname]) => {
60
- const purse = E(walletAdmin).getPurse(pursePetname);
61
- const amountToWithdraw = proposal.give[keyword];
62
- const paymentP = E(purse).withdraw(amountToWithdraw);
63
- return [keyword, paymentP];
64
- },
65
- ),
66
- );
63
+ return objectMap(paymentsWithPursePetnames, (pursePetname, keyword) => {
64
+ const purse = E(walletAdmin).getPurse(pursePetname);
65
+ assert(
66
+ 'give' in proposal && proposal.give,
67
+ `proposal.give is required to withdraw`,
68
+ );
69
+ const amountToWithdraw = proposal.give[keyword];
70
+ const paymentP = E(purse).withdraw(amountToWithdraw);
71
+ return paymentP;
72
+ });
67
73
  };
68
74
 
69
75
  const withdrawInvitation = async invitationDetails => {
@@ -1,4 +1,5 @@
1
1
  // @ts-check
2
+ import { objectMap } from '@agoric/internal';
2
3
  import { assert } from '@endo/errors';
3
4
  import { E, passStyleOf } from '@endo/far';
4
5
 
@@ -36,13 +37,8 @@ export const makeStartInstance = (
36
37
  zoeInvitationPurse,
37
38
  ) => {
38
39
  const makeIssuerKeywordRecord = issuerPetnameKeywordRecord => {
39
- return Object.fromEntries(
40
- Object.entries(issuerPetnameKeywordRecord).map(
41
- ([keyword, issuerPetname]) => {
42
- const issuerP = E(issuerManager).get(issuerPetname);
43
- return [keyword, issuerP];
44
- },
45
- ),
40
+ return objectMap(issuerPetnameKeywordRecord, issuerPetname =>
41
+ E(issuerManager).get(issuerPetname),
46
42
  );
47
43
  };
48
44