-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adopt Remote type in orchestration (#9406)
## Description Many instances of `ERef` are more accurately typed as `Remote`. This moves that type from the `vow` package down to `internal` to be used more broadly. (Eventually it will move to Endo.) It also adopts the type in `orchestration` package to get its benefits. I chose this package because we're working in it actively. I didn't go and migrate the many other places. ### Security Considerations n/a, types ### Scaling Considerations n/a, types ### Documentation Considerations More implicit docs ### Testing Considerations CI ### Upgrade Considerations n/a, types
- Loading branch information
Showing
13 changed files
with
97 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Empty JS file to correspond with its .d.ts twin | ||
export {}; |
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,23 @@ | ||
import { expectNotType, expectType } from 'tsd'; | ||
import { E, ERef } from '@endo/far'; | ||
import type { Remote } from '../src/types.js'; | ||
import type { StorageNode } from '../src/lib-chainStorage.js'; | ||
|
||
const eventualStorageNode: ERef<StorageNode> = null as any; | ||
const remoteStorageNode: Remote<StorageNode> = null as any; | ||
|
||
{ | ||
// When awaited, ERef makes the object look local | ||
const storageNode = await eventualStorageNode; | ||
expectType<StorageNode>(storageNode); | ||
expectType<string>(storageNode.getPath()); | ||
} | ||
|
||
{ | ||
// When awaited, Remote is correct | ||
const storageNode = await remoteStorageNode; // no-op | ||
expectType<Remote<StorageNode>>(storageNode); | ||
// @ts-expect-error cannot call remote methods directly | ||
storageNode.getPath(); | ||
expectType<Promise<string>>(E(storageNode).getPath()); | ||
} |
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
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