Skip to content

Commit

Permalink
chore(a3p): setup oracle and push price at use phase
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge-Lopes committed Oct 28, 2024
1 parent 7ae1f27 commit 86e2e80
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions a3p-integration/proposals/n:upgrade-next/use.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ set -uxeo pipefail

node ./addGov4
./acceptInvites.js

./verifyPushedPrice.js 'ATOM' 12.01
./verifyPushedPrice.js 'stATOM' 12.01
21 changes: 21 additions & 0 deletions a3p-integration/proposals/n:upgrade-next/verifyPushedPrice.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env node

import {
registerOraclesForBrand,
generateOracleMap,
} from '@agoric/synthetic-chain';
import { argv } from 'node:process';
import { verifyPushedPrice } from './test-lib/price-feed.js';

const brand = argv[2];
const price = Number(argv[3]);

const BASE_ID = 'n-upgrade';
const ROUND_ID = 1;

const oraclesByBrand = generateOracleMap(BASE_ID, [brand]);
await registerOraclesForBrand(brand, oraclesByBrand);
console.log(`Registering Oracle for ${brand}`);

await verifyPushedPrice(price, brand, oraclesByBrand, ROUND_ID);
console.log(`Price pushed for ${brand}`);

0 comments on commit 86e2e80

Please sign in to comment.