-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: convert the fakePriceAuthority to a PlayerPiano model (#1985)
* feat: convert the fakePriceAuthority to a PlayerPiano model It repeatedly runs through the list of prices provided at setup. This will be used to create a price oracle for the test net. tests updated * fix(fakePriceAuthority): remove some assumptions * chore: fix typo * chore: remove premature inversePriceAuthority.js * feat: add getPriceNotifier, more parameters to fakePriceAuthority * fix: calculate priceOutQuote using priceInQuote * chore: revert bad commit * test: update test-callSpread for playerPiano fakePriceAuthority * chore: clean up unintentional changes * test: update for new fakePriceAuthority * chore: fix tests * chore: lint-fix Co-authored-by: Michael FIG <mfig@agoric.com> Co-authored-by: Kate Sills <kate@agoric.com>
- Loading branch information
1 parent
c646bb6
commit cd7ebd8
Showing
17 changed files
with
405 additions
and
347 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
21 changes: 21 additions & 0 deletions
21
packages/cosmic-swingset/lib/ag-solo/vats/vat-priceAuthority.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 |
---|---|---|
@@ -1,7 +1,28 @@ | ||
import { makePriceAuthorityRegistry } from '@agoric/zoe/tools/priceAuthorityRegistry'; | ||
import { makeFakePriceAuthority } from '@agoric/zoe/tools/fakePriceAuthority'; | ||
import { makeLocalAmountMath } from '@agoric/ertp'; | ||
|
||
export function buildRootObject(_vatPowers) { | ||
return harden({ | ||
makePriceAuthority: makePriceAuthorityRegistry, | ||
async makeFakePriceAuthority( | ||
issuerIn, | ||
issuerOut, | ||
priceList, | ||
timer, | ||
quoteInterval = undefined, | ||
) { | ||
const [mathIn, mathOut] = await Promise.all([ | ||
makeLocalAmountMath(issuerIn), | ||
makeLocalAmountMath(issuerOut), | ||
]); | ||
return makeFakePriceAuthority( | ||
mathIn, | ||
mathOut, | ||
priceList, | ||
timer, | ||
quoteInterval, | ||
); | ||
}, | ||
}); | ||
} |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.