Skip to content

Commit

Permalink
chore: reduce imports to save build size
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jun 6, 2024
1 parent 0e84125 commit 3cab037
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
19 changes: 8 additions & 11 deletions packages/orchestration/src/chain-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

/** @file temporary static lookup of chain info */

import {
Order,
State as IBCChannelState,
} from '@agoric/cosmic-proto/ibc/core/channel/v1/channel.js';
import { State as IBCConnectionState } from '@agoric/cosmic-proto/ibc/core/connection/v1/connection.js';
import { E } from '@endo/far';

/**
Expand All @@ -17,6 +12,8 @@ import { E } from '@endo/far';

// TODO generate this automatically with a build script drawing on data sources such as https://github.com/cosmos/chain-registry

// XXX inlines the enum values to save the import (entraining cosmic-proto which is megabytes)

export const wellKnownChainInfo =
/** @satisfies {Record<string, ChainInfo>} */ (
harden({
Expand All @@ -33,14 +30,14 @@ export const wellKnownChainInfo =
key_prefix: '',
},
},
state: IBCConnectionState.STATE_OPEN,
state: 3 /* IBCConnectionState.STATE_OPEN */,
transferChannel: {
portId: 'transfer',
channelId: 'channel-1',
counterPartyChannelId: 'channel-1',
counterPartyPortId: 'transfer',
ordering: Order.ORDER_UNORDERED,
state: IBCChannelState.STATE_OPEN,
ordering: 1 /* Order.ORDER_UNORDERED */,
state: 3 /* IBCConnectionState.STATE_OPEN */,
version: 'ics20-1',
},
versions: [{ identifier: '', features: ['', ''] }],
Expand All @@ -56,14 +53,14 @@ export const wellKnownChainInfo =
key_prefix: '',
},
},
state: IBCConnectionState.STATE_OPEN,
state: 3 /* IBCConnectionState.STATE_OPEN */,
transferChannel: {
portId: 'transfer',
channelId: 'channel-0',
counterPartyChannelId: 'channel-1',
counterPartyPortId: 'transfer',
ordering: Order.ORDER_UNORDERED,
state: IBCChannelState.STATE_OPEN,
ordering: 1 /* Order.ORDER_UNORDERED */,
state: 3 /* IBCConnectionState.STATE_OPEN */,
version: 'ics20-1',
},
versions: [{ identifier: '', features: ['', ''] }],
Expand Down
3 changes: 1 addition & 2 deletions packages/orchestration/src/examples/stakeBld.contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { E } from '@endo/far';
import { deeplyFulfilled } from '@endo/marshal';
import { M } from '@endo/patterns';
import { prepareLocalChainAccountKit } from '../exos/local-chain-account-kit.js';
import { CHAIN_KEY } from '../facade.js';

/**
* @import {NameHub} from '@agoric/vats';
Expand Down Expand Up @@ -49,7 +48,7 @@ export const start = async (zcf, privateArgs, baggage) => {
// FIXME in a second incarnation we can't make a remote call before defining all kinds
// UNTIL https://github.com/Agoric/agoric-sdk/issues/8879
const agoricChainInfo = await E(privateArgs.agoricNames).lookup(
CHAIN_KEY,
'chain',
'agoric',
);

Expand Down

0 comments on commit 3cab037

Please sign in to comment.