@agoric/builders 0.1.1-orchestration-dev-096c4e8.0 → 0.1.1-other-dev-3eb1a1d.0
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/index.js +0 -2
- package/package.json +33 -31
- package/scripts/fast-usdc/init-fast-usdc.js +242 -0
- 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.js +28 -0
- package/scripts/inter-protocol/updatePriceFeeds.js +118 -0
- package/scripts/orchestration/init-basic-flows.js +27 -0
- package/scripts/orchestration/init-stakeAtom.js +24 -0
- package/scripts/orchestration/init-stakeBld.js +24 -0
- package/scripts/orchestration/init-stakeOsmo.js +24 -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/append-chain-info.js +48 -0
- package/scripts/testing/fix-buggy-sendAnywhere.js +143 -0
- package/scripts/testing/replace-feeDistributor-short.js +27 -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-auto-stake-it.js +128 -0
- package/scripts/testing/start-buggy-sendAnywhere.js +143 -0
- package/scripts/testing/start-query-flows.js +135 -0
- package/scripts/testing/start-send-anywhere.js +136 -0
- package/scripts/testing/start-valueVow.js +93 -0
- package/scripts/testing/tweak-chain-info.js +51 -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-bank.js +19 -0
- package/scripts/vats/upgrade-orch-core.js +24 -0
- package/scripts/vats/upgrade-provisionPool.js +21 -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/scripts/inter-protocol/deploy-contracts.js +0 -110
|
@@ -0,0 +1,143 @@
|
|
|
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, Instance} from '@agoric/zoe/src/zoeService/utils.js';
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const trace = makeTracer('FixBuggySA', true);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @import {start as StartFn} from '@agoric/orchestration/src/examples/send-anywhere.contract.js';
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @param {BootstrapPowers & {
|
|
25
|
+
* instance: {
|
|
26
|
+
* consume: {
|
|
27
|
+
* sendAnywhere: Instance<StartFn>;
|
|
28
|
+
* };
|
|
29
|
+
* };
|
|
30
|
+
* }} powers
|
|
31
|
+
* @param {...any} rest
|
|
32
|
+
*/
|
|
33
|
+
export const fixSendAnywhere = async (
|
|
34
|
+
{
|
|
35
|
+
consume: {
|
|
36
|
+
agoricNames,
|
|
37
|
+
board,
|
|
38
|
+
chainStorage,
|
|
39
|
+
chainTimerService,
|
|
40
|
+
contractKits,
|
|
41
|
+
cosmosInterchainService,
|
|
42
|
+
localchain,
|
|
43
|
+
},
|
|
44
|
+
instance: instances,
|
|
45
|
+
},
|
|
46
|
+
{ options: { sendAnywhereRef } },
|
|
47
|
+
) => {
|
|
48
|
+
trace(fixSendAnywhere.name);
|
|
49
|
+
|
|
50
|
+
const saInstance = await instances.consume.sendAnywhere;
|
|
51
|
+
trace('saInstance', saInstance);
|
|
52
|
+
const saKit = await E(contractKits).get(saInstance);
|
|
53
|
+
|
|
54
|
+
const marshaller = await E(board).getReadonlyMarshaller();
|
|
55
|
+
|
|
56
|
+
// This apparently pointless wrapper is to maintain structural parity
|
|
57
|
+
// with the buggy core-eval's wrapper to make lookup() hang.
|
|
58
|
+
const agoricNamesResolves = Far('agoricNames that resolves', {
|
|
59
|
+
lookup: async (...args) => {
|
|
60
|
+
return E(agoricNames).lookup(...args);
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const privateArgs = await deeplyFulfilledObject(
|
|
65
|
+
harden({
|
|
66
|
+
agoricNames: agoricNamesResolves,
|
|
67
|
+
localchain,
|
|
68
|
+
marshaller,
|
|
69
|
+
orchestrationService: cosmosInterchainService,
|
|
70
|
+
storageNode: E(NonNullish(await chainStorage)).makeChildNode(
|
|
71
|
+
'sendAnywhere',
|
|
72
|
+
),
|
|
73
|
+
timerService: chainTimerService,
|
|
74
|
+
}),
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
trace('upgrading...');
|
|
78
|
+
await E(saKit.adminFacet).upgradeContract(
|
|
79
|
+
sendAnywhereRef.bundleID,
|
|
80
|
+
privateArgs,
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
trace('done');
|
|
84
|
+
};
|
|
85
|
+
harden(fixSendAnywhere);
|
|
86
|
+
|
|
87
|
+
export const getManifestForValueVow = ({ restoreRef }, { sendAnywhereRef }) => {
|
|
88
|
+
console.log('sendAnywhereRef', sendAnywhereRef);
|
|
89
|
+
return {
|
|
90
|
+
manifest: {
|
|
91
|
+
[fixSendAnywhere.name]: {
|
|
92
|
+
consume: {
|
|
93
|
+
agoricNames: true,
|
|
94
|
+
board: true,
|
|
95
|
+
chainStorage: true,
|
|
96
|
+
chainTimerService: true,
|
|
97
|
+
cosmosInterchainService: true,
|
|
98
|
+
localchain: true,
|
|
99
|
+
|
|
100
|
+
contractKits: true,
|
|
101
|
+
},
|
|
102
|
+
installation: {
|
|
103
|
+
consume: { sendAnywhere: true },
|
|
104
|
+
},
|
|
105
|
+
instance: {
|
|
106
|
+
consume: { sendAnywhere: true },
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
installations: {
|
|
111
|
+
sendAnywhere: restoreRef(sendAnywhereRef),
|
|
112
|
+
},
|
|
113
|
+
options: {
|
|
114
|
+
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/fix-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(fixSendAnywhere.name, defaultProposalBuilder);
|
|
143
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { getManifestForReplaceFeeDistributor } from '@agoric/inter-protocol/src/proposals/replace-fee-distributor.js';
|
|
3
|
+
|
|
4
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
5
|
+
export const defaultProposalBuilder = async (_, opts) => {
|
|
6
|
+
console.log('OPTS', opts);
|
|
7
|
+
return harden({
|
|
8
|
+
sourceSpec:
|
|
9
|
+
'@agoric/inter-protocol/src/proposals/replace-fee-distributor.js',
|
|
10
|
+
getManifestCall: [getManifestForReplaceFeeDistributor.name, { ...opts }],
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
15
|
+
export default async (homeP, endowments) => {
|
|
16
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
17
|
+
|
|
18
|
+
await writeCoreEval('replace-feeDistributor-testing', utils =>
|
|
19
|
+
defaultProposalBuilder(utils, {
|
|
20
|
+
collectionInterval: 30n,
|
|
21
|
+
keywordShares: {
|
|
22
|
+
RewardDistributor: 0n,
|
|
23
|
+
Reserve: 1n,
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
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
|
+
};
|