diff --git a/packages/casting/src/main.js b/packages/casting/src/main.js index 6b0eee6ec01..f8fa0cb2f37 100644 --- a/packages/casting/src/main.js +++ b/packages/casting/src/main.js @@ -11,3 +11,4 @@ export * from './follower-cosmjs.js'; export * from './casting-spec.js'; export * from './leader.js'; export * from './iterable.js'; +export * from './makeHttpClient.js'; diff --git a/packages/casting/src/makeHttpClient.js b/packages/casting/src/makeHttpClient.js index e6fe7c1ec7e..a8fbd77b38b 100644 --- a/packages/casting/src/makeHttpClient.js +++ b/packages/casting/src/makeHttpClient.js @@ -25,7 +25,7 @@ const filterBadStatus = res => { * @param {typeof window.fetch} fetch * @returns {import('@cosmjs/tendermint-rpc').RpcClient} */ -export const makeHttpClient = (url, fetch) => { +export const makeTendermintRpcClient = (url, fetch) => { const headers = {}; // XXX needed? // based on cosmjs 0.30.1: @@ -54,3 +54,6 @@ export const makeHttpClient = (url, fetch) => { }, }); }; + +/** @deprecated use makeTendermintRpcClient */ +export const makeHttpClient = makeTendermintRpcClient; diff --git a/packages/casting/test/interpose-net-access.test.js b/packages/casting/test/interpose-net-access.test.js index f0a0110d32d..87913ff3461 100644 --- a/packages/casting/test/interpose-net-access.test.js +++ b/packages/casting/test/interpose-net-access.test.js @@ -12,7 +12,7 @@ import { QueryChildrenResponse, } from '@agoric/cosmic-proto/vstorage/query.js'; -import { makeHttpClient } from '../src/makeHttpClient.js'; +import { makeTendermintRpcClient } from '../src/makeHttpClient.js'; import { captureIO, replayIO, web1, web2 } from './net-access-fixture.js'; /** @type {import('ava').TestFn>>} */ @@ -43,7 +43,7 @@ const scenario1 = { test('interpose net access', async t => { const fetchMock = replayIO(web1); - const rpcClient = makeHttpClient(scenario1.endpoint, fetchMock); + const rpcClient = makeTendermintRpcClient(scenario1.endpoint, fetchMock); t.log('raw JSON RPC'); const res = await rpcClient.execute({ @@ -100,7 +100,7 @@ test(`vstorage query: Children (RECORDING: ${RECORDING})`, async t => { const { fetch: fetchMock, web } = io.recording ? captureIO(io.fetch) : { fetch: replayIO(web2), web: new Map() }; - const rpcClient = makeHttpClient(scenario2.endpoint, fetchMock); + const rpcClient = makeTendermintRpcClient(scenario2.endpoint, fetchMock); const tmClient = await Tendermint34Client.create(rpcClient); const qClient = new QueryClient(tmClient);