-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs: #10006 refs: #10445 ## Description - adds `pfmEnabled: bool` to `CosmosChainInfo` to support multi-hop forwarding logic - adds and exports `withChainCapabilities` helper that mixes in `PfmEnabled` and `IcqEnabled` constants to `ChainInfo` - adds and exports `registerChainsAndAssets` helper that registers info in a `chainHub` in a contract `startFn` - implements `chainHub` initialization in `fast-usdc` and `send-anywhere` contracts ### Security Considerations - `chain-capabilities.js` is authoritative, but consumers have the ability to provide their own data. It's not published to vstorage and will be mixed in to local ChainHub's in example contracts that rely on it. ### Scaling Considerations - Authors must maintain `chain-capabilities.js` over time ### Documentation Considerations - documented via typedoc ### Testing Considerations - updates snapshot tests ### Upgrade Considerations Library code, part of an NPM Orch release
- Loading branch information
Showing
28 changed files
with
446 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { makeHelpers } from '@agoric/deploy-script-support'; | ||
import { | ||
getManifest, | ||
startSendAnywhere, | ||
} from '@agoric/orchestration/src/proposals/start-send-anywhere.js'; | ||
import { parseArgs } from 'node:util'; | ||
|
||
/** | ||
* @import {ParseArgsConfig} from 'node:util' | ||
*/ | ||
|
||
/** @type {ParseArgsConfig['options']} */ | ||
const parserOpts = { | ||
chainInfo: { type: 'string' }, | ||
assetInfo: { type: 'string' }, | ||
}; | ||
|
||
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */ | ||
export const defaultProposalBuilder = async ( | ||
{ publishRef, install }, | ||
options, | ||
) => | ||
harden({ | ||
sourceSpec: '@agoric/orchestration/src/proposals/start-send-anywhere.js', | ||
getManifestCall: [ | ||
getManifest.name, | ||
{ | ||
installationRef: publishRef( | ||
install( | ||
'@agoric/orchestration/src/examples/send-anywhere.contract.js', | ||
), | ||
), | ||
options, | ||
}, | ||
], | ||
}); | ||
|
||
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */ | ||
export default async (homeP, endowments) => { | ||
const { scriptArgs } = endowments; | ||
|
||
const { | ||
values: { chainInfo, assetInfo }, | ||
} = parseArgs({ | ||
args: scriptArgs, | ||
options: parserOpts, | ||
}); | ||
|
||
const parseChainInfo = () => { | ||
if (typeof chainInfo !== 'string') return undefined; | ||
return JSON.parse(chainInfo); | ||
}; | ||
const parseAssetInfo = () => { | ||
if (typeof assetInfo !== 'string') return undefined; | ||
return JSON.parse(assetInfo); | ||
}; | ||
const opts = harden({ | ||
chainInfo: parseChainInfo(), | ||
assetInfo: parseAssetInfo(), | ||
}); | ||
|
||
const { writeCoreEval } = await makeHelpers(homeP, endowments); | ||
|
||
await writeCoreEval(startSendAnywhere.name, utils => | ||
defaultProposalBuilder(utils, opts), | ||
); | ||
}; |
Oops, something went wrong.