-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(vat-upgrade): enhance test coverage of agoricNames functionalit…
…y after upgrade Refs: #10408
- Loading branch information
1 parent
ecc1cda
commit 890ad0b
Showing
14 changed files
with
1,944 additions
and
69 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,6 +1,7 @@ | ||
replaceFeeDistributor/ | ||
testUpgradedBoard/ | ||
addUsdLemons/ | ||
addUsdOlives/ | ||
upgradeProvisionPool/ | ||
upgradeAgoricNames/ | ||
|
||
appendChainInfo/ |
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
7 changes: 7 additions & 0 deletions
7
...oposals/p:upgrade-19/agoricNamesCoreEvals/depositUsdOlives/deposit-usd-olives-permit.json
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,7 @@ | ||
{ | ||
"consume": { | ||
"contractKits": true, | ||
"namesByAddressAdmin": true, | ||
"agoricNames": true | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
...ration/proposals/p:upgrade-19/agoricNamesCoreEvals/depositUsdOlives/deposit-usd-olives.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// @ts-nocheck | ||
/* eslint-disable no-undef */ | ||
const GOV_ONE_ADDR = 'agoric1ee9hr0jyrxhy999y755mp862ljgycmwyp4pl7q'; | ||
|
||
const depositUsdOlives = async powers => { | ||
const { | ||
consume: { | ||
contractKits: contractKitsP, | ||
namesByAddressAdmin: namesByAddressAdminP, | ||
agoricNames, | ||
}, | ||
} = powers; | ||
|
||
const namesByAddressAdmin = await namesByAddressAdminP; | ||
|
||
const getDepositFacet = async address => { | ||
const hub = E(E(namesByAddressAdmin).lookupAdmin(address)).readonly(); | ||
return E(hub).lookup('depositFacet'); | ||
}; | ||
|
||
const [contractKits, usdOlivesIssuer, usdOlivesBrand, ppDepositFacet] = | ||
await Promise.all([ | ||
contractKitsP, | ||
E(agoricNames).lookup('issuer', 'USD_OLIVES'), | ||
E(agoricNames).lookup('brand', 'USD_OLIVES'), | ||
getDepositFacet(GOV_ONE_ADDR), | ||
]); | ||
|
||
console.log('[CONTRACT_KITS]', contractKits); | ||
console.log('[ISSUER]', usdOlivesIssuer); | ||
|
||
let usdOlivesMint; | ||
for (const { publicFacet, creatorFacet: mint } of contractKits.values()) { | ||
if (publicFacet === usdOlivesIssuer) { | ||
usdOlivesMint = mint; | ||
console.log('BINGO', mint); | ||
break; | ||
} | ||
} | ||
|
||
console.log('Minting USD_OLIVES'); | ||
const helloPayment = await E(usdOlivesMint).mintPayment( | ||
harden({ brand: usdOlivesBrand, value: 1_000_000n }), | ||
); | ||
|
||
console.log('Funding provision pool...'); | ||
await E(ppDepositFacet).receive(helloPayment); | ||
|
||
console.log('Done.'); | ||
}; | ||
|
||
depositUsdOlives; |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
"consume": { | ||
"agoricNamesAdmin": true | ||
} | ||
} | ||
} |
File renamed without changes.
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,20 @@ | ||
/* eslint-env node */ | ||
import { makeWalletUtils } from '@agoric/client-utils'; | ||
|
||
export const networkConfig = { | ||
rpcAddrs: ['http://0.0.0.0:26657'], | ||
chainName: 'agoriclocal', | ||
}; | ||
|
||
/** | ||
* Resolve after a delay in milliseconds. | ||
* | ||
* @param {number} ms | ||
* @returns {Promise<void>} | ||
*/ | ||
const delay = ms => new Promise(resolve => setTimeout(() => resolve(), ms)); | ||
|
||
export const walletUtils = await makeWalletUtils( | ||
{ delay, fetch }, | ||
networkConfig, | ||
); |
Oops, something went wrong.