Skip to content

Commit

Permalink
refactor: consistent example contract filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Sep 20, 2024
1 parent cdbecf8 commit c42ada4
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/boot/test/bootstrapTests/lca.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
import type { TestFn } from 'ava';

import { Fail } from '@endo/errors';
import type { start as stakeBldStart } from '@agoric/orchestration/src/examples/stakeBld.contract.js';
import type { start as stakeBldStart } from '@agoric/orchestration/src/examples/stake-bld.contract.js';
import type { Instance } from '@agoric/zoe/src/zoeService/utils.js';
import { SIMULATED_ERRORS } from '@agoric/vats/tools/fake-bridge.js';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/boot/test/bootstrapTests/orchestration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
import { Fail } from '@endo/errors';
import { documentStorageSchema } from '@agoric/internal/src/storage-test-utils.js';
import type { CosmosValidatorAddress } from '@agoric/orchestration';
import type { start as startStakeIca } from '@agoric/orchestration/src/examples/stakeIca.contract.js';
import type { start as startStakeIca } from '@agoric/orchestration/src/examples/stake-ica.contract.js';
import type { Instance } from '@agoric/zoe/src/zoeService/utils.js';
import type { TestFn } from 'ava';
import { SIMULATED_ERRORS } from '@agoric/vats/tools/fake-bridge.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/builders/scripts/orchestration/init-stakeAtom.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => {
{
installKeys: {
stakeIca: publishRef(
install('@agoric/orchestration/src/examples/stakeIca.contract.js'),
install('@agoric/orchestration/src/examples/stake-ica.contract.js'),
),
},
},
Expand Down
2 changes: 1 addition & 1 deletion packages/builders/scripts/orchestration/init-stakeBld.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) =>
{
installKeys: {
stakeBld: publishRef(
install('@agoric/orchestration/src/examples/stakeBld.contract.js'),
install('@agoric/orchestration/src/examples/stake-bld.contract.js'),
),
},
},
Expand Down
2 changes: 1 addition & 1 deletion packages/builders/scripts/orchestration/init-stakeOsmo.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => {
{
installKeys: {
stakeIca: publishRef(
install('@agoric/orchestration/src/examples/stakeIca.contract.js'),
install('@agoric/orchestration/src/examples/stake-ica.contract.js'),
),
},
},
Expand Down
2 changes: 1 addition & 1 deletion packages/builders/scripts/testing/restart-stakeAtom.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { E } from '@endo/far';
const trace = makeTracer('RestartSA', true);

/**
* @import {start as StartFn} from '@agoric/orchestration/src/examples/stakeIca.contract.js';
* @import {start as StartFn} from '@agoric/orchestration/src/examples/stake-ica.contract.js';
*/

/**
Expand Down
8 changes: 4 additions & 4 deletions packages/orchestration/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ See [`src/examples`](src/examples)
| [basic-flows](/packages/orchestration/src/examples/basic-flows.contract.js) | Ready 🟢 | Creates an account on a remote chain and returns a continuing offer with all platform-provided invitationMakers. | - `CosmosOrchestrationAccount`<br>- `LocalOrchestrationAccount`|
| [query-flows](/packages/orchestration/src/fixtures/query-flows.contract.js) | Ready 🟢 | Test fixture that enables querying account balances on local and remote chains. | - `Chain`<br>- `LocalOrchestrationAccount`<br>- `CosmosOrchestrationAccount`<br>- Interchain Queries |
| [send-anywhere](/packages/orchestration/src/examples/send-anywhere.contract.js) | Ready 🟢 | Allows sending payments (tokens) over IBC to another chain. | - `LocalOrchestrationAccoun`t<br>- `Vtransfer` (IBC Hooks) |
| [stakeBld](/packages/orchestration/src/examples/stakeBld.contract.js) | Ready 🟢 | Returns a `LocalOrchestrationAccount` that can perform staking actions. | - `LocalOrchestrationAccount` | Ready 🟢 |
| [stakeIca](/packages/orchestration/src/examples/stakeIca.contract.js) | Ready 🟢 | Returns a `CosmosOrchestrationAccount` that can perform staking actions. | - `CosmosOrchestrationAccount` | Ready 🟢 |
| [stake-bld](/packages/orchestration/src/examples/stake-bld.contract.js) | Ready 🟢 | Returns a `LocalOrchestrationAccount` that can perform staking actions. | - `LocalOrchestrationAccount` | Ready 🟢 |
| [stake-ica](/packages/orchestration/src/examples/stake-ica.contract.js) | Ready 🟢 | Returns a `CosmosOrchestrationAccount` that can perform staking actions. | - `CosmosOrchestrationAccount` | Ready 🟢 |
| [staking-combinations](/packages/orchestration/src/examples/staking-combinations.contract.js) | Ready 🟢 | Combines actions into a single offer flow and demonstrates writing continuing offers. | - `CosmosOrchestrationAccount`<br>- `CombineInvitationMakers` <br>- Continuing Offers |
| [swap](/packages/orchestration/src/examples/swap.contract.js) | Under Construction 🚧 | Demonstrates asset swapping on an external chain. | - `CosmosOrchestrationAccount`<br>- `ChainHub` |
| [unbond](/packages/orchestration/src/examples/unbond.contract.js) | Under Construction 🚧 | Undelegates tokens for an ICA and liquid stakes them. | - `CosmosOrchestrationAccount` |
Expand All @@ -39,8 +39,8 @@ See [`src/examples`](src/examples)
|---------------|--------------------------|
| [basic-flows](/packages/orchestration/src/examples/basic-flows.contract.js) | - `.send()`, `sendAll()` methods and `Send`, `SendAll` invitations ([#9193](https://github.com/Agoric/agoric-sdk/issues/9193))<br>- `CosmosOrchAccount.transfer()`, `Transfer` invitation ([#9193](https://github.com/Agoric/agoric-sdk/issues/9193)) |
| [send-anywhere](/packages/orchestration/src/examples/send-anywhere.contract.js) | - Multi-hop (PFM) transfers (not implemented in contract) ([#10006](https://github.com/Agoric/agoric-sdk/issues/10006)) |
| [stakeIca](/packages/orchestration/src/examples/stakeIca.contract.js) | - Redelegate<br>- WithdrawRewards (plural) (not implemented)<br>- StakingQueries (not implemented) ([#10016](https://github.com/Agoric/agoric-sdk/issues/10016))<br>- Staking Flows for LocalOrchAccount<br> - Written as async-flow ([#9838](https://github.com/Agoric/agoric-sdk/issues/9838)) |
| [stakeBld](/packages/orchestration/src/examples/stakeBld.contract.js) | - Everything*, created before e2e test suite<br> - Consider folding under generic "stake" contract, once [interfaces are the same](https://github.com/Agoric/agoric-sdk/blob/1976c502bcaac2e7d21f42b30447671a61053236/packages/orchestration/src/exos/local-orchestration-account.js#L487)|
| [stakeIca](/packages/orchestration/src/examples/stake-ica.contract.js) | - Redelegate<br>- WithdrawRewards (plural) (not implemented)<br>- StakingQueries (not implemented) ([#10016](https://github.com/Agoric/agoric-sdk/issues/10016))<br>- Staking Flows for LocalOrchAccount<br> - Written as async-flow ([#9838](https://github.com/Agoric/agoric-sdk/issues/9838)) |
| [stakeBld](/packages/orchestration/src/examples/stake-bld.contract.js) | - Everything*, created before e2e test suite<br> - Consider folding under generic "stake" contract, once [interfaces are the same](https://github.com/Agoric/agoric-sdk/blob/1976c502bcaac2e7d21f42b30447671a61053236/packages/orchestration/src/exos/local-orchestration-account.js#L487)|
| [swap](/packages/orchestration/src/examples/swap.contract.js) | - Everything - contract incomplete ([#8863](https://github.com/Agoric/agoric-sdk/issues/8863)) |
| [unbond](/packages/orchestration/src/examples/unbond.contract.js) | - Everything - contract incomplete ([#9782](https://github.com/Agoric/agoric-sdk/issues/9782)) |
| [staking-combinations](/packages/orchestration/src/examples/staking-combinations.contract.js) | Only tested via [unit tests](/packages/orchestration/src/examples/staking-combinations.contract.js) |
5 changes: 2 additions & 3 deletions packages/orchestration/src/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ This directory contains sample contracts showcasing the Orchestration API. Each

The following contracts are a work in progress as they contain bindings that need to be promptly updated.

- **stakeIca.contract.js**: Interchain account creation for remote staking
- **stake-bld.contract.js**: BLD token staking on Agoric
- **stake-ica.contract.js**: Interchain account creation for remote staking
- **swap.contract.js**: Token swapping and remote staking
- **stakeBld.contract.js**: BLD token staking on Agoric

4 changes: 2 additions & 2 deletions packages/orchestration/src/proposals/start-stakeAtom.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { makeChainHub } from '../exos/chain-hub.js';

/**
* @import {IBCConnectionID} from '@agoric/vats';
* @import {StakeIcaSF, StakeIcaTerms} from '../examples/stakeIca.contract';
* @import {StakeIcaSF, StakeIcaTerms} from '../examples/stake-ica.contract';
*/

const trace = makeTracer('StartStakeAtom', true);
Expand All @@ -17,7 +17,7 @@ const trace = makeTracer('StartStakeAtom', true);
* installation: {
* consume: {
* stakeIca: Installation<
* import('../examples/stakeIca.contract.js').start
* import('../examples/stake-ica.contract.js').start
* >;
* };
* };
Expand Down
4 changes: 2 additions & 2 deletions packages/orchestration/src/proposals/start-stakeOsmo.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { makeChainHub } from '../exos/chain-hub.js';

/**
* @import {IBCConnectionID} from '@agoric/vats';
* @import {StakeIcaSF} from '../examples/stakeIca.contract';
* @import {StakeIcaSF} from '../examples/stake-ica.contract';
*/

const trace = makeTracer('StartStakeOsmo', true);
Expand All @@ -17,7 +17,7 @@ const trace = makeTracer('StartStakeOsmo', true);
* installation: {
* consume: {
* stakeIca: Installation<
* import('../examples/stakeIca.contract.js').start
* import('../examples/stake-ica.contract.js').start
* >;
* };
* };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { commonSetup } from '../supports.js';

const dirname = path.dirname(new URL(import.meta.url).pathname);

const contractFile = `${dirname}/../../src/examples/stakeBld.contract.js`;
const contractFile = `${dirname}/../../src/examples/stake-bld.contract.js`;
type StartFn =
typeof import('@agoric/orchestration/src/examples/stakeBld.contract.js').start;
typeof import('@agoric/orchestration/src/examples/stake-bld.contract.js').start;

const startContract = async ({
agoricNames,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
QueryBalanceResponse,
} from '@agoric/cosmic-proto/cosmos/bank/v1beta1/query.js';
import { commonSetup } from '../supports.js';
import { type StakeIcaTerms } from '../../src/examples/stakeIca.contract.js';
import { type StakeIcaTerms } from '../../src/examples/stake-ica.contract.js';
import fetchedChainInfo from '../../src/fetched-chain-info.js';
import {
buildQueryPacketString,
Expand All @@ -24,9 +24,9 @@ import { makeChainHub } from '../../src/exos/chain-hub.js';

const dirname = path.dirname(new URL(import.meta.url).pathname);

const contractFile = `${dirname}/../../src/examples/stakeIca.contract.js`;
const contractFile = `${dirname}/../../src/examples/stake-ica.contract.js`;
type StartFn =
typeof import('@agoric/orchestration/src/examples/stakeIca.contract.js').start;
typeof import('@agoric/orchestration/src/examples/stake-ica.contract.js').start;

const getChainTerms = (
chainName: keyof typeof fetchedChainInfo,
Expand Down

0 comments on commit c42ada4

Please sign in to comment.