@agoric/builders 0.1.1-orchestration-dev-096c4e8.0 → 0.1.1-other-dev-fbe72e7.0.fbe72e7
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/package.json +39 -36
- package/scripts/inter-protocol/add-STARS.js +8 -7
- package/scripts/inter-protocol/add-collateral-core.js +12 -8
- package/scripts/inter-protocol/init-core.js +6 -5
- package/scripts/inter-protocol/invite-committee-core.js +5 -4
- package/scripts/inter-protocol/manual-price-feed.js +4 -0
- package/scripts/inter-protocol/price-feed-core.js +5 -5
- package/scripts/inter-protocol/replace-electorate-core.js +163 -0
- package/scripts/inter-protocol/replace-feeDistributor-combo.js +82 -0
- package/scripts/inter-protocol/replace-feeDistributor.js +36 -0
- package/scripts/inter-protocol/updatePriceFeeds.js +128 -0
- package/scripts/inter-protocol/withdraw-reserve.build.js +68 -0
- package/scripts/orchestration/axelar-gmp.build.js +81 -0
- package/scripts/orchestration/get-chain-config.js +121 -0
- package/scripts/orchestration/helpers.js +46 -0
- package/scripts/orchestration/hook-localchain-msg-send.js +30 -0
- package/scripts/orchestration/init-basic-flows.js +36 -0
- package/scripts/orchestration/init-stakeAtom.js +33 -0
- package/scripts/orchestration/init-stakeBld.js +24 -0
- package/scripts/orchestration/init-stakeOsmo.js +33 -0
- package/scripts/orchestration/write-chain-info.js +14 -0
- package/scripts/pegasus/init-core.js +4 -3
- package/scripts/smart-wallet/build-game1-start.js +5 -4
- package/scripts/smart-wallet/build-wallet-factory2-upgrade.js +4 -3
- package/scripts/smart-wallet/build-walletFactory-upgrade.js +4 -3
- package/scripts/testing/add-LEMONS.js +24 -0
- package/scripts/testing/add-OLIVES.js +23 -0
- package/scripts/testing/add-USD-LEMONS.js +19 -0
- package/scripts/testing/add-USD-OLIVES.js +19 -0
- package/scripts/testing/append-chain-info.js +50 -0
- package/scripts/testing/init-auto-stake-it.js +42 -0
- package/scripts/testing/init-send-anywhere.js +36 -0
- package/scripts/testing/init-swap-anything.js +36 -0
- package/scripts/testing/provokeBOYD.js +54 -0
- package/scripts/testing/publish-test-info.js +79 -0
- package/scripts/testing/recorded-retired-instances.js +81 -0
- package/scripts/testing/register-interchain-bank-assets.js +199 -0
- package/scripts/testing/replace-feeDistributor-short.js +33 -0
- package/scripts/testing/restart-axelar-gmp.js +94 -0
- package/scripts/testing/restart-basic-flows.js +101 -0
- package/scripts/testing/restart-send-anywhere.js +101 -0
- package/scripts/testing/restart-stakeAtom.js +91 -0
- package/scripts/testing/restart-valueVow.js +82 -0
- package/scripts/testing/start-query-flows.js +155 -0
- package/scripts/testing/start-valueVow.js +93 -0
- package/scripts/testing/test-upgraded-board.js +15 -0
- package/scripts/testing/tweak-chain-info.js +56 -0
- package/scripts/testing/upgrade-send-anywhere.js +139 -0
- package/scripts/testing/upgrade-vaultFactory.js +21 -0
- package/scripts/vats/add-auction.js +31 -0
- package/scripts/vats/init-core.js +4 -3
- package/scripts/vats/init-localchain.js +4 -3
- package/scripts/vats/init-network.js +4 -3
- package/scripts/vats/init-orchestration.js +21 -0
- package/scripts/vats/init-transfer.js +19 -0
- package/scripts/vats/priceFeedSupport.js +90 -0
- package/scripts/vats/probe-zcf-bundle.js +4 -3
- package/scripts/vats/replace-provisioning.js +4 -3
- package/scripts/vats/replace-zoe.js +4 -3
- package/scripts/vats/restart-vats.js +4 -3
- package/scripts/vats/revive-kread.js +14 -0
- package/scripts/vats/test-localchain.js +4 -3
- package/scripts/vats/test-vtransfer.js +19 -0
- package/scripts/vats/updateAtomPriceFeed.js +22 -0
- package/scripts/vats/updateStAtomPriceFeed.js +22 -0
- package/scripts/vats/updateStOsmoPriceFeed.js +22 -0
- package/scripts/vats/updateStTiaPriceFeed.js +22 -0
- package/scripts/vats/updateStkAtomPriceFeed.js +22 -0
- package/scripts/vats/upgrade-agoricNames.js +21 -0
- package/scripts/vats/upgrade-asset-reserve.js +21 -0
- package/scripts/vats/upgrade-bank.js +19 -0
- package/scripts/vats/upgrade-board.js +20 -0
- package/scripts/vats/upgrade-mintHolder.js +105 -0
- package/scripts/vats/upgrade-orchestration.js +21 -0
- package/scripts/vats/upgrade-paRegistry.js +21 -0
- package/scripts/vats/upgrade-provisionPool-to-BLD.js +25 -0
- package/scripts/vats/upgrade-provisionPool.js +21 -0
- package/scripts/vats/upgrade-psm.js +19 -0
- package/scripts/vats/upgrade-vats.js +49 -0
- package/scripts/vats/upgrade-zcf.js +19 -0
- package/scripts/vats/upgrade-zoe.js +4 -3
- package/scripts/vats/upgradeScaledPriceAuthorities.js +23 -0
- package/scripts/vats/upgradeVaults.js +24 -0
- package/tsconfig.json +0 -2
- package/index.js +0 -2
- package/scripts/inter-protocol/deploy-contracts.js +0 -110
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file register-interchain-bank-assets.js Core Eval
|
|
3
|
+
*
|
|
4
|
+
* Used to populate vbank in testing environments.
|
|
5
|
+
*/
|
|
6
|
+
import { AssetKind } from '@agoric/ertp';
|
|
7
|
+
import { makeTracer } from '@agoric/internal';
|
|
8
|
+
import { E } from '@endo/far';
|
|
9
|
+
import { makeMarshal } from '@endo/marshal';
|
|
10
|
+
|
|
11
|
+
const { Fail } = assert;
|
|
12
|
+
|
|
13
|
+
const trace = makeTracer('RegisterInterchainBankAssets', true);
|
|
14
|
+
|
|
15
|
+
/** @import {Board} from '@agoric/vats'; */
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @typedef {object} InterchainAssetOptions
|
|
19
|
+
* @property {string} denom
|
|
20
|
+
* @property {number} decimalPlaces
|
|
21
|
+
* @property {string} issuerName
|
|
22
|
+
* @property {string} keyword - defaults to `issuerName` if not provided
|
|
23
|
+
* @property {string} [proposedName] - defaults to `issuerName` if not provided
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
// vstorage paths under published.*
|
|
27
|
+
const BOARD_AUX = 'boardAux';
|
|
28
|
+
|
|
29
|
+
const marshalData = makeMarshal(_val => Fail`data only`);
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Make a storage node for auxiliary data for a value on the board.
|
|
33
|
+
*
|
|
34
|
+
* @param {ERef<StorageNode>} chainStorage
|
|
35
|
+
* @param {string} boardId
|
|
36
|
+
*/
|
|
37
|
+
const makeBoardAuxNode = async (chainStorage, boardId) => {
|
|
38
|
+
const boardAux = E(chainStorage).makeChildNode(BOARD_AUX);
|
|
39
|
+
return E(boardAux).makeChildNode(boardId);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* see `publishAgoricBrandsDisplayInfo` {@link @agoric/smart-wallet/proposals/upgrade-walletFactory-proposal.js}
|
|
44
|
+
*
|
|
45
|
+
* @param {ERef<StorageNode>} chainStorage
|
|
46
|
+
* @param {ERef<Board>} board
|
|
47
|
+
* @param {Brand<'nat'>} brand
|
|
48
|
+
*/
|
|
49
|
+
const publishBrandInfo = async (chainStorage, board, brand) => {
|
|
50
|
+
const [boardId, displayInfo, allegedName] = await Promise.all([
|
|
51
|
+
E(board).getId(brand),
|
|
52
|
+
E(brand).getDisplayInfo(),
|
|
53
|
+
E(brand).getAllegedName(),
|
|
54
|
+
]);
|
|
55
|
+
const node = makeBoardAuxNode(chainStorage, boardId);
|
|
56
|
+
const aux = marshalData.toCapData(harden({ allegedName, displayInfo }));
|
|
57
|
+
await E(node).setValue(JSON.stringify(aux));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @param {BootstrapPowers} powers
|
|
62
|
+
* @param {object} config
|
|
63
|
+
* @param {object} config.options
|
|
64
|
+
* @param {InterchainAssetOptions[]} config.options.assets
|
|
65
|
+
*/
|
|
66
|
+
export const publishInterchainAssets = async (
|
|
67
|
+
{
|
|
68
|
+
consume: {
|
|
69
|
+
agoricNamesAdmin,
|
|
70
|
+
bankManager,
|
|
71
|
+
board,
|
|
72
|
+
chainStorage,
|
|
73
|
+
startUpgradable,
|
|
74
|
+
},
|
|
75
|
+
brand: { produce: produceBrands },
|
|
76
|
+
issuer: { produce: produceIssuers },
|
|
77
|
+
installation: {
|
|
78
|
+
consume: { mintHolder },
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{ options: { assets } },
|
|
82
|
+
) => {
|
|
83
|
+
trace(`${publishInterchainAssets.name} starting...`);
|
|
84
|
+
trace(assets);
|
|
85
|
+
await null;
|
|
86
|
+
for (const interchainAssetOptions of assets) {
|
|
87
|
+
const {
|
|
88
|
+
denom,
|
|
89
|
+
decimalPlaces,
|
|
90
|
+
issuerName,
|
|
91
|
+
keyword = issuerName,
|
|
92
|
+
proposedName = issuerName,
|
|
93
|
+
} = interchainAssetOptions;
|
|
94
|
+
|
|
95
|
+
trace('interchainAssetOptions', {
|
|
96
|
+
denom,
|
|
97
|
+
decimalPlaces,
|
|
98
|
+
issuerName,
|
|
99
|
+
keyword,
|
|
100
|
+
proposedName,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
assert.typeof(denom, 'string');
|
|
104
|
+
assert.typeof(decimalPlaces, 'number');
|
|
105
|
+
assert.typeof(keyword, 'string');
|
|
106
|
+
assert.typeof(issuerName, 'string');
|
|
107
|
+
assert.typeof(proposedName, 'string');
|
|
108
|
+
|
|
109
|
+
const terms = {
|
|
110
|
+
keyword: issuerName, // "keyword" is a misnomer in mintHolder terms
|
|
111
|
+
assetKind: AssetKind.NAT,
|
|
112
|
+
displayInfo: {
|
|
113
|
+
decimalPlaces,
|
|
114
|
+
assetKind: AssetKind.NAT,
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
const { creatorFacet: mint, publicFacet: issuer } = await E(
|
|
118
|
+
startUpgradable,
|
|
119
|
+
)({
|
|
120
|
+
installation: mintHolder,
|
|
121
|
+
label: issuerName,
|
|
122
|
+
privateArgs: undefined,
|
|
123
|
+
terms,
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
const brand = await E(issuer).getBrand();
|
|
127
|
+
const kit = /** @type {IssuerKit<'nat'>} */ ({ mint, issuer, brand });
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* `addAssetToVault.js` will register the issuer with the `reserveKit`,
|
|
131
|
+
* but we don't need to do that here.
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
await Promise.all([
|
|
135
|
+
E(E(agoricNamesAdmin).lookupAdmin('issuer')).update(issuerName, issuer),
|
|
136
|
+
E(E(agoricNamesAdmin).lookupAdmin('brand')).update(issuerName, brand),
|
|
137
|
+
// triggers benign UnhandledPromiseRejection 'Error: keyword "ATOM" must
|
|
138
|
+
// be unique' in provisionPool in testing environments
|
|
139
|
+
E(bankManager).addAsset(denom, issuerName, proposedName, kit),
|
|
140
|
+
]);
|
|
141
|
+
|
|
142
|
+
// publish brands and issuers to Bootstrap space for use in proposals
|
|
143
|
+
produceBrands[keyword].reset();
|
|
144
|
+
produceIssuers[keyword].reset();
|
|
145
|
+
produceBrands[keyword].resolve(brand);
|
|
146
|
+
produceIssuers[keyword].resolve(issuer);
|
|
147
|
+
|
|
148
|
+
// publish brand info / boardAux for offer legibility
|
|
149
|
+
await publishBrandInfo(
|
|
150
|
+
// @ts-expect-error 'Promise<StorageNode | null>' is not assignable to
|
|
151
|
+
// parameter of type 'ERef<StorageNode>'
|
|
152
|
+
chainStorage,
|
|
153
|
+
board,
|
|
154
|
+
brand,
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
trace(`${publishInterchainAssets.name} complete`);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* @param {unknown} _powers
|
|
162
|
+
* @param {{ assets: InterchainAssetOptions[] }} options
|
|
163
|
+
*/
|
|
164
|
+
export const getManifestCall = (_powers, options) => {
|
|
165
|
+
/** @type {Record<string, true>} */
|
|
166
|
+
const IssuerKws = options.assets.reduce(
|
|
167
|
+
/**
|
|
168
|
+
* @param {Record<string, true>} acc
|
|
169
|
+
* @param {InterchainAssetOptions} assetOptions
|
|
170
|
+
*/
|
|
171
|
+
(acc, { issuerName }) => Object.assign(acc, { [issuerName]: true }),
|
|
172
|
+
{},
|
|
173
|
+
);
|
|
174
|
+
harden(IssuerKws);
|
|
175
|
+
|
|
176
|
+
return {
|
|
177
|
+
manifest: {
|
|
178
|
+
[publishInterchainAssets.name]: {
|
|
179
|
+
consume: {
|
|
180
|
+
agoricNamesAdmin: true,
|
|
181
|
+
bankManager: true,
|
|
182
|
+
board: true,
|
|
183
|
+
chainStorage: true,
|
|
184
|
+
startUpgradable: true,
|
|
185
|
+
},
|
|
186
|
+
brand: {
|
|
187
|
+
produce: IssuerKws,
|
|
188
|
+
},
|
|
189
|
+
issuer: {
|
|
190
|
+
produce: IssuerKws,
|
|
191
|
+
},
|
|
192
|
+
installation: {
|
|
193
|
+
consume: { mintHolder: true },
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
options,
|
|
198
|
+
};
|
|
199
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { getManifestForReplaceFeeDistributor } from '@agoric/inter-protocol/src/proposals/replace-fee-distributor.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @file
|
|
6
|
+
* a Variant of ../inter-protocol/replace-feeDistributor.js that shortens the
|
|
7
|
+
* collectionInterval for testing
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
11
|
+
export const defaultProposalBuilder = async (_, opts) => {
|
|
12
|
+
console.log('feeDist OPTS', opts);
|
|
13
|
+
return harden({
|
|
14
|
+
sourceSpec:
|
|
15
|
+
'@agoric/inter-protocol/src/proposals/replace-fee-distributor.js',
|
|
16
|
+
getManifestCall: [getManifestForReplaceFeeDistributor.name, { ...opts }],
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
21
|
+
export default async (homeP, endowments) => {
|
|
22
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
23
|
+
|
|
24
|
+
await writeCoreEval('replace-feeDistributor-testing', utils =>
|
|
25
|
+
defaultProposalBuilder(utils, {
|
|
26
|
+
collectionInterval: 30n,
|
|
27
|
+
keywordShares: {
|
|
28
|
+
RewardDistributor: 0n,
|
|
29
|
+
Reserve: 1n,
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
const trace = makeTracer('StartAxelarGmp', true);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @import {start as StartFn} from '@agoric/orchestration/src/examples/axelar-gmp.contract.js';
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param {BootstrapPowers} powers
|
|
22
|
+
*/
|
|
23
|
+
export const restartAxelarGmp = async ({
|
|
24
|
+
consume: {
|
|
25
|
+
agoricNames,
|
|
26
|
+
board,
|
|
27
|
+
chainStorage,
|
|
28
|
+
chainTimerService,
|
|
29
|
+
cosmosInterchainService,
|
|
30
|
+
localchain,
|
|
31
|
+
contractKits,
|
|
32
|
+
},
|
|
33
|
+
instance: instances,
|
|
34
|
+
}) => {
|
|
35
|
+
trace(restartAxelarGmp.name);
|
|
36
|
+
|
|
37
|
+
const marshaller = await E(board).getReadonlyMarshaller();
|
|
38
|
+
const privateArgs = await deeplyFulfilledObject(
|
|
39
|
+
harden({
|
|
40
|
+
agoricNames,
|
|
41
|
+
localchain,
|
|
42
|
+
marshaller,
|
|
43
|
+
orchestrationService: cosmosInterchainService,
|
|
44
|
+
storageNode: E(NonNullish(await chainStorage)).makeChildNode('axelarGmp'),
|
|
45
|
+
timerService: chainTimerService,
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// @ts-expect-error unknown instance
|
|
50
|
+
const instance = await instances.consume.axelarGmp;
|
|
51
|
+
trace('instance', instance);
|
|
52
|
+
/** @type {StartedInstanceKit<StartFn>} */
|
|
53
|
+
const kit = /** @type {any} */ (await E(contractKits).get(instance));
|
|
54
|
+
|
|
55
|
+
await E(kit.adminFacet).restartContract(privateArgs);
|
|
56
|
+
trace('done');
|
|
57
|
+
};
|
|
58
|
+
harden(restartAxelarGmp);
|
|
59
|
+
|
|
60
|
+
export const getManifest = () => {
|
|
61
|
+
return {
|
|
62
|
+
manifest: {
|
|
63
|
+
[restartAxelarGmp.name]: {
|
|
64
|
+
consume: {
|
|
65
|
+
agoricNames: true,
|
|
66
|
+
board: true,
|
|
67
|
+
chainTimerService: true,
|
|
68
|
+
chainStorage: true,
|
|
69
|
+
cosmosInterchainService: true,
|
|
70
|
+
localchain: true,
|
|
71
|
+
contractKits: true,
|
|
72
|
+
},
|
|
73
|
+
instance: {
|
|
74
|
+
consume: { axelarGmp: true },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
82
|
+
export const defaultProposalBuilder = async () =>
|
|
83
|
+
harden({
|
|
84
|
+
sourceSpec: '@agoric/builders/scripts/testing/restart-axelar-gmp.js',
|
|
85
|
+
getManifestCall: [getManifest.name],
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
89
|
+
export default async (homeP, endowments) => {
|
|
90
|
+
const dspModule = await import('@agoric/deploy-script-support');
|
|
91
|
+
const { makeHelpers } = dspModule;
|
|
92
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
93
|
+
await writeCoreEval(restartAxelarGmp.name, defaultProposalBuilder);
|
|
94
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file This is for use in tests.
|
|
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
|
+
const trace = makeTracer('RestartBasicFlows', true);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @import {start as StartFn} from '@agoric/orchestration/src/examples/basic-flows.contract.js';
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param {BootstrapPowers} powers
|
|
22
|
+
*/
|
|
23
|
+
export const restartBasicFlows = async ({
|
|
24
|
+
consume: {
|
|
25
|
+
agoricNames,
|
|
26
|
+
board,
|
|
27
|
+
chainStorage,
|
|
28
|
+
chainTimerService,
|
|
29
|
+
cosmosInterchainService,
|
|
30
|
+
localchain,
|
|
31
|
+
|
|
32
|
+
contractKits,
|
|
33
|
+
},
|
|
34
|
+
instance: instances,
|
|
35
|
+
}) => {
|
|
36
|
+
trace(restartBasicFlows.name);
|
|
37
|
+
|
|
38
|
+
// @ts-expect-error unknown instance
|
|
39
|
+
const instance = await instances.consume.basicFlows;
|
|
40
|
+
trace('instance', instance);
|
|
41
|
+
/** @type {StartedInstanceKit<StartFn>} */
|
|
42
|
+
const kit = /** @type {any} */ (await E(contractKits).get(instance));
|
|
43
|
+
|
|
44
|
+
const marshaller = await E(board).getReadonlyMarshaller();
|
|
45
|
+
|
|
46
|
+
const privateArgs = await deeplyFulfilledObject(
|
|
47
|
+
harden({
|
|
48
|
+
agoricNames,
|
|
49
|
+
localchain,
|
|
50
|
+
marshaller,
|
|
51
|
+
orchestrationService: cosmosInterchainService,
|
|
52
|
+
storageNode: E(NonNullish(await chainStorage)).makeChildNode(
|
|
53
|
+
'basicFlows',
|
|
54
|
+
),
|
|
55
|
+
timerService: chainTimerService,
|
|
56
|
+
}),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
await E(kit.adminFacet).restartContract(privateArgs);
|
|
60
|
+
trace('done');
|
|
61
|
+
};
|
|
62
|
+
harden(restartBasicFlows);
|
|
63
|
+
|
|
64
|
+
export const getManifest = () => {
|
|
65
|
+
return {
|
|
66
|
+
manifest: {
|
|
67
|
+
[restartBasicFlows.name]: {
|
|
68
|
+
consume: {
|
|
69
|
+
agoricNames: true,
|
|
70
|
+
board: true,
|
|
71
|
+
chainStorage: true,
|
|
72
|
+
chainTimerService: true,
|
|
73
|
+
cosmosInterchainService: true,
|
|
74
|
+
localchain: true,
|
|
75
|
+
|
|
76
|
+
contractKits: true,
|
|
77
|
+
},
|
|
78
|
+
instance: {
|
|
79
|
+
consume: { basicFlows: true },
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
87
|
+
export const defaultProposalBuilder = async () =>
|
|
88
|
+
harden({
|
|
89
|
+
// Somewhat unorthodox, source the exports from this builder module
|
|
90
|
+
sourceSpec: '@agoric/builders/scripts/testing/restart-basic-flows.js',
|
|
91
|
+
getManifestCall: [getManifest.name],
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
95
|
+
export default async (homeP, endowments) => {
|
|
96
|
+
// import dynamically so the module can work in CoreEval environment
|
|
97
|
+
const dspModule = await import('@agoric/deploy-script-support');
|
|
98
|
+
const { makeHelpers } = dspModule;
|
|
99
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
100
|
+
await writeCoreEval(restartBasicFlows.name, defaultProposalBuilder);
|
|
101
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
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
|
+
const trace = makeTracer('StartSA', true);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @import {start as StartFn} from '@agoric/orchestration/src/examples/send-anywhere.contract.js';
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param {BootstrapPowers} powers
|
|
22
|
+
*/
|
|
23
|
+
export const restartSendAnywhere = async ({
|
|
24
|
+
consume: {
|
|
25
|
+
agoricNames,
|
|
26
|
+
board,
|
|
27
|
+
chainStorage,
|
|
28
|
+
chainTimerService,
|
|
29
|
+
cosmosInterchainService,
|
|
30
|
+
localchain,
|
|
31
|
+
|
|
32
|
+
contractKits,
|
|
33
|
+
},
|
|
34
|
+
instance: instances,
|
|
35
|
+
}) => {
|
|
36
|
+
trace(restartSendAnywhere.name);
|
|
37
|
+
|
|
38
|
+
// @ts-expect-error unknown instance
|
|
39
|
+
const instance = await instances.consume.sendAnywhere;
|
|
40
|
+
trace('instance', instance);
|
|
41
|
+
/** @type {StartedInstanceKit<StartFn>} */
|
|
42
|
+
const kit = /** @type {any} */ (await E(contractKits).get(instance));
|
|
43
|
+
|
|
44
|
+
const marshaller = await E(board).getReadonlyMarshaller();
|
|
45
|
+
|
|
46
|
+
const privateArgs = await deeplyFulfilledObject(
|
|
47
|
+
harden({
|
|
48
|
+
agoricNames,
|
|
49
|
+
localchain,
|
|
50
|
+
marshaller,
|
|
51
|
+
orchestrationService: cosmosInterchainService,
|
|
52
|
+
storageNode: E(NonNullish(await chainStorage)).makeChildNode(
|
|
53
|
+
'sendAnywhere',
|
|
54
|
+
),
|
|
55
|
+
timerService: chainTimerService,
|
|
56
|
+
}),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
await E(kit.adminFacet).restartContract(privateArgs);
|
|
60
|
+
trace('done');
|
|
61
|
+
};
|
|
62
|
+
harden(restartSendAnywhere);
|
|
63
|
+
|
|
64
|
+
export const getManifest = () => {
|
|
65
|
+
return {
|
|
66
|
+
manifest: {
|
|
67
|
+
[restartSendAnywhere.name]: {
|
|
68
|
+
consume: {
|
|
69
|
+
agoricNames: true,
|
|
70
|
+
board: true,
|
|
71
|
+
chainStorage: true,
|
|
72
|
+
chainTimerService: true,
|
|
73
|
+
cosmosInterchainService: true,
|
|
74
|
+
localchain: true,
|
|
75
|
+
|
|
76
|
+
contractKits: true,
|
|
77
|
+
},
|
|
78
|
+
instance: {
|
|
79
|
+
consume: { sendAnywhere: true },
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
87
|
+
export const defaultProposalBuilder = async () =>
|
|
88
|
+
harden({
|
|
89
|
+
// Somewhat unorthodox, source the exports from this builder module
|
|
90
|
+
sourceSpec: '@agoric/builders/scripts/testing/restart-send-anywhere.js',
|
|
91
|
+
getManifestCall: [getManifest.name],
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
95
|
+
export default async (homeP, endowments) => {
|
|
96
|
+
// import dynamically so the module can work in CoreEval environment
|
|
97
|
+
const dspModule = await import('@agoric/deploy-script-support');
|
|
98
|
+
const { makeHelpers } = dspModule;
|
|
99
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
100
|
+
await writeCoreEval(restartSendAnywhere.name, defaultProposalBuilder);
|
|
101
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
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 { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
|
|
6
|
+
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
|
|
7
|
+
import { E } from '@endo/far';
|
|
8
|
+
|
|
9
|
+
/// <reference types="@agoric/vats/src/core/types-ambient"/>
|
|
10
|
+
|
|
11
|
+
const trace = makeTracer('RestartSA', true);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @import {start as StartFn} from '@agoric/orchestration/src/examples/stake-ica.contract.js';
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @param {BootstrapPowers} powers
|
|
19
|
+
*/
|
|
20
|
+
export const restartStakeAtom = async ({
|
|
21
|
+
consume: {
|
|
22
|
+
agoricNames,
|
|
23
|
+
board,
|
|
24
|
+
chainStorage,
|
|
25
|
+
chainTimerService,
|
|
26
|
+
cosmosInterchainService,
|
|
27
|
+
contractKits,
|
|
28
|
+
},
|
|
29
|
+
instance: instances,
|
|
30
|
+
}) => {
|
|
31
|
+
trace(restartStakeAtom.name);
|
|
32
|
+
|
|
33
|
+
const instance = await instances.consume.stakeAtom;
|
|
34
|
+
trace('instance', instance);
|
|
35
|
+
|
|
36
|
+
/** @type {StartedInstanceKit<StartFn>} */
|
|
37
|
+
const kit = /** @type {any} */ (await E(contractKits).get(instance));
|
|
38
|
+
|
|
39
|
+
const marshaller = await E(board).getReadonlyMarshaller();
|
|
40
|
+
|
|
41
|
+
const privateArgs = await deeplyFulfilledObject(
|
|
42
|
+
harden({
|
|
43
|
+
agoricNames,
|
|
44
|
+
cosmosInterchainService,
|
|
45
|
+
storageNode: makeStorageNodeChild(chainStorage, 'stakeAtom'),
|
|
46
|
+
marshaller,
|
|
47
|
+
timer: chainTimerService,
|
|
48
|
+
}),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
await E(kit.adminFacet).restartContract(privateArgs);
|
|
52
|
+
trace('done');
|
|
53
|
+
};
|
|
54
|
+
harden(restartStakeAtom);
|
|
55
|
+
|
|
56
|
+
export const getManifest = () => {
|
|
57
|
+
return {
|
|
58
|
+
manifest: {
|
|
59
|
+
[restartStakeAtom.name]: {
|
|
60
|
+
consume: {
|
|
61
|
+
agoricNames: true,
|
|
62
|
+
board: true,
|
|
63
|
+
chainStorage: true,
|
|
64
|
+
chainTimerService: true,
|
|
65
|
+
cosmosInterchainService: true,
|
|
66
|
+
contractKits: true,
|
|
67
|
+
},
|
|
68
|
+
instance: {
|
|
69
|
+
consume: { stakeAtom: true },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
77
|
+
export const defaultProposalBuilder = async () =>
|
|
78
|
+
harden({
|
|
79
|
+
// Somewhat unorthodox, source the exports from this builder module
|
|
80
|
+
sourceSpec: '@agoric/builders/scripts/testing/restart-stakeAtom.js',
|
|
81
|
+
getManifestCall: [getManifest.name],
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
85
|
+
export default async (homeP, endowments) => {
|
|
86
|
+
// import dynamically so the module can work in CoreEval environment
|
|
87
|
+
const dspModule = await import('@agoric/deploy-script-support');
|
|
88
|
+
const { makeHelpers } = dspModule;
|
|
89
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
90
|
+
await writeCoreEval(restartStakeAtom.name, defaultProposalBuilder);
|
|
91
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
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 { makeTracer } from '@agoric/internal';
|
|
6
|
+
import { E } from '@endo/far';
|
|
7
|
+
|
|
8
|
+
/// <reference types="@agoric/vats/src/core/types-ambient"/>
|
|
9
|
+
/**
|
|
10
|
+
* @import {Instance} from '@agoric/zoe/src/zoeService/utils.js';
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const trace = makeTracer('RestartValueVow', true);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @param {BootstrapPowers & {
|
|
17
|
+
* instance: {
|
|
18
|
+
* consume: {
|
|
19
|
+
* valueVow: Instance<
|
|
20
|
+
* import('@agoric/zoe/src/contracts/valueVow.contract.js').start
|
|
21
|
+
* >;
|
|
22
|
+
* };
|
|
23
|
+
* };
|
|
24
|
+
* }} powers
|
|
25
|
+
*/
|
|
26
|
+
export const restartValueVow = async ({
|
|
27
|
+
consume: { contractKits },
|
|
28
|
+
instance: instances,
|
|
29
|
+
}) => {
|
|
30
|
+
trace(restartValueVow.name);
|
|
31
|
+
|
|
32
|
+
const vvInstance = await instances.consume.valueVow;
|
|
33
|
+
trace('vvInstance', vvInstance);
|
|
34
|
+
const vvKit = await E(contractKits).get(vvInstance);
|
|
35
|
+
|
|
36
|
+
await E(vvKit.adminFacet).restartContract({});
|
|
37
|
+
trace('done');
|
|
38
|
+
};
|
|
39
|
+
harden(restartValueVow);
|
|
40
|
+
|
|
41
|
+
export const getManifestForValueVow = ({ restoreRef }, { valueVowRef }) => {
|
|
42
|
+
console.log('valueVowRef', valueVowRef);
|
|
43
|
+
return {
|
|
44
|
+
manifest: {
|
|
45
|
+
[restartValueVow.name]: {
|
|
46
|
+
consume: {
|
|
47
|
+
contractKits: true,
|
|
48
|
+
},
|
|
49
|
+
instance: {
|
|
50
|
+
consume: { valueVow: true },
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
installations: {
|
|
55
|
+
valueVow: restoreRef(valueVowRef),
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
61
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
62
|
+
harden({
|
|
63
|
+
// Somewhat unorthodox, source the exports from this builder module
|
|
64
|
+
sourceSpec: '@agoric/builders/scripts/testing/restart-valueVow.js',
|
|
65
|
+
getManifestCall: [
|
|
66
|
+
'getManifestForValueVow',
|
|
67
|
+
{
|
|
68
|
+
valueVowRef: publishRef(
|
|
69
|
+
install('@agoric/zoe/src/contracts/valueVow.contract.js'),
|
|
70
|
+
),
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
76
|
+
export default async (homeP, endowments) => {
|
|
77
|
+
// import dynamically so the module can work in CoreEval environment
|
|
78
|
+
const dspModule = await import('@agoric/deploy-script-support');
|
|
79
|
+
const { makeHelpers } = dspModule;
|
|
80
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
81
|
+
await writeCoreEval(restartValueVow.name, defaultProposalBuilder);
|
|
82
|
+
};
|