-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7368 from Agoric/dc-auction-rpc-snapshot
test(inter-protocol): snapshot storage/RPC API for auction, vaultFactory, reserve, psm, committees
- Loading branch information
Showing
22 changed files
with
1,164 additions
and
21 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
packages/governance/test/unitTests/snapshots/test-committee.js.md
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,61 @@ | ||
# Snapshot report for `test/unitTests/test-committee.js` | ||
|
||
The actual snapshot is saved in `test-committee.js.snap`. | ||
|
||
Generated by [AVA](https://avajs.dev). | ||
|
||
## committee-open question:mixed, with snapshot | ||
|
||
> Under "published", the "committees.Economic_Committee" node is delegated to a committee contract. | ||
> The example below illustrates the schema of the data published there. | ||
> | ||
> See also board marshalling conventions (_to appear_). | ||
[ | ||
[ | ||
'published.committees.Economic_Committee.latestOutcome', | ||
{ | ||
outcome: 'fail', | ||
question: { | ||
iface: 'Alleged: QuestionHandle', | ||
}, | ||
reason: 'No quorum', | ||
}, | ||
], | ||
[ | ||
'published.committees.Economic_Committee.latestQuestion', | ||
{ | ||
closingRule: { | ||
deadline: 1n, | ||
timer: { | ||
iface: 'Alleged: ManualTimer', | ||
}, | ||
}, | ||
counterInstance: { | ||
iface: 'Alleged: InstanceHandle', | ||
}, | ||
electionType: 'survey', | ||
issue: { | ||
text: 'why3', | ||
}, | ||
maxChoices: 1, | ||
maxWinners: 1, | ||
method: 'unranked', | ||
positions: [ | ||
{ | ||
text: 'because', | ||
}, | ||
{ | ||
text: 'why not?', | ||
}, | ||
], | ||
questionHandle: { | ||
iface: 'Alleged: QuestionHandle', | ||
}, | ||
quorumRule: 'majority', | ||
tieOutcome: { | ||
text: 'why not?', | ||
}, | ||
}, | ||
], | ||
] |
Binary file added
BIN
+915 Bytes
packages/governance/test/unitTests/snapshots/test-committee.js.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
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,37 @@ | ||
import { eventLoopIteration } from '@agoric/zoe/tools/eventLoopIteration.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); | ||
}; |
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
163 changes: 163 additions & 0 deletions
163
packages/inter-protocol/test/auction/snapshots/test-auctionContract.js.md
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,163 @@ | ||
# Snapshot report for `test/auction/test-auctionContract.js` | ||
|
||
The actual snapshot is saved in `test-auctionContract.js.snap`. | ||
|
||
Generated by [AVA](https://avajs.dev). | ||
|
||
## onDeadline exit, with chainStorage RPC snapshot | ||
|
||
> Under "published", the "auction" node is delegated to the auctioneer contract. | ||
> The example below illustrates the schema of the data published there. | ||
> | ||
> See also board marshalling conventions (_to appear_). | ||
[ | ||
[ | ||
'published.auction.book0', | ||
{ | ||
collateralAvailable: { | ||
brand: { | ||
iface: 'Alleged: Collateral brand', | ||
}, | ||
value: 100n, | ||
}, | ||
currentPriceLevel: { | ||
denominator: { | ||
brand: { | ||
iface: 'Alleged: Collateral brand', | ||
}, | ||
value: 10000000000000n, | ||
}, | ||
numerator: { | ||
brand: { | ||
iface: 'Alleged: Currency brand', | ||
}, | ||
value: 9350000000000n, | ||
}, | ||
}, | ||
proceedsRaised: undefined, | ||
remainingProceedsGoal: null, | ||
startCollateral: { | ||
brand: { | ||
iface: 'Alleged: Collateral brand', | ||
}, | ||
value: 100n, | ||
}, | ||
startPrice: { | ||
denominator: { | ||
brand: { | ||
iface: 'Alleged: Collateral brand', | ||
}, | ||
value: 1000000000n, | ||
}, | ||
numerator: { | ||
brand: { | ||
iface: 'Alleged: Currency brand', | ||
}, | ||
value: 1100000000n, | ||
}, | ||
}, | ||
startProceedsGoal: null, | ||
}, | ||
], | ||
[ | ||
'published.auction.governance', | ||
{ | ||
current: { | ||
AuctionStartDelay: { | ||
type: 'relativeTime', | ||
value: { | ||
relValue: 10n, | ||
timerBrand: { | ||
iface: 'Alleged: timerBrand', | ||
}, | ||
}, | ||
}, | ||
ClockStep: { | ||
type: 'relativeTime', | ||
value: { | ||
relValue: 5n, | ||
timerBrand: { | ||
iface: 'Alleged: timerBrand', | ||
}, | ||
}, | ||
}, | ||
DiscountStep: { | ||
type: 'nat', | ||
value: 2000n, | ||
}, | ||
Electorate: { | ||
type: 'invitation', | ||
value: { | ||
brand: { | ||
iface: 'Alleged: Zoe Invitation brand', | ||
}, | ||
value: [ | ||
{ | ||
description: 'getRefund', | ||
handle: { | ||
iface: 'Alleged: InvitationHandle', | ||
}, | ||
installation: { | ||
iface: 'Alleged: BundleInstallation', | ||
}, | ||
instance: { | ||
iface: 'Alleged: InstanceHandle', | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
LowestRate: { | ||
type: 'nat', | ||
value: 4500n, | ||
}, | ||
PriceLockPeriod: { | ||
type: 'relativeTime', | ||
value: { | ||
relValue: 3n, | ||
timerBrand: { | ||
iface: 'Alleged: timerBrand', | ||
}, | ||
}, | ||
}, | ||
StartFrequency: { | ||
type: 'relativeTime', | ||
value: { | ||
relValue: 40n, | ||
timerBrand: { | ||
iface: 'Alleged: timerBrand', | ||
}, | ||
}, | ||
}, | ||
StartingRate: { | ||
type: 'nat', | ||
value: 10500n, | ||
}, | ||
}, | ||
}, | ||
], | ||
[ | ||
'published.auction.schedule', | ||
{ | ||
activeStartTime: { | ||
absValue: 170n, | ||
timerBrand: { | ||
iface: 'Alleged: timerBrand', | ||
}, | ||
}, | ||
nextDescendingStepTime: { | ||
absValue: 180n, | ||
timerBrand: { | ||
iface: 'Alleged: timerBrand', | ||
}, | ||
}, | ||
nextStartTime: { | ||
absValue: 210n, | ||
timerBrand: { | ||
iface: 'Alleged: timerBrand', | ||
}, | ||
}, | ||
}, | ||
], | ||
] |
Binary file added
BIN
+1.66 KB
packages/inter-protocol/test/auction/snapshots/test-auctionContract.js.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
Oops, something went wrong.