-
Notifications
You must be signed in to change notification settings - Fork 208
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
refactor oracle registration to make it simpler to push prices later
- Loading branch information
1 parent
0dd8cca
commit 754ea5b
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