-
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.
10130 excise SharedStateRecord (#10140)
closes: #10130 ## Description Provide examples of how a contract can have a shared local account, without the race condition of creating it conditionally in a flow. In the course of this I corrected the `LocalOrchestrationAccount` method signatures (particularly `deposit` not returning the Amount). ### Security Considerations none, just example code ### Scaling Considerations none, example code ### Documentation Considerations Examples are implicit documentation. Can be mined for docs site tutorials if the need arises. ### Testing Considerations The upgrade test for `send-anywhere` is disabled, but since this just makes a vow there shouldn't be any upgrade interactions. ### Upgrade Considerations The examples aren't to be deployed. The remove of `sharedStateRecord` won't affect anything on chain. Same for changing the return of `deposit`.
- Loading branch information
Showing
15 changed files
with
152 additions
and
125 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export * from './src/async-flow.js'; | ||
export * from './src/types-index.js'; | ||
export { makeSharedStateRecord } from './src/endowments.js'; |
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,21 @@ | ||
/** | ||
* @file Flows shared by multiple examples | ||
* | ||
* A module with flows can be used be reused across multiple contracts. They are | ||
* bound to a particular contract's context via orchestrateAll. See | ||
* ./send-anywhere.contract.js for example usage. | ||
*/ | ||
/** | ||
* @import {Orchestrator, OrchestrationFlow, LocalAccountMethods} from '../types.js'; | ||
*/ | ||
|
||
/** | ||
* @satisfies {OrchestrationFlow} | ||
* @param {Orchestrator} orch | ||
* @returns {Promise<LocalAccountMethods>} | ||
*/ | ||
export const makeLocalAccount = async orch => { | ||
const agoricChain = await orch.getChain('agoric'); | ||
return agoricChain.makeAccount(); | ||
}; | ||
harden(makeLocalAccount); |
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
Binary file modified
BIN
+195 Bytes
(110%)
packages/orchestration/test/examples/snapshots/send-anywhere.test.ts.snap
Binary file not shown.
Oops, something went wrong.