From 863515d8ef705d7d55b3560593b38edefcd7621d Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 20 Feb 2024 17:11:15 -0800 Subject: [PATCH] fixup! test: integration with Emerynet --- packages/cosmic-proto/scripts/test-live.mjs | 36 +++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 packages/cosmic-proto/scripts/test-live.mjs diff --git a/packages/cosmic-proto/scripts/test-live.mjs b/packages/cosmic-proto/scripts/test-live.mjs new file mode 100644 index 000000000000..dca73626290a --- /dev/null +++ b/packages/cosmic-proto/scripts/test-live.mjs @@ -0,0 +1,36 @@ +#!/usr/bin/env tsx +// @ts-check +import '@endo/init'; + +import process from 'node:process'; +import assert from 'node:assert/strict'; + +import { agoric } from '../src/index.ts'; + +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); + } +);