Skip to content

Commit 5a72a8c

Browse files
committed
chore: prettier's suggestions
1 parent f47fd29 commit 5a72a8c

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

main/guides/zoe/contract-details.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ need. This means putting relevant state in
1717
that will be accessible to users have an identity that can be maintained as the behavior changes with contract
1818
upgrades.
1919

20-
We use zone.exo(), zone.exoClass(), and zone.exoClassKit() to define durable objects.
20+
We use zone.exo(), zone.exoClass(), and zone.exoClassKit() to define durable objects.
2121

2222
[Zone](http://localhost:5173/glossary/#zone) provides an interface for defining objects and classes that
2323
supports both ephemeral objects (allocated on the heap), and durable objects that can persist and that
@@ -50,7 +50,7 @@ object. Notice that `exo()` doesn't take `init` as a parameter; this limits the
5050
referencing values defined in the enclosing scope. Classes can also refer to variables in their defining
5151
scope, but any values inherited from the scope will be accessible to all instances of that type. The `init`
5252
function's parameters become the parameters of the maker function returned by `exoClass()` and
53-
`exoClassKit()`. `init`'s return value is the state that will be preserved by SwingSet for each
53+
`exoClassKit()`. `init`'s return value is the state that will be preserved by SwingSet for each
5454
object. `exo()` doesn't have an init parameter, so it creates and returns the singleton immediately rather
5555
than returning a maker.
5656

@@ -98,7 +98,7 @@ M.interface('name', {
9898
`M.call()` verifies that all parameters match the guard before passing them through to the
9999
method. `M.callWhen(M.await(paramsBGuard))` awaits the resolution of the parameter, and then verifies that the
100100
result matches before invoking the method. When a guard is written this latter way, the method doesn't have to
101-
be `async`. In both cases, the method doesn't have to check for compliance with the guard.
101+
be `async`. In both cases, the method doesn't have to check for compliance with the guard.
102102

103103
[Shapes can specify](https://endojs.github.io/endo/interfaces/_endo_patterns.PatternMatchers.html) simple
104104
types like `M.string()`, `M.remotable()`, and `M.number()`, as well as complex structures of records and
@@ -119,4 +119,3 @@ the state values.
119119
`finish()`, if provided, is called after instances have been created but before they are returned to the
120120
caller. They can be used to send an initial state update, or to complete initialization which couldn't be done
121121
in `init`. `finish` has access to state and facets if needed.
122-

main/guides/zoe/contract-upgrade.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The return value when starting a contract includes a capability that conveys the
44
the contract instance. A call to
55
[E(zoe).startInstance(...)](/reference/zoe-api/zoe.md#e-zoe-startinstance-installation-issuerkeywordrecord-terms-privateargs)
66
returns a record of several objects that carry different powers. The `publicFacet` and
7-
`creatorFacet` are defined by the contract. The
7+
`creatorFacet` are defined by the contract. The
88
[`adminFacet`](/reference/zoe-api/zoe.html#adminFacet) is defined by Zoe and includes methods to
99
upgrade the contract.
1010

@@ -85,7 +85,6 @@ The 3rd argument, `baggage`, of the `start` function is a `MapStore` that is sav
8585
across restarts of the contract. It provides a way to preserve state and behavior of objects between
8686
incarnations in a way that also maintains the identity of objects as seen from other [vats](/glossary/#vat).
8787
88-
8988
```js
9089
let rooms;
9190
if (!baggage.has('rooms')) {
@@ -104,7 +103,7 @@ The `provide` function supports a concise idiom for this get-or-create pattern:
104103
import { provide } from '@agoric/vat-data';
105104
106105
const rooms = provide(baggage, 'rooms', () =>
107-
makeScalarBigMapStore('rooms', { durable: true })
106+
makeScalarBigMapStore('rooms', { durable: true }),
108107
);
109108
```
110109
@@ -153,18 +152,18 @@ const makeRoom = zone.exoClass('Room', RoomI, id => ({ id, value: 0 }), {
153152
// ...
154153
clear(delta) {
155154
this.state.value = 0;
156-
}
155+
},
157156
});
158157
```
159158

160-
The interface guard also needs updating. <small>_[The Durable
159+
The interface guard also needs updating. <small>_[The Durable
161160
objects](./contract-details.md#guards-defensive-methods) section has more on interface
162161
guards._</small>
163162

164163
```js
165164
const RoomI = M.interface('Room', {
166165
// ...
167-
clear: M.call().returns()
166+
clear: M.call().returns(),
168167
});
169168
```
170169

@@ -206,7 +205,7 @@ const publicFacet = zone.exo(
206205
'StakeAtom',
207206
M.interface('StakeAtomI', {
208207
makeAccount: M.callWhen().returns(M.remotable('ChainAccount')),
209-
makeAccountInvitationMaker: M.callWhen().returns(InvitationShape)
208+
makeAccountInvitationMaker: M.callWhen().returns(InvitationShape),
210209
}),
211210
{
212211
async makeAccount() {
@@ -221,8 +220,8 @@ const publicFacet = zone.exo(
221220
const holder = await makeAccountKit();
222221
return holder.asContinuingOffer();
223222
}, 'wantStakingAccount');
224-
}
225-
}
223+
},
224+
},
226225
);
227226
```
228227

@@ -259,13 +258,13 @@ const makeLocalOrchestrationAccountKit = prepareLocalChainAccountKit(
259258
zcf,
260259
privateArgs.timerService,
261260
vowTools,
262-
makeChainHub(privateArgs.agoricNames)
261+
makeChainHub(privateArgs.agoricNames),
263262
);
264263
// ...
265264
const makeCosmosOrchestrationAccount = prepareCosmosOrchestrationAccount(
266265
zone,
267266
makeRecorderKit,
268267
vowTools,
269-
zcf
268+
zcf,
270269
);
271270
```

main/reference/zoe-api/zoe.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ and the values are the **Brands** for particular **[Issuers](/reference/ertp-api
3434
// Record example
3535
const brandKeywordRecord = {
3636
FirstCurrency: quatloosBrand,
37-
SecondCurrency: moolaBrand
37+
SecondCurrency: moolaBrand,
3838
// etc.
3939
};
4040
```
@@ -58,7 +58,7 @@ and the values are **Issuers**.
5858
// Record example
5959
const issuerKeywordRecord = {
6060
FirstCurrency: quatloosIssuer,
61-
SecondCurrency: moolaIssuer
61+
SecondCurrency: moolaIssuer,
6262
};
6363
```
6464

@@ -274,16 +274,19 @@ It returns a **Promise** for a **StartInstanceResult** object. The object consis
274274
The **adminFacet** has four methods:
275275

276276
- **getVatShutdownPromise()**
277+
277278
- Returns a promise that resolves to reason (the value passed to **fail(reason)**) or
278279
completion (the value passed to **exit(completion)**) when this newly started instance terminates.
279280

280281
- **restartContract(newPrivateArgs?)**
282+
281283
- **newPrivateArgs**: **any** - Optional
282284
- returns VatUpgradeResults (a record with one field: incarnationNumber)
283285

284286
Restarts the contract without changing the contract bundle
285287

286288
- **upgradeContract(contractBundleId, newPrivateArgs)**
289+
287290
- **contractBundleId**: **string**
288291
- **newPrivateArgs**: **any** - Optional
289292

@@ -295,6 +298,7 @@ The **adminFacet** has four methods:
295298
process of upgrading contracts.
296299

297300
- **terminateContract(reason)**
301+
298302
- **reason**: **Error**
299303

300304
terminates the contract. `reason` will be provided as the failure reason.
@@ -326,11 +330,11 @@ represented as a **Payment**.
326330
```js
327331
const issuerKeywordRecord = {
328332
Asset: moolaIssuer,
329-
Price: quatlooIssuer
333+
Price: quatlooIssuer,
330334
};
331335
const terms = { numBids: 3 };
332336
const { creatorFacet, publicFacet, creatorInvitation } = await E(
333-
Zoe
337+
Zoe,
334338
).startInstance(installation, issuerKeywordRecord, terms);
335339
```
336340

@@ -362,7 +366,7 @@ it may inspect it and reject it for any reason
362366
const myProposal = harden({
363367
give: { Asset: AmountMath.make(quatloosBrand, 4n) },
364368
want: { Price: AmountMath.make(moolaBrand, 15n) },
365-
exit: { onDemand: null }
369+
exit: { onDemand: null },
366370
});
367371
```
368372

0 commit comments

Comments
 (0)