Skip to content

Commit

Permalink
feat: durable smart wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jan 28, 2023
1 parent ff76df3 commit bee26f9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/smart-wallet/src/smartWallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import {
observeNotifier,
prepareDurablePublishKit,
} from '@agoric/notifier';
import { M, makeScalarMapStore, mustMatch } from '@agoric/store';
import { M, mustMatch } from '@agoric/store';
import {
defineVirtualExoClassKit,
defineDurableExoClassKit,
makeKindHandle,
makeScalarBigMapStore,
} from '@agoric/vat-data';
import { makeEphemeraProvider } from '@agoric/zoe/src/contractSupport/index.js';
Expand Down Expand Up @@ -227,7 +228,7 @@ export const prepareSmartWallet = (baggage, shared) => {
const { walletStorageNode } = unique;
const nonpreciousState = {
// What purses have reported on construction and by getCurrentAmountNotifier updates.
purseBalances: makeScalarMapStore(),
purseBalances: makeScalarBigMapStore('purse balances', { durable: true }),
/** @type {PublishKit<UpdateRecord>} */
updatePublishKit,
/** @type {PublishKit<CurrentWalletRecord>} */
Expand Down Expand Up @@ -274,8 +275,8 @@ export const prepareSmartWallet = (baggage, shared) => {
}),
};

return defineVirtualExoClassKit(
'SmartWallet',
return defineDurableExoClassKit(
makeKindHandle('SmartWallet'),
behaviorGuards,
initState,
{
Expand Down

0 comments on commit bee26f9

Please sign in to comment.