Skip to content

Commit

Permalink
fixup! chore: move namesByAddress to provisioning vat
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed May 2, 2023
1 parent cd9efb7 commit 3e8e09f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 5 additions & 2 deletions packages/smart-wallet/src/walletFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ export const publishDepositFacet = async (
namesByAddressAdmin,
) => {
const { nameAdmin: myAddressNameAdmin } = E.get(
E(namesByAddressAdmin).provideChild(address, address),
E(namesByAddressAdmin).provideChild(
address,
[WalletName.depositFacet],
address,
),
);
await E(myAddressNameAdmin).reserve(WalletName.depositFacet);

return E(myAddressNameAdmin).default(
WalletName.depositFacet,
Expand Down
11 changes: 8 additions & 3 deletions packages/vats/src/core/basic-behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { E, Far } from '@endo/far';
import { AssetKind, makeIssuerKit } from '@agoric/ertp';
import { makeScalarMapStore } from '@agoric/store';
import { provideLazy } from '@agoric/store/src/stores/store-utils.js';
import { BridgeId, VBankAccount } from '@agoric/internal';
import { BridgeId, VBankAccount, WalletName } from '@agoric/internal';
import { feeIssuerConfig } from './utils.js';
import { Stable, Stake } from '../tokens.js';
import { PowerFlags } from '../walletFlags.js';
Expand Down Expand Up @@ -208,9 +208,14 @@ export const makeAddressNameHubs = async ({
produce.namesByAddressAdmin.resolve(namesByAddressAdmin);

const perAddress = address => {
const { myAddressNameAdmin } = E.get(
E(namesByAddressAdmin).provideChild(address, address),
const { nameAdmin: myAddressNameAdmin } = E.get(
E(namesByAddressAdmin).provideChild(
address,
[WalletName.depositFacet],
address,
),
);

return { agoricNames, namesByAddress, myAddressNameAdmin };
};

Expand Down

0 comments on commit 3e8e09f

Please sign in to comment.