Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(unconfined flag): #8

Open
wants to merge 2 commits into
base: dc-ag-trade
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/ag-trade/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ fetch-plug-in: $(PET)/cosmos-fetch
clock-plug-in: $(PET)/clock

$(PET)/client-maker: src/smartWallet.js
@echo ++ start smart wallet caplet -- TODO: should not need UNSAFE
endo make --UNSAFE src/smartWallet.js -n client-maker
@echo ++ start smart wallet caplet -- TODO: should not need UNCONFINED
endo make --UNCONFINED src/smartWallet.js -n client-maker

$(PET)/cosmos-fetch: src/cosmosFetch.js
@echo ++ install cosmos fetch plugin
endo make --UNSAFE src/cosmosFetch.js -n cosmos-fetch
endo make --UNCONFINED src/cosmosFetch.js -n cosmos-fetch

# WIP: factor clock out of fresh-id
$(PET)/clock:
endo make --UNSAFE src/clock.js -n clock
endo make --UNCONFINED src/clock.js -n clock

clean:
endo reset
10 changes: 5 additions & 5 deletions packages/ag-trade/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ services:

<details><summary>cosmos-fetch plug-in for simple network access</summary>

We run `src/cosmosFetch.js` unconfined (`--UNSAFE`) to make an object with the following interface:
We run `src/cosmosFetch.js` unconfined (`--UNCONFINED`) to make an object with the following interface:

```ts
interface CosmosFetch {
Expand All @@ -85,7 +85,7 @@ interface RpcClient {
```
$ make fetch-plug-in
++ install cosmos fetch plugin
endo make --UNSAFE src/cosmosFetch.js -n cosmos-fetch
endo make --UNCONFINED src/cosmosFetch.js -n cosmos-fetch
Object [Alleged: CosmosFetch] {}
```

Expand Down Expand Up @@ -181,7 +181,7 @@ $ endo eval "JSON.parse(JSON.parse(that.value).values[0])" that:brand-data
The `smartWallet.js` client factory module supports these unmarshalling conventions.

```
endo make --UNSAFE src/smartWallet.js -n client-maker
endo make --UNCONFINED src/smartWallet.js -n client-maker
Object [Alleged: SmartWalletFactory] {}
```

Expand Down Expand Up @@ -257,7 +257,7 @@ endo eval "E(wf).makeWalletKit('survey thank ...', local.rpc, local.lcd)" \

_The client factory should be an ordinary confined module, but
due to difficulties with getting protobuf libraries to run confined,
we use `--UNSAFE`. The signing part than handles private keys
we use `--UNCONFINED`. The signing part than handles private keys
should be in a separate worker from the offer / query construction code,
but due to lack of byte-string support in `@endo/marshal`, we keep them together._

Expand All @@ -274,7 +274,7 @@ that runs unconfined and put the rest of the logic in a normal confined module.

```
$ make clock-plug-in
endo make --UNSAFE src/clock.js -n clock
endo make --UNCONFINED src/clock.js -n clock
Object [Alleged: Clock] {}
```

Expand Down
2 changes: 1 addition & 1 deletion packages/ag-trade/src/clock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** needs --UNSAFE for access to Date.now() */
/** needs --UNCONFINED for access to Date.now() */
import { Far } from '@endo/far';

export const make = () =>
Expand Down
2 changes: 1 addition & 1 deletion packages/ag-trade/src/net-local.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Usage:
* $ endo make --UNSAFE src/cosmosFetch.js -n cosmos-fetch
* $ endo make --UNCONFINED src/cosmosFetch.js -n cosmos-fetch
* Object [Alleged: CosmosFetch] {}
* $ endo make test/net-local.js -n local -p cosmos-fetch
* { lcd: Object [Alleged: LCD] {}, rpc: Object [Alleged: RpcClient] {} }
Expand Down