Skip to content

Commit

Permalink
BREAKING CHANGE: omit displayInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Apr 10, 2024
1 parent d9ff22c commit f9e0b24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
9 changes: 2 additions & 7 deletions packages/smart-wallet/src/smartWallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,9 @@ const trace = makeTracer('SmrtWlt');
/**
* @typedef {{
* brand: Brand,
* displayInfo: DisplayInfo,
* issuer: Issuer,
* petname: import('./types.js').Petname
* }} BrandDescriptor
* For use by clients to describe brands to users. Includes `displayInfo` to save a remote call.
*/

/**
Expand Down Expand Up @@ -596,15 +594,12 @@ export const prepareSmartWallet = (baggage, shared) => {
}

// Accept the issuer; rely on it in future offers.
const [displayInfo, purse] = await Promise.all([
E(issuer).getDisplayInfo(),
E(issuer).makeEmptyPurse(),
]);
const [purse] = await Promise.all([E(issuer).makeEmptyPurse()]);

// adopt edgeName as petname
// NOTE: for decentralized introductions, qualify edgename by nameHub petname
const petname = edgeName;
const assetInfo = { petname, brand, issuer, purse, displayInfo };
const assetInfo = { petname, brand, issuer, purse };
appendToStoredArray(brandToPurses, brand, assetInfo);
// NOTE: when we decentralize introduction of issuers,
// process queued payments for this brand.
Expand Down
17 changes: 3 additions & 14 deletions packages/smart-wallet/src/walletFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { E } from '@endo/far';
import { prepareSmartWallet } from './smartWallet.js';
import { shape } from './typeGuards.js';

/** @import {BrandDescriptor} from './smartWallet.js'; */

const trace = makeTracer('WltFct');

export const customTermsShape = harden({
Expand Down Expand Up @@ -69,15 +71,6 @@ export const publishDepositFacet = async (
*/
export const makeAssetRegistry = assetPublisher => {
trace('makeAssetRegistry', assetPublisher);
/**
* @typedef {{
* brand: Brand,
* displayInfo: DisplayInfo,
* issuer: Issuer,
* petname: import('./types.js').Petname
* }} BrandDescriptor
* For use by clients to describe brands to users. Includes `displayInfo` to save a remote call.
*/
/** @type {MapStore<Brand, BrandDescriptor>} */
const brandDescriptors = makeScalarMapStore();

Expand All @@ -89,16 +82,12 @@ export const makeAssetRegistry = assetPublisher => {
trace('registering asset', desc.issuerName);
const { brand, issuer: issuerP, issuerName: petname } = desc;
// await issuer identity for use in chainStorage
const [issuer, displayInfo] = await Promise.all([
issuerP,
E(brand).getDisplayInfo(),
]);
const [issuer] = await Promise.all([issuerP]);

brandDescriptors.init(desc.brand, {
brand,
issuer,
petname,
displayInfo,
});
},
},
Expand Down

0 comments on commit f9e0b24

Please sign in to comment.