@agoric/builders 0.2.0-u18.4 → 0.2.0-u18.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/package.json +30 -28
- package/scripts/fast-usdc/fast-usdc-update.build.js +61 -0
- package/scripts/fast-usdc/init-fast-usdc.js +197 -0
- package/scripts/inter-protocol/replace-feeDistributor.js +28 -0
- package/scripts/orchestration/init-basic-flows.js +42 -2
- package/scripts/testing/add-USD-LEMONS.js +19 -0
- package/scripts/testing/add-USD-OLIVES.js +19 -0
- package/scripts/testing/init-auto-stake-it.js +73 -0
- package/scripts/testing/init-send-anywhere.js +67 -0
- package/scripts/testing/provokeBOYD.js +54 -0
- package/scripts/testing/publish-test-info.js +79 -0
- package/scripts/testing/recorded-retired-instances.js +12 -4
- package/scripts/testing/register-interchain-bank-assets.js +199 -0
- package/scripts/testing/replace-feeDistributor-short.js +33 -0
- package/scripts/testing/test-upgraded-board.js +15 -0
- package/scripts/testing/{fix-buggy-sendAnywhere.js → upgrade-send-anywhere.js} +14 -18
- package/scripts/testing/upgrade-vaultFactory.js +21 -0
- package/scripts/vats/terminate-governor-instance.js +134 -0
- package/scripts/vats/upgrade-agoricNames.js +21 -0
- package/scripts/vats/upgrade-asset-reserve.js +21 -0
- package/scripts/vats/upgrade-board.js +20 -0
- package/scripts/vats/upgrade-mintHolder.js +126 -0
- package/scripts/vats/{upgrade-orch-core.js → upgrade-orchestration.js} +5 -2
- package/scripts/vats/upgrade-paRegistry.js +21 -0
- package/scripts/testing/start-auto-stake-it.js +0 -128
- package/scripts/testing/start-buggy-sendAnywhere.js +0 -143
- package/scripts/testing/start-send-anywhere.js +0 -136
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
|
|
3
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
4
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
5
|
+
harden({
|
|
6
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-agoricNames-proposal.js',
|
|
7
|
+
getManifestCall: [
|
|
8
|
+
'getManifestForUpgradingAgoricNames',
|
|
9
|
+
{
|
|
10
|
+
agoricNamesRef: publishRef(
|
|
11
|
+
install('@agoric/vats/src/vat-agoricNames.js'),
|
|
12
|
+
),
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
18
|
+
export default async (homeP, endowments) => {
|
|
19
|
+
const { writeCoreProposal } = await makeHelpers(homeP, endowments);
|
|
20
|
+
await writeCoreProposal('upgrade-agoricNames', defaultProposalBuilder);
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
|
|
3
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
4
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
5
|
+
harden({
|
|
6
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-asset-reserve-proposal.js',
|
|
7
|
+
getManifestCall: [
|
|
8
|
+
'getManifestForUpgradingAssetReserve',
|
|
9
|
+
{
|
|
10
|
+
assetReserveRef: publishRef(
|
|
11
|
+
install('@agoric/inter-protocol/src/reserve/assetReserve.js'),
|
|
12
|
+
),
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
18
|
+
export default async (homeP, endowments) => {
|
|
19
|
+
const { writeCoreProposal } = await makeHelpers(homeP, endowments);
|
|
20
|
+
await writeCoreProposal('upgrade-asset-reserve', defaultProposalBuilder);
|
|
21
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { getManifestForUpgradingBoard } from '@agoric/vats/src/proposals/upgrade-board-proposal.js';
|
|
3
|
+
|
|
4
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
5
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
6
|
+
harden({
|
|
7
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-board-proposal.js',
|
|
8
|
+
getManifestCall: [
|
|
9
|
+
getManifestForUpgradingBoard.name,
|
|
10
|
+
{
|
|
11
|
+
boardRef: publishRef(install('@agoric/vats/src/vat-board.js')),
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
17
|
+
export default async (homeP, endowments) => {
|
|
18
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
19
|
+
await writeCoreEval('upgrade-board', defaultProposalBuilder);
|
|
20
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { getManifestForUpgradingMintHolder } from '@agoric/vats/src/proposals/upgrade-mintHolder-proposal.js';
|
|
3
|
+
|
|
4
|
+
const configurations = {
|
|
5
|
+
A3P_INTEGRATION: {
|
|
6
|
+
labelList: [
|
|
7
|
+
'USDC_axl',
|
|
8
|
+
'USDT_grv',
|
|
9
|
+
'DAI_axl',
|
|
10
|
+
'DAI_grv',
|
|
11
|
+
'stATOM',
|
|
12
|
+
'USDC_grv',
|
|
13
|
+
'ATOM',
|
|
14
|
+
'USDT_axl',
|
|
15
|
+
'USDC',
|
|
16
|
+
'BLD',
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
MAINNET: {
|
|
20
|
+
labelList: [
|
|
21
|
+
'USDT',
|
|
22
|
+
'USDT_axl',
|
|
23
|
+
'USDT_grv',
|
|
24
|
+
'USDC',
|
|
25
|
+
'USDC_axl',
|
|
26
|
+
'USDC_grv',
|
|
27
|
+
'DAI_axl',
|
|
28
|
+
'DAI_grv',
|
|
29
|
+
'ATOM',
|
|
30
|
+
'stATOM',
|
|
31
|
+
'stkATOM',
|
|
32
|
+
'stTIA',
|
|
33
|
+
'stOSMO',
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
DEVNET: {
|
|
37
|
+
labelList: [
|
|
38
|
+
'stATOM3',
|
|
39
|
+
'stATOM',
|
|
40
|
+
'dATOM',
|
|
41
|
+
'stOSMO',
|
|
42
|
+
'stkATOM',
|
|
43
|
+
'stATOM2',
|
|
44
|
+
'STOSMO',
|
|
45
|
+
'stTIA',
|
|
46
|
+
'ATOM',
|
|
47
|
+
'AUSD',
|
|
48
|
+
'USDT_grv',
|
|
49
|
+
'USDC_axl',
|
|
50
|
+
'USDC_grv',
|
|
51
|
+
'USDT_axl',
|
|
52
|
+
'BLD',
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
EMERYNET: {
|
|
56
|
+
labelList: [
|
|
57
|
+
'ATOM',
|
|
58
|
+
'USDT',
|
|
59
|
+
'DAI_axl',
|
|
60
|
+
'DAI_grv',
|
|
61
|
+
'USDC_axl',
|
|
62
|
+
'stOSMO',
|
|
63
|
+
'stATOM',
|
|
64
|
+
'stkATOM',
|
|
65
|
+
'stOSMO2',
|
|
66
|
+
'ToyUSD',
|
|
67
|
+
'BLD',
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const { keys } = Object;
|
|
73
|
+
const knownVariants = keys(configurations);
|
|
74
|
+
|
|
75
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
76
|
+
export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
|
|
77
|
+
const config = opts.config || configurations[opts.variant];
|
|
78
|
+
if (!config) {
|
|
79
|
+
const error = `Unknown variant "${opts.variant}". Expected one of ${knownVariants.join(', ')}`;
|
|
80
|
+
console.error(error);
|
|
81
|
+
throw Error(error);
|
|
82
|
+
}
|
|
83
|
+
const { labelList } = config;
|
|
84
|
+
|
|
85
|
+
return harden({
|
|
86
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-mintHolder-proposal.js',
|
|
87
|
+
getManifestCall: [
|
|
88
|
+
getManifestForUpgradingMintHolder.name,
|
|
89
|
+
{
|
|
90
|
+
labelList,
|
|
91
|
+
contractRef: publishRef(install('@agoric/vats/src/mintHolder.js')),
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const Usage = `agoric run upgrade-mintHolder.js ${[...knownVariants, '<json-config>'].join(' | ')}`;
|
|
98
|
+
|
|
99
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
100
|
+
export default async (homeP, endowments) => {
|
|
101
|
+
const { scriptArgs } = endowments;
|
|
102
|
+
const variantOrConfig = scriptArgs?.[0];
|
|
103
|
+
console.log('upgrade-mintHolder', variantOrConfig);
|
|
104
|
+
|
|
105
|
+
const opts = {};
|
|
106
|
+
|
|
107
|
+
if (typeof variantOrConfig === 'string') {
|
|
108
|
+
if (variantOrConfig[0] === '{') {
|
|
109
|
+
try {
|
|
110
|
+
opts.config = JSON.parse(variantOrConfig);
|
|
111
|
+
} catch (err) {
|
|
112
|
+
throw Error(`Failed to parse config argument ${variantOrConfig}`);
|
|
113
|
+
}
|
|
114
|
+
} else {
|
|
115
|
+
opts.variant = variantOrConfig;
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
console.error(Usage);
|
|
119
|
+
throw Error(Usage);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
123
|
+
await writeCoreEval(`upgrade-mintHolder`, utils =>
|
|
124
|
+
defaultProposalBuilder(utils, opts),
|
|
125
|
+
);
|
|
126
|
+
};
|
|
@@ -3,15 +3,18 @@ import { makeHelpers } from '@agoric/deploy-script-support';
|
|
|
3
3
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
4
4
|
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
5
5
|
harden({
|
|
6
|
-
sourceSpec: '@agoric/vats/src/proposals/upgrade-
|
|
6
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-vats-generic-proposal.js',
|
|
7
7
|
getManifestCall: [
|
|
8
|
-
'
|
|
8
|
+
'getManifestForUpgradingVats',
|
|
9
9
|
{
|
|
10
10
|
bundleRefs: {
|
|
11
11
|
ibc: publishRef(install('@agoric/vats/src/vat-ibc.js')),
|
|
12
12
|
network: publishRef(install('@agoric/vats/src/vat-network.js')),
|
|
13
13
|
localchain: publishRef(install('@agoric/vats/src/vat-localchain.js')),
|
|
14
14
|
transfer: publishRef(install('@agoric/vats/src/vat-transfer.js')),
|
|
15
|
+
orchestration: publishRef(
|
|
16
|
+
install('@agoric/orchestration/src/vat-orchestration.js'),
|
|
17
|
+
),
|
|
15
18
|
},
|
|
16
19
|
},
|
|
17
20
|
],
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
|
|
3
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
4
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
5
|
+
harden({
|
|
6
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-paRegistry-proposal.js',
|
|
7
|
+
getManifestCall: [
|
|
8
|
+
'getManifestForUpgradingRegistry',
|
|
9
|
+
{
|
|
10
|
+
registryRef: publishRef(
|
|
11
|
+
install('@agoric/vats/src/vat-priceAuthority.js'),
|
|
12
|
+
),
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
18
|
+
export default async (homeP, endowments) => {
|
|
19
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
20
|
+
await writeCoreEval('upgrade-paRegistry', defaultProposalBuilder);
|
|
21
|
+
};
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file A proposal to start the auto-stake-it contract.
|
|
3
|
-
*
|
|
4
|
-
* AutoStakeIt allows users to to create an auto-forwarding address that
|
|
5
|
-
* transfers and stakes tokens on a remote chain when received.
|
|
6
|
-
*/
|
|
7
|
-
import { makeTracer } from '@agoric/internal';
|
|
8
|
-
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
|
|
9
|
-
import { E } from '@endo/far';
|
|
10
|
-
import { deeplyFulfilled } from '@endo/marshal';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @import {AutoStakeItSF} from '@agoric/orchestration/src/examples/auto-stake-it.contract.js';
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
const contractName = 'autoAutoStakeIt';
|
|
17
|
-
const trace = makeTracer(contractName, true);
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @param {BootstrapPowers} powers
|
|
21
|
-
*/
|
|
22
|
-
export const startAutoStakeIt = async ({
|
|
23
|
-
consume: {
|
|
24
|
-
agoricNames,
|
|
25
|
-
board,
|
|
26
|
-
chainStorage,
|
|
27
|
-
chainTimerService,
|
|
28
|
-
cosmosInterchainService,
|
|
29
|
-
localchain,
|
|
30
|
-
startUpgradable,
|
|
31
|
-
},
|
|
32
|
-
installation: {
|
|
33
|
-
// @ts-expect-error not a WellKnownName
|
|
34
|
-
consume: { [contractName]: installation },
|
|
35
|
-
},
|
|
36
|
-
instance: {
|
|
37
|
-
// @ts-expect-error not a WellKnownName
|
|
38
|
-
produce: { [contractName]: produceInstance },
|
|
39
|
-
},
|
|
40
|
-
}) => {
|
|
41
|
-
trace(`start ${contractName}`);
|
|
42
|
-
await null;
|
|
43
|
-
|
|
44
|
-
const storageNode = await makeStorageNodeChild(chainStorage, contractName);
|
|
45
|
-
const marshaller = await E(board).getPublishingMarshaller();
|
|
46
|
-
|
|
47
|
-
/** @type {StartUpgradableOpts<AutoStakeItSF>} */
|
|
48
|
-
const startOpts = {
|
|
49
|
-
label: 'autoAutoStakeIt',
|
|
50
|
-
installation,
|
|
51
|
-
terms: undefined,
|
|
52
|
-
privateArgs: await deeplyFulfilled(
|
|
53
|
-
// @ts-expect-error
|
|
54
|
-
harden({
|
|
55
|
-
agoricNames,
|
|
56
|
-
orchestrationService: cosmosInterchainService,
|
|
57
|
-
localchain,
|
|
58
|
-
storageNode,
|
|
59
|
-
marshaller,
|
|
60
|
-
timerService: chainTimerService,
|
|
61
|
-
}),
|
|
62
|
-
),
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const { instance } = await E(startUpgradable)(startOpts);
|
|
66
|
-
produceInstance.resolve(instance);
|
|
67
|
-
};
|
|
68
|
-
harden(startAutoStakeIt);
|
|
69
|
-
|
|
70
|
-
export const getManifestForContract = (
|
|
71
|
-
{ restoreRef },
|
|
72
|
-
{ installKeys, ...options },
|
|
73
|
-
) => {
|
|
74
|
-
return {
|
|
75
|
-
manifest: {
|
|
76
|
-
[startAutoStakeIt.name]: {
|
|
77
|
-
consume: {
|
|
78
|
-
agoricNames: true,
|
|
79
|
-
board: true,
|
|
80
|
-
chainStorage: true,
|
|
81
|
-
chainTimerService: true,
|
|
82
|
-
cosmosInterchainService: true,
|
|
83
|
-
localchain: true,
|
|
84
|
-
startUpgradable: true,
|
|
85
|
-
},
|
|
86
|
-
installation: {
|
|
87
|
-
consume: { [contractName]: true },
|
|
88
|
-
},
|
|
89
|
-
instance: {
|
|
90
|
-
produce: { [contractName]: true },
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
installations: {
|
|
95
|
-
[contractName]: restoreRef(installKeys[contractName]),
|
|
96
|
-
},
|
|
97
|
-
options,
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
102
|
-
export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
103
|
-
return harden({
|
|
104
|
-
// Somewhat unorthodox, source the exports from this builder module
|
|
105
|
-
sourceSpec: '@agoric/builders/scripts/testing/start-auto-stake-it.js',
|
|
106
|
-
getManifestCall: [
|
|
107
|
-
'getManifestForContract',
|
|
108
|
-
{
|
|
109
|
-
installKeys: {
|
|
110
|
-
autoAutoStakeIt: publishRef(
|
|
111
|
-
install(
|
|
112
|
-
'@agoric/orchestration/src/examples/auto-stake-it.contract.js',
|
|
113
|
-
),
|
|
114
|
-
),
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
122
|
-
export default async (homeP, endowments) => {
|
|
123
|
-
// import dynamically so the module can work in CoreEval environment
|
|
124
|
-
const dspModule = await import('@agoric/deploy-script-support');
|
|
125
|
-
const { makeHelpers } = dspModule;
|
|
126
|
-
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
127
|
-
await writeCoreEval(startAutoStakeIt.name, defaultProposalBuilder);
|
|
128
|
-
};
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file This is for use in tests in a3p-integration
|
|
3
|
-
* Unlike most builder scripts, this one includes the proposal exports as well.
|
|
4
|
-
*/
|
|
5
|
-
import {
|
|
6
|
-
deeplyFulfilledObject,
|
|
7
|
-
makeTracer,
|
|
8
|
-
NonNullish,
|
|
9
|
-
} from '@agoric/internal';
|
|
10
|
-
import { E, Far } from '@endo/far';
|
|
11
|
-
|
|
12
|
-
/// <reference types="@agoric/vats/src/core/types-ambient"/>
|
|
13
|
-
/**
|
|
14
|
-
* @import {Installation} from '@agoric/zoe/src/zoeService/utils.js';
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
const trace = makeTracer('StartBuggySA', true);
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @import {start as StartFn} from '@agoric/orchestration/src/examples/send-anywhere.contract.js';
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @param {BootstrapPowers & {
|
|
25
|
-
* installation: {
|
|
26
|
-
* consume: {
|
|
27
|
-
* sendAnywhere: Installation<StartFn>;
|
|
28
|
-
* };
|
|
29
|
-
* };
|
|
30
|
-
* }} powers
|
|
31
|
-
*/
|
|
32
|
-
export const startSendAnywhere = async ({
|
|
33
|
-
consume: {
|
|
34
|
-
agoricNames,
|
|
35
|
-
board,
|
|
36
|
-
chainStorage,
|
|
37
|
-
chainTimerService,
|
|
38
|
-
cosmosInterchainService,
|
|
39
|
-
localchain,
|
|
40
|
-
startUpgradable,
|
|
41
|
-
},
|
|
42
|
-
installation: {
|
|
43
|
-
consume: { sendAnywhere },
|
|
44
|
-
},
|
|
45
|
-
instance: {
|
|
46
|
-
// @ts-expect-error unknown instance
|
|
47
|
-
produce: { sendAnywhere: produceInstance },
|
|
48
|
-
},
|
|
49
|
-
}) => {
|
|
50
|
-
trace(startSendAnywhere.name);
|
|
51
|
-
|
|
52
|
-
const marshaller = await E(board).getReadonlyMarshaller();
|
|
53
|
-
|
|
54
|
-
const privateArgs = await deeplyFulfilledObject(
|
|
55
|
-
harden({
|
|
56
|
-
agoricNames,
|
|
57
|
-
localchain,
|
|
58
|
-
marshaller,
|
|
59
|
-
orchestrationService: cosmosInterchainService,
|
|
60
|
-
storageNode: E(NonNullish(await chainStorage)).makeChildNode(
|
|
61
|
-
'sendAnywhere',
|
|
62
|
-
),
|
|
63
|
-
timerService: chainTimerService,
|
|
64
|
-
}),
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
/** @type {import('@agoric/vats').NameHub} */
|
|
68
|
-
// @ts-expect-error intentional fake
|
|
69
|
-
const agoricNamesHangs = Far('agoricNames that hangs', {
|
|
70
|
-
lookup: async () => {
|
|
71
|
-
trace('agoricNames.lookup being called that will never resolve');
|
|
72
|
-
// BUG: this never resolves
|
|
73
|
-
return new Promise(() => {});
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
const { instance } = await E(startUpgradable)({
|
|
78
|
-
label: 'sendAnywhere',
|
|
79
|
-
installation: sendAnywhere,
|
|
80
|
-
privateArgs: {
|
|
81
|
-
...privateArgs,
|
|
82
|
-
agoricNames: agoricNamesHangs,
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
produceInstance.resolve(instance);
|
|
86
|
-
trace('done');
|
|
87
|
-
};
|
|
88
|
-
harden(startSendAnywhere);
|
|
89
|
-
|
|
90
|
-
export const getManifestForValueVow = ({ restoreRef }, { sendAnywhereRef }) => {
|
|
91
|
-
trace('sendAnywhereRef', sendAnywhereRef);
|
|
92
|
-
return {
|
|
93
|
-
manifest: {
|
|
94
|
-
[startSendAnywhere.name]: {
|
|
95
|
-
consume: {
|
|
96
|
-
agoricNames: true,
|
|
97
|
-
board: true,
|
|
98
|
-
chainStorage: true,
|
|
99
|
-
chainTimerService: true,
|
|
100
|
-
cosmosInterchainService: true,
|
|
101
|
-
localchain: true,
|
|
102
|
-
|
|
103
|
-
startUpgradable: true,
|
|
104
|
-
},
|
|
105
|
-
installation: {
|
|
106
|
-
consume: { sendAnywhere: true },
|
|
107
|
-
},
|
|
108
|
-
instance: {
|
|
109
|
-
produce: { sendAnywhere: true },
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
installations: {
|
|
114
|
-
sendAnywhere: restoreRef(sendAnywhereRef),
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
120
|
-
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
121
|
-
harden({
|
|
122
|
-
// Somewhat unorthodox, source the exports from this builder module
|
|
123
|
-
sourceSpec: '@agoric/builders/scripts/testing/start-buggy-sendAnywhere.js',
|
|
124
|
-
getManifestCall: [
|
|
125
|
-
'getManifestForValueVow',
|
|
126
|
-
{
|
|
127
|
-
sendAnywhereRef: publishRef(
|
|
128
|
-
install(
|
|
129
|
-
'@agoric/orchestration/src/examples/send-anywhere.contract.js',
|
|
130
|
-
),
|
|
131
|
-
),
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
137
|
-
export default async (homeP, endowments) => {
|
|
138
|
-
// import dynamically so the module can work in CoreEval environment
|
|
139
|
-
const dspModule = await import('@agoric/deploy-script-support');
|
|
140
|
-
const { makeHelpers } = dspModule;
|
|
141
|
-
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
142
|
-
await writeCoreEval(startSendAnywhere.name, defaultProposalBuilder);
|
|
143
|
-
};
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file This is for use in tests in a3p-integration
|
|
3
|
-
* Unlike most builder scripts, this one includes the proposal exports as well.
|
|
4
|
-
*/
|
|
5
|
-
import {
|
|
6
|
-
deeplyFulfilledObject,
|
|
7
|
-
makeTracer,
|
|
8
|
-
NonNullish,
|
|
9
|
-
} from '@agoric/internal';
|
|
10
|
-
import { E } from '@endo/far';
|
|
11
|
-
|
|
12
|
-
/// <reference types="@agoric/vats/src/core/types-ambient"/>
|
|
13
|
-
/**
|
|
14
|
-
* @import {Installation} from '@agoric/zoe/src/zoeService/utils.js';
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
const trace = makeTracer('StartSA', true);
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @import {start as StartFn} from '@agoric/orchestration/src/examples/send-anywhere.contract.js';
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @param {BootstrapPowers & {
|
|
25
|
-
* installation: {
|
|
26
|
-
* consume: {
|
|
27
|
-
* sendAnywhere: Installation<StartFn>;
|
|
28
|
-
* };
|
|
29
|
-
* };
|
|
30
|
-
* }} powers
|
|
31
|
-
*/
|
|
32
|
-
export const startSendAnywhere = async ({
|
|
33
|
-
consume: {
|
|
34
|
-
agoricNames,
|
|
35
|
-
board,
|
|
36
|
-
chainStorage,
|
|
37
|
-
chainTimerService,
|
|
38
|
-
cosmosInterchainService,
|
|
39
|
-
localchain,
|
|
40
|
-
startUpgradable,
|
|
41
|
-
},
|
|
42
|
-
installation: {
|
|
43
|
-
consume: { sendAnywhere },
|
|
44
|
-
},
|
|
45
|
-
instance: {
|
|
46
|
-
// @ts-expect-error unknown instance
|
|
47
|
-
produce: { sendAnywhere: produceInstance },
|
|
48
|
-
},
|
|
49
|
-
issuer: {
|
|
50
|
-
consume: { IST },
|
|
51
|
-
},
|
|
52
|
-
}) => {
|
|
53
|
-
trace(startSendAnywhere.name);
|
|
54
|
-
|
|
55
|
-
const marshaller = await E(board).getReadonlyMarshaller();
|
|
56
|
-
|
|
57
|
-
const privateArgs = await deeplyFulfilledObject(
|
|
58
|
-
harden({
|
|
59
|
-
agoricNames,
|
|
60
|
-
localchain,
|
|
61
|
-
marshaller,
|
|
62
|
-
orchestrationService: cosmosInterchainService,
|
|
63
|
-
storageNode: E(NonNullish(await chainStorage)).makeChildNode(
|
|
64
|
-
'send-anywhere',
|
|
65
|
-
),
|
|
66
|
-
timerService: chainTimerService,
|
|
67
|
-
}),
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
const { instance } = await E(startUpgradable)({
|
|
71
|
-
label: 'send-anywhere',
|
|
72
|
-
installation: sendAnywhere,
|
|
73
|
-
issuerKeywordRecord: { Stable: await IST },
|
|
74
|
-
privateArgs,
|
|
75
|
-
});
|
|
76
|
-
produceInstance.resolve(instance);
|
|
77
|
-
trace('done');
|
|
78
|
-
};
|
|
79
|
-
harden(startSendAnywhere);
|
|
80
|
-
|
|
81
|
-
export const getManifest = ({ restoreRef }, { installationRef }) => {
|
|
82
|
-
return {
|
|
83
|
-
manifest: {
|
|
84
|
-
[startSendAnywhere.name]: {
|
|
85
|
-
consume: {
|
|
86
|
-
agoricNames: true,
|
|
87
|
-
board: true,
|
|
88
|
-
chainStorage: true,
|
|
89
|
-
chainTimerService: true,
|
|
90
|
-
cosmosInterchainService: true,
|
|
91
|
-
localchain: true,
|
|
92
|
-
|
|
93
|
-
startUpgradable: true,
|
|
94
|
-
},
|
|
95
|
-
installation: {
|
|
96
|
-
consume: { sendAnywhere: true },
|
|
97
|
-
},
|
|
98
|
-
instance: {
|
|
99
|
-
produce: { sendAnywhere: true },
|
|
100
|
-
},
|
|
101
|
-
issuer: {
|
|
102
|
-
consume: { IST: true },
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
installations: {
|
|
107
|
-
sendAnywhere: restoreRef(installationRef),
|
|
108
|
-
},
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
113
|
-
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
114
|
-
harden({
|
|
115
|
-
// Somewhat unorthodox, source the exports from this builder module
|
|
116
|
-
sourceSpec: '@agoric/builders/scripts/testing/start-send-anywhere.js',
|
|
117
|
-
getManifestCall: [
|
|
118
|
-
getManifest.name,
|
|
119
|
-
{
|
|
120
|
-
installationRef: publishRef(
|
|
121
|
-
install(
|
|
122
|
-
'@agoric/orchestration/src/examples/send-anywhere.contract.js',
|
|
123
|
-
),
|
|
124
|
-
),
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
130
|
-
export default async (homeP, endowments) => {
|
|
131
|
-
// import dynamically so the module can work in CoreEval environment
|
|
132
|
-
const dspModule = await import('@agoric/deploy-script-support');
|
|
133
|
-
const { makeHelpers } = dspModule;
|
|
134
|
-
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
135
|
-
await writeCoreEval(startSendAnywhere.name, defaultProposalBuilder);
|
|
136
|
-
};
|