-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes to chainConnection key and vstorage (#9486)
refs: #9063 closes: #8879 ## Description Fast follow on #9376 Tests that uncovered that the JSON.stringify encoding is not a valid vstorage key. There's one character that can be used as a separator `_`, the only vstorage valid char that's not a chain-id valid char. (vstorage chars are superset of chain id chars) Also fixes the chain_id half of the connection key, which had been chain name. Also adds a cache to chain info writer so it doesn't write entries that exist and haven't changed. Some misc test supports as well. ### Security Considerations none ### Scaling Considerations none ### Documentation Considerations Eventually we'll document these new vstorage nodes, but probably by just pointing to some snapshots. ### Testing Considerations The A3P test checks that it works through agd CLI. ### Upgrade Considerations not yet released
- Loading branch information
Showing
13 changed files
with
654 additions
and
167 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
399 changes: 399 additions & 0 deletions
399
packages/boot/test/bootstrapTests/snapshots/orchestration.test.ts.md
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+7.52 KB
packages/boot/test/bootstrapTests/snapshots/orchestration.test.ts.snap
Binary file not shown.
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,37 +1 @@ | ||
import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js'; | ||
|
||
/** | ||
* @param {import('ava').ExecutionContext<unknown>} t | ||
* @param {import('@agoric/internal/src/storage-test-utils.js').MockChainStorageRoot} storage | ||
* @param {({ note: string } | { node: string, owner: string }) & | ||
* ({ pattern: string, replacement: string } | {}) | ||
* } opts | ||
*/ | ||
export const documentStorageSchema = async (t, storage, opts) => { | ||
// chainStorage publication is unsynchronized | ||
await eventLoopIteration(); | ||
|
||
const { pattern, replacement } = | ||
'pattern' in opts | ||
? opts | ||
: { pattern: 'mockChainStorageRoot.', replacement: 'published.' }; | ||
const illustration = [...storage.keys()].sort().map( | ||
/** @type {(k: string) => [string, unknown]} */ | ||
key => [key.replace(pattern, replacement), storage.getBody(key)], | ||
); | ||
const pruned = illustration.filter( | ||
'node' in opts | ||
? ([key, _]) => key.startsWith(`published.${opts.node}`) | ||
: _entry => true, | ||
); | ||
|
||
const note = | ||
'note' in opts | ||
? opts.note | ||
: `Under "published", the "${opts.node}" node is delegated to ${opts.owner}.`; | ||
const boilerplate = ` | ||
The example below illustrates the schema of the data published there. | ||
See also board marshalling conventions (_to appear_).`; | ||
t.snapshot(pruned, note + boilerplate); | ||
}; | ||
export { documentStorageSchema } from '@agoric/internal/src/storage-test-utils.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
Oops, something went wrong.