Skip to content

Commit

Permalink
fix(lint): run linter
Browse files Browse the repository at this point in the history
  • Loading branch information
mujahidkay committed Sep 26, 2024
1 parent 2fa4f84 commit 7dabc1b
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 114 deletions.
76 changes: 39 additions & 37 deletions main/guides/governance/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ to [publish values of the parameters to vstorage](../zoe/pub-to-storage).
import { handleParamGovernance } from '@agoric/governance/src/contractHelper.js';

export const start = async (zcf, privateArgs, baggage) => {
...
// ...
const { publicMixin, makeDurableGovernorFacet, params } =
await handleParamGovernance(
zcf,
privateArgs.initialPoserInvitation,
paramTypes,
privateArgs.storageNode,
privateArgs.marshaller,
privateArgs.marshaller
);
...
}
// ...
};
```

We get back
Expand All @@ -73,22 +73,22 @@ We get back

```js
export const start = async (zcf, privateArgs, baggage) => {
...
// ...
const publicFacet = Far('Public', {
makeFirstInvitation,
...publicMixin,
...publicMixin
});
const limitedCreatorFacet = Far('Creator', {
makeCollectFeesInvitation() {
return makeCollectFeesInvitation(zcf, feeSeat, feeBrand, 'Fee');
},
}
});
const { governorFacet } = makeDurableGovernorFacet(
baggage,
limitedCreatorFacet,
limitedCreatorFacet
);
return harden({ publicFacet, creatorFacet: governorFacet });
}
};
```

## Starting a Governed Contract via its Governor
Expand Down Expand Up @@ -121,9 +121,9 @@ using `v0-accept-charter` to identify this offer:

```js
test.serial('Voter0 accepts charter, committee invitations', async t => {
...
// ...
await victor.acceptCharterInvitation('v0-accept-charter');
...
// ...
});
```

Expand All @@ -136,8 +136,8 @@ referring back to `v0-accept-charter` as `charterAcceptOfferId`:

```js
const makeVoter = (t, wallet, wellKnown) => {
...
const putQuestion = async (offerId, params, deadline) => {
// ...
const putQuestion = async (offerId, params, deadline) => {
const instance = await wellKnown.instance[contractName]; // swaparoo instance handle
const path = { paramPath: { key: 'governedParams' } };

Expand All @@ -146,32 +146,32 @@ const makeVoter = (t, wallet, wellKnown) => {

/** @type {import('@agoric/smart-wallet/src/offers.js').OfferSpec} */
const offer = {
id: offerId,
invitationSpec: {
source: 'continuing',
previousOffer: NonNullish(charterAcceptOfferId),
invitationMakerName: 'VoteOnParamChange',
},
offerArgs,
proposal: {},
id: offerId,
invitationSpec: {
source: 'continuing',
previousOffer: NonNullish(charterAcceptOfferId),
invitationMakerName: 'VoteOnParamChange'
},
offerArgs,
proposal: {}
};
return doOffer(offer);
};
};
};
```

The `offerArgs` include a deadline and details of the params to change:

```js
test.serial('vote to change swap fee', async t => {
...
// ...
const targetFee = IST(50n, 100n); // 50 / 100 = 0.5 IST
const changes = { Fee: targetFee };
...
// ...
const deadline = BigInt(new Date(2024, 6, 1, 9, 10).valueOf() / 1000);
const result = await victor.putQuestion('proposeToSetFee', changes, deadline);
t.log('question is posed', result);
...
// ...
});
```

Expand All @@ -182,9 +182,9 @@ using `v0-join-committee` to identify this offer:

```js
test.serial('Voter0 accepts charter, committee invitations', async t => {
...
// ...
await victor.acceptCommitteeInvitation('v0-join-committee', 0);
...
// ...
});
```

Expand All @@ -193,7 +193,7 @@ referring back to `v0-join-committee` as `committeeOfferId`:

```js
const makeVoter = (t, wallet, wellKnown) => {
...
// ...
const vote = async (offerId, details, position) => {
const chosenPositions = [details.positions[position]];

Expand All @@ -204,13 +204,13 @@ const makeVoter = (t, wallet, wellKnown) => {
source: 'continuing',
previousOffer: NonNullish(committeeOfferId),
invitationMakerName: 'makeVoteInvitation',
invitationArgs: harden([chosenPositions, details.questionHandle]),
invitationArgs: harden([chosenPositions, details.questionHandle])
},
proposal: {},
proposal: {}
};
return doOffer(offer);
};
...
// ...
};
```

Expand All @@ -219,12 +219,14 @@ published to vstorage.

```js
test.serial('vote to change swap fee', async t => {
...
const details = await vstorage.get(`published.committee.swaparoo.latestQuestion`);
// ...
const details = await vstorage.get(
`published.committee.swaparoo.latestQuestion`
);
t.is(details.electionType, 'param_change');
const voteResult = await victor.vote('voteToSetFee', details, 0);
t.log('victor voted:', voteResult);
...
// ...
});
```

Expand All @@ -233,11 +235,11 @@ carried. It instructs the swaparoo contract to change the fee.

```js
test.serial('vote to change swap fee', async t => {
...
// ...
const swapPub = E(zoe).getPublicFacet(
swapPowers.instance.consume[contractName],
swapPowers.instance.consume[contractName]
);
...
// ...
const after = await E(swapPub).getAmount('Fee');
t.deepEqual(after, targetFee);
});
Expand Down
22 changes: 11 additions & 11 deletions main/guides/orchestration/getting-started/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,31 @@ The [`Orchestrator`](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestrati

Retrieves the chain information and provides access to chain-specific methods. See [getChain](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#getChain).

```javascript
```js
const chain = await orchestrator.getChain('chainName');
```

### makeLocalAccount

Creates a new `LocalChainAccount`. See [makeLocalAccount](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#makeLocalAccount).

```javascript
```js
const localAccount = await orchestrator.makeLocalAccount();
```

### getBrandInfo

Returns information about a `denom`, including the equivalent local Brand, the chain where the denom is held, and the chain that issues the corresponding asset. See [getBrandInfo](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#getBrandInfo).

```javascript
```js
const brandInfo = orchestrator.getBrandInfo('denom');
```

### asAmount

Converts a denom amount to an `Amount` with a brand. See [asAmount](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#asAmount).

```javascript
```js
const amount = orchestrator.asAmount({ denom: 'uatom', value: 1000n });
```

Expand All @@ -48,54 +48,54 @@ An [`OrchestrationAccount`](https://agoric-sdk.pages.dev/types/_agoric_orchestra

Retrieves the address of the account on the remote chain. See [getAddress](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.OrchestrationAccountI#getAddress).

```javascript
```js
const address = await orchestrationAccount.getAddress();
```

### getBalances

Returns an array of amounts for every balance in the account. See [getBalances](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.OrchestrationAccountI#getBalances).

```javascript
```js
const balances = await orchestrationAccount.getBalances();
```

### getBalance

Retrieves the balance of a specific denom for the account. See [getBalance](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.OrchestrationAccountI#getBalance).

```javascript
```js
const balance = await orchestrationAccount.getBalance('uatom');
```

### send

Transfers an amount to another account on the same chain. The promise settles when the transfer is complete. See [send](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.OrchestrationAccountI#send).

```javascript
```js
await orchestrationAccount.send(receiverAddress, amount);
```

### transfer

Transfers an amount to another account, typically on another chain. The promise settles when the transfer is complete. See [transfer](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.OrchestrationAccountI#transfer).

```javascript
```js
await orchestrationAccount.transfer(amount, destinationAddress);
```

### transferSteps

Transfers an amount to another account in multiple steps. The promise settles when the entire path of the transfer is complete. See [transferSteps](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.OrchestrationAccountI#transferSteps).

```javascript
```js
await orchestrationAccount.transferSteps(amount, transferMsg);
```

### deposit

Deposits payment from Zoe to the account. For remote accounts, an IBC Transfer will be executed to transfer funds there.

```javascript
```js
await orchestrationAccount.deposit(payment);
```
Loading

0 comments on commit 7dabc1b

Please sign in to comment.