-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into iomekam-es-lint-2
- Loading branch information
Showing
34 changed files
with
520 additions
and
5,753 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
add-operators |
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,78 @@ | ||
/* eslint-env node */ | ||
import unknownTest from 'ava'; | ||
|
||
import '@endo/init/legacy.js'; // axios compat | ||
|
||
import { LOCAL_CONFIG, makeVstorageKit } from '@agoric/client-utils'; | ||
import { evalBundles, waitForBlock } from '@agoric/synthetic-chain'; | ||
|
||
// XXX ~copied to not take a dependency on Zoe | ||
/** | ||
* @typedef {object} InvitationDetails | ||
* @property {unknown} installation | ||
* @property {unknown} instance | ||
* @property {InvitationHandle} handle | ||
* @property {string} description | ||
* @property {Record<string, any>} [customDetails] | ||
*/ | ||
|
||
/** | ||
* @import {VstorageKit} from '@agoric/client-utils'; | ||
*/ | ||
|
||
const test = /** @type {import('ava').TestFn<{ vstorageKit: VstorageKit}>} */ ( | ||
unknownTest | ||
); | ||
|
||
const ADD_OPERATORS_DIR = 'add-operators'; | ||
|
||
/** | ||
* @typedef {import('@agoric/ertp').NatAmount} NatAmount | ||
* @typedef {{ | ||
* allocations: { Fee: NatAmount, USD_LEMONS: NatAmount }, | ||
* }} ReserveAllocations | ||
*/ | ||
|
||
test.before(async t => { | ||
const vstorageKit = makeVstorageKit({ fetch }, LOCAL_CONFIG); | ||
|
||
t.context = { | ||
vstorageKit, | ||
}; | ||
}); | ||
|
||
test.serial('add operators', async t => { | ||
const { vstorageKit } = t.context; | ||
|
||
const walletPath = | ||
// account mem3 in test of crabble-start proposal (64) | ||
// This must match the oracleNew value in the add-operators builder argument | ||
'wallet.agoric1hmdue96vs0p6zj42aa26x6zrqlythpxnvgsgpr.current'; | ||
|
||
const readInvitationsPurseBalance = async () => { | ||
const curr = await vstorageKit.readPublished(walletPath); | ||
return /** @type {InvitationDetails[]} */ (curr.purses[0].balance.value); | ||
}; | ||
|
||
let numInvitationsBefore = 0; | ||
{ | ||
const invBalance = await readInvitationsPurseBalance(); | ||
numInvitationsBefore = invBalance.length; | ||
t.false( | ||
invBalance.some(inv => inv.description === 'oracle operator invitation'), | ||
); | ||
} | ||
|
||
await evalBundles(ADD_OPERATORS_DIR); | ||
// give time for the invitations to be deposited | ||
await waitForBlock(5); | ||
|
||
{ | ||
const invBalance = await readInvitationsPurseBalance(); | ||
console.log('after', invBalance); | ||
t.is(invBalance.length, numInvitationsBefore + 1); | ||
t.true( | ||
invBalance.some(inv => inv.description === 'oracle operator invitation'), | ||
); | ||
} | ||
}); |
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
echo AVAILABLE WALLETs | ||
agd query vstorage children published.wallet | ||
|
||
yarn ava | ||
|
||
./test-cli.sh |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.