-
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.
test: move vault upgrade from test to use phase (#9536)
refs: #9526 ## Description move vault upgrade from test to use phase Also refactor oracle registration to make it simpler to push prices later. ### Security Considerations None. This impacts a3p-integration ### Scaling Considerations None ### Documentation Considerations None ### Testing Considerations Makes it simpler for later tests to push prices, by registering oracles using a repeatable generation of the offerIds. ### Upgrade Considerations This is about testing upgrades in a3p-integration, rather than upgrade per se.
- Loading branch information
Showing
4 changed files
with
85 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env node | ||
|
||
import assert from 'node:assert/strict'; | ||
import { | ||
generateOracleMap, | ||
getPriceQuote, | ||
pushPrices, | ||
registerOraclesForBrand, | ||
} from './agd-tools.js'; | ||
|
||
const BRANDNAMES = ['ATOM', 'stATOM', 'stTIA', 'stOSMO', 'stkATOM']; | ||
const oraclesByBrand = generateOracleMap('u16', BRANDNAMES); | ||
|
||
// There are no old prices for the other currencies. | ||
const atomOutPre = await getPriceQuote('ATOM'); | ||
assert.equal(atomOutPre, '+12010000'); | ||
|
||
console.log('adding oracle for each brand'); | ||
await registerOraclesForBrand('ATOM', oraclesByBrand); | ||
await registerOraclesForBrand('stATOM', oraclesByBrand); | ||
await registerOraclesForBrand('stTIA', oraclesByBrand); | ||
await registerOraclesForBrand('stOSMO', oraclesByBrand); | ||
await registerOraclesForBrand('stkATOM', oraclesByBrand); | ||
|
||
console.log('pushing new prices'); | ||
await pushPrices(11.2, 'ATOM', oraclesByBrand); | ||
await pushPrices(11.3, 'stTIA', oraclesByBrand); | ||
await pushPrices(11.4, 'stATOM', oraclesByBrand); | ||
await pushPrices(11.5, 'stOSMO', oraclesByBrand); | ||
await pushPrices(11.6, 'stkATOM', oraclesByBrand); |
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