Skip to content

Commit c4f3ee7

Browse files
committed
fixup! chore: fixed new lint errors
1 parent 1b2d4c3 commit c4f3ee7

File tree

15 files changed

+55
-51
lines changed

15 files changed

+55
-51
lines changed

.github/workflows/pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
- run: corepack enable
2121
- run: yarn install
2222
- run: yarn build
23+
- run: ls ./
24+
- run: ls ./contract
2325
- run: yarn test
2426
integration:
2527
runs-on: ubuntu-latest

contract/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131
"src"
132132
],
133133
"resolutions": {
134-
"node-fetch": "2.6.12",
135134
"axios": "1.6.7",
136135
"@noble/hashes": "https://github.com/paulmillr/noble-hashes.git#ae060daa6252f3ff2aa2f84e887de0aab491281d"
137136
},

contract/src/orca.contract.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import * as flows from './orca.flows.js';
2929
* @import {CosmosInterchainService} from '@agoric/orchestration';
3030
* @import {TimerService} from '@agoric/time';
3131
* @import {NameHub} from '@agoric/vats';
32-
*
32+
*
3333
*/
3434

3535
// /**
@@ -45,7 +45,6 @@ import * as flows from './orca.flows.js';
4545
// * @typedef {import('@agoric/zoe/src/contractFacet/types-ambient.js').ZCF} ZCF
4646
// */
4747

48-
4948
// /**
5049
// * @typedef {import('@agoric/zoe/src/contractFacet/types-ambient.js').ContractStartFn} ContractStartFunction
5150
// */
@@ -54,9 +53,7 @@ import * as flows from './orca.flows.js';
5453
/// <reference types="@agoric/zoe/src/contractFacet/types-ambient"/>
5554

5655
/**
57-
*/
58-
59-
56+
*/
6057

6158
const trace = makeTracer('OrchDev1');
6259

@@ -98,16 +95,15 @@ export const meta = {
9895
};
9996
harden(meta);
10097

101-
10298
/**
10399
* @typedef {{
104-
* localchain: Remote<LocalChain>;
105-
* orchestrationService: Remote<CosmosInterchainService>;
106-
* storageNode: Remote<StorageNode>;
107-
* timerService: Remote<TimerService>;
108-
* agoricNames: Remote<NameHub>;
109-
* }} OrchestrationPowers
110-
*/
100+
* localchain: Remote<LocalChain>;
101+
* orchestrationService: Remote<CosmosInterchainService>;
102+
* storageNode: Remote<StorageNode>;
103+
* timerService: Remote<TimerService>;
104+
* agoricNames: Remote<NameHub>;
105+
* }} OrchestrationPowers
106+
*/
111107

112108
/**
113109
* @param {ZCF<Record<string, unknown>> | undefined} zcf
@@ -126,7 +122,6 @@ const contract = async (
126122
) => {
127123
trace('inside start function: v1.1.96');
128124
trace('privateArgs', privateArgs);
129-
130125

131126
// @ts-expect-error XXX ZCFSeat not Passable
132127
const { makeAccount, makeCreateAndFund } = orchestrateAll(flows, {
@@ -158,7 +153,9 @@ const contract = async (
158153
};
159154

160155
/** @type {ContractStartFunction} */
161-
export const start = /** @type {ContractStartFunction} */ (withOrchestration(contract));
156+
export const start = /** @type {ContractStartFunction} */ (
157+
withOrchestration(contract)
158+
);
162159
harden(start);
163160

164161
// /** @typedef {typeof start} OrcaSF */

contract/src/orca.flows.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export const makeCreateAndFund = async (
6565
trace('amt', amt);
6666
trace('give:', give);
6767

68-
6968
const [agoric, chain] = await Promise.all([
7069
orch.getChain('agoric'),
7170
orch.getChain(chainName),

contract/src/orca.proposal.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { makeTracer } from './tools/debug.js';
1010
// import { atomicTransfer } from '@agoric/zoe/src/contractSupport/index.js';
1111
/// <reference types="@agoric/zoe/src/contractFacet/types-ambient"/>
1212

13-
1413
/**
1514
* @import {ERef} from '@endo/far';
1615
* @import {BootstrapManifest} from '@agoric/vats/src/core/lib-boot.js';
@@ -19,16 +18,14 @@ import { makeTracer } from './tools/debug.js';
1918
* @import {OrcaSF} from './orca.contract.js';
2019
*/
2120

22-
/**
23-
* * @typedef {import('./orca.contract.js').OrcaSF} OrcaSF
24-
*/
25-
21+
/**
22+
* * @typedef {import('./orca.contract.js').OrcaSF} OrcaSF
23+
*/
2624

2725
/**
2826
* @typedef {import('@agoric/vow').Remote<import('@agoric/vats/src/localchain.js').LocalChain>} LocalChain
2927
*/
3028

31-
3229
const trace = makeTracer('OrCE');
3330
const { entries, fromEntries } = Object;
3431

@@ -114,16 +111,12 @@ export const startOrcaContract = async (permittedPowers, config) => {
114111
const marshaller = await E(board).getPublishingMarshaller();
115112
console.log(marshaller);
116113

117-
118-
119-
120-
121114
/** @type {StartUpgradableOpts<OrcaSF>} **/
122115
const startOpts = {
123116
label: 'orca',
124117
installation,
125118
terms: undefined,
126-
privateArgs: {
119+
privateArgs: {
127120
localchain: await localchain,
128121
// localchain: await E(localchain),
129122
orchestrationService: await cosmosInterchainService,

contract/test/boot-tools.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import '@agoric/vats/src/core/types-ambient.js';
1919
import '@agoric/zoe/src/zoeService/types-ambient.js';
2020
const { entries } = Object;
2121

22-
23-
2422
/**
2523
* Make powers (zoe, timer and name services, etc.) sufficient to test
2624
* deploying and using contracts. priceAuthority is a dummy.
@@ -66,7 +64,7 @@ export const mockBootstrapPowers = async (
6664

6765
/**
6866
* @typedef {Record<Keyword, Issuer<any, any>>} IssuerKeywordRecord
69-
*/
67+
*/
7068
const startUpgradable = ({
7169
installation,
7270
issuerKeywordRecord,

contract/test/mintStable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const makeStableFaucet = ({
5959
const { creatorFacet: bootstrapSupplier } = await E(zoe).startInstance(
6060
centralSupply,
6161
{},
62-
/** @type {any} */ ({ bootstrapPaymentValue: value }),
62+
/** @type {any} */ ({ bootstrapPaymentValue: value }),
6363
{ feeMintAccess },
6464
);
6565
return E(bootstrapSupplier).getBootstrapPayment();

contract/test/orca-contract.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ const makeTestContext = async t => {
221221
registerChain: async (name, details) => {
222222
console.log(`chain registered: ${name}`, details);
223223
},
224-
getChain: async (chainName) => {
224+
getChain: async chainName => {
225225
const state = harden({
226226
name: 'agoric',
227227
chainId: `agoriclocal`,

contract/test/support.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { dirname, join } from 'path';
1+
import path from 'path';
22
import { execa } from 'execa';
33
import fse from 'fs-extra';
44
import childProcess from 'child_process';
@@ -8,8 +8,7 @@ import { generateMnemonic } from '../tools/wallet.js';
88
import { makeRetryUntilCondition } from '../tools/sleep.js';
99
import { makeDeployBuilder } from '../tools/deploy.js';
1010

11-
// const setupRegistry = makeSetupRegistry(makeGetFile({ dirname, join }));
12-
const setupRegistry = makeSetupRegistry(makeGetFile());
11+
const setupRegistry = makeSetupRegistry(makeGetFile({ dirname: path.dirname(new URL(import.meta.url).pathname), join: path.join }));
1312

1413
const chainConfig = {
1514
cosmoshub: { expectedAddressPrefix: 'cosmos' },

contract/test/wallet-tools.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const mockWalletFactory = (
5252
const brand = await E(issuer).getBrand();
5353
// /** @type {[Brand, Purse]} */
5454
/** @type {[Brand<any>, Purse<any, any>]} */
55-
const entry = [brand, purse];
55+
const entry = [brand, purse];
5656
return entry;
5757
}),
5858
);
@@ -65,7 +65,7 @@ export const mockWalletFactory = (
6565

6666
const depositFacet = Far('DepositFacet', {
6767
// /** @param {Payment} pmt */
68-
/** @param {Payment<any, any>} pmt */
68+
/** @param {Payment<any, any>} pmt */
6969

7070
receive: async pmt => {
7171
const pBrand = await E(pmt).getAllegedBrand();

contract/tools/e2e-tools.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ const installBundle = async (fullPath, opts) => {
112112
return { tx, confirm: true };
113113
};
114114

115-
116-
117-
118115
/**
119116
* @param {string} address
120117
* @param {Record<string, number | bigint>} balances
@@ -142,7 +139,6 @@ export const provisionSmartWallet = async (
142139
// q = makeQueryKit(makeVStorage(lcd)).query,
143140
},
144141
) => {
145-
146142
const q = makeQueryKit(makeVStorage(lcd)).query;
147143

148144
// TODO: skip this query if balances is {}

contract/tools/queryKit.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,13 @@ export const makeWalletView = (addr, { query, vstorage }) => {
103103
* @param {import('@endo/marshal').Marshal<string | null>} [m]
104104
*/
105105
// export const makeQueryKit = (vstorage, m = makeClientMarshaller()) => {
106-
export const makeQueryKit = (vstorage, m = /** @type {import('@endo/marshal').Marshal<string | null>} */ (makeClientMarshaller())) => {
107-
/** @param {['children' | 'data', string][]} paths */
106+
export const makeQueryKit = (
107+
vstorage,
108+
m = /** @type {import('@endo/marshal').Marshal<string | null>} */ (
109+
makeClientMarshaller()
110+
),
111+
) => {
112+
/** @param {['children' | 'data', string][]} paths */
108113
const batchQuery = async paths =>
109114
batchVstorageQuery(vstorage, m.fromCapData, paths);
110115

contract/tools/registry.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
11
import { useRegistry, useChain, ConfigContext } from 'starshipjs';
22
import path from 'path';
33

4-
export const makeGetFile = () => filePath => {
5-
return path.join(path.dirname(new URL(import.meta.url).pathname), filePath);
4+
// export const makeGetFile = () => filePath => {
5+
// return path.join(path.dirname(new URL(import.meta.url).pathname), filePath);
6+
// };
7+
8+
/**
9+
* @param {Object} [options]
10+
* @param {string} [options.dirname]
11+
* @param {Function} [options.join]
12+
* @returns {(filePath: string) => string}
13+
*/
14+
export const makeGetFile = ({ dirname = path.dirname(new URL(import.meta.url).pathname), join = path.join } = {}) => {
15+
return (filePath) => {
16+
return join(dirname, filePath);
17+
};
618
};
719

20+
/**
21+
* @param {(path: string) => string} getFile
22+
* @returns { (options?: { config?: string }) => Promise<{ useChain: any }> }
23+
*/
824
export const makeSetupRegistry = getFile => {
925
let initialized = false;
1026

@@ -14,7 +30,7 @@ export const makeSetupRegistry = getFile => {
1430
console.log('configFile', configFile);
1531
const fetcher = await useRegistry(configFile);
1632
await ConfigContext.init(configFile, fetcher);
17-
initialized = true;
33+
initialized = true;
1834
return { useChain };
1935
};
2036

contract/tools/sleep.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const ambientSetTimeout = globalThis.setTimeout;
22

3-
const sleep = (ms, { log = (msg) => {}, setTimeout = ambientSetTimeout } = {}) =>
3+
const sleep = (ms, { log = msg => {}, setTimeout = ambientSetTimeout } = {}) =>
44
new Promise(resolve => {
55
log(`Sleeping for ${ms}ms...`);
66
setTimeout(resolve, ms);
@@ -13,7 +13,7 @@ const retryUntilCondition = async (
1313
{
1414
maxRetries = 6,
1515
retryIntervalMs = 3500,
16-
log = (msg) => {},
16+
log = msg => {},
1717
setTimeout = ambientSetTimeout,
1818
} = {},
1919
) => {

contract/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"skipLibCheck": true,
1313
"forceConsistentCasingInFileNames": true,
1414
"resolveJsonModule": true,
15-
"outDir": "./dist",
15+
"outDir": "./dist"
1616
},
1717
"include": ["tools", "test"],
1818
"exclude": ["node_modules"]
19-
}
19+
}

0 commit comments

Comments
 (0)