Skip to content

Commit

Permalink
SQUASH: misc
Browse files Browse the repository at this point in the history
 - copy-pasta in game1 script doc
 - overridable $SDK docs
 - chainStorage type doc: cite 8247
 - move upgrading closer to use
 - no need to avoid AmountMath
  • Loading branch information
dckc committed Aug 24, 2023
1 parent d1eecdd commit ff26fa1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file Proposal Builder: Upgrade walletFactory
* @file Proposal Builder: Start Game with non-vbank Place NFT asset
*
* Usage:
* agoric run build-game1-start.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# Dockerfile in upgrade-test sets:
# WORKDIR /usr/src/agoric-sdk/
# Overriding it during development has occasionally been useful.
SDK=${SDK:-/usr/src/agoric-sdk}
. $SDK/upgrade-test-scripts/env_setup.sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ harden(upgradeWalletFactory);
export const publishAgoricBrandsDisplayInfo = async ({
consume: { agoricNames, board, chainStorage },
}) => {
// @ts-expect-error chainStorage is only falsy in testing
// chainStorage type includes undefined, which doesn't apply here.
// @ts-expect-error UNTIL https://github.com/Agoric/agoric-sdk/issues/8247
const boardAux = E(chainStorage).makeChildNode(BOARD_AUX);
const publishBrandInfo = async brand => {
const [id, displayInfo, allegedName] = await Promise.all([
Expand Down
2 changes: 1 addition & 1 deletion packages/smart-wallet/src/walletFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ export const makeAssetRegistry = assetPublisher => {
*/
export const prepare = async (zcf, privateArgs, baggage) => {
const { agoricNames, board, assetPublisher } = zcf.getTerms();
const upgrading = baggage.has('walletsByAddress');

const zoe = zcf.getZoeService();
const { storageNode, walletBridgeManager, walletReviver } = privateArgs;
Expand Down Expand Up @@ -293,6 +292,7 @@ export const prepare = async (zcf, privateArgs, baggage) => {
if (walletBridgeManager) {
// NB: may not be in service when creatorFacet is used, or ever
// It can't be awaited because that fails vat restart
const upgrading = baggage.has('walletsByAddress');
if (upgrading) {
void E(walletBridgeManager).setHandler(handleWalletAction);
} else {
Expand Down
6 changes: 2 additions & 4 deletions packages/smart-wallet/test/start-game1-proposal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-check
import { E } from '@endo/far';
import { makeMarshal } from '@endo/marshal';
import { AmountMath } from '@agoric/ertp/src/amountMath.js';

console.warn('start-game1-proposal.js module evaluating');

Expand All @@ -11,9 +12,6 @@ const BOARD_AUX = 'boardAux';

const marshalData = makeMarshal(_val => Fail`data only`);

// avoid importing all of ERTP
const makeAmount = (brand, value) => harden({ brand, value });

const IST_UNIT = 1_000_000n;
const CENT = IST_UNIT / 100n;

Expand Down Expand Up @@ -66,7 +64,7 @@ export const startGameContract = async permittedPowers => {
brand: istBrand,
};
// NOTE: joinPrice could be configurable
const terms = { joinPrice: makeAmount(ist.brand, 25n * CENT) };
const terms = { joinPrice: AmountMath.make(ist.brand, 25n * CENT) };

// agoricNames gets updated each time; the promise space only once XXXXXXX
const installation = await E(agoricNames).lookup('installation', 'game1');
Expand Down

0 comments on commit ff26fa1

Please sign in to comment.