Skip to content

Commit

Permalink
test: integration with Emerynet
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Feb 29, 2024
1 parent d967a9c commit 7c75d76
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/cosmic-proto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ To test with a real network,
```
yarn test:live
```
Note that requires `tsx` in the global path (`npm install -g tsx`).



Expand Down
3 changes: 2 additions & 1 deletion packages/cosmic-proto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"lint-fix": "yarn lint:eslint --fix",
"lint": "tsc",
"test": "ava",
"test:xs": "exit 0"
"test:xs": "exit 0",
"test:live": "yarn build && scripts/test-live.js"
},
"publishConfig": {
"access": "public"
Expand Down
36 changes: 36 additions & 0 deletions packages/cosmic-proto/scripts/test-live.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env node
// @ts-check
import '@endo/init';

import process from 'node:process';
import assert from 'node:assert/strict';

import { agoric } from '../dist/codegen/index.js';

const rpcEndpoint = 'https://emerynet.rpc.agoric.net:443';

const testMain = async () => {
const client = await agoric.ClientFactory.createRPCQueryClient({
rpcEndpoint,
});
const { params } = await client.agoric.swingset.params();
assert.deepEqual(Object.keys(params).sort(), [
'beansPerUnit',
'bootstrapVatConfig',
'feeUnitPrice',
'powerFlagFees',
'queueMax',
]);
console.log('✅ SwingSet params query successful');
};

process.exitCode = 1;
testMain().then(
() => {
process.exitCode = 0;
},
err => {
console.error('Failed with', err);
process.exit(process.exitCode || 1);
},
);

0 comments on commit 7c75d76

Please sign in to comment.