Skip to content

Commit

Permalink
fixes for grafting and exchanges (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbeal-eth authored Jun 24, 2022
1 parent 352f1a4 commit f4da6c8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
29 changes: 18 additions & 11 deletions scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,26 @@ program.action(async () => {
settings.graftBase ||
(await readPreviousDeploymentId(settings.team, networkPrefix(settings.network) + settings.subgraph));

if (prevDeployId && !OPTIONS.graftBlock && !OPTIONS.buildOnly) {
await inquirer.prompt(
[
{
message: `Previous graftable base found (${prevDeployId}). Specify graft start block (0 to disable):`,
type: 'number',
name: 'graftBlock',
},
],
OPTIONS,
);
if (prevDeployId && !settings.graftBlock && !settings.buildOnly) {
settings = {
...(await inquirer.prompt(
[
{
message: `Previous graftable base found (${prevDeployId}). Specify graft start block (0 to disable):`,
type: 'number',
name: 'graftBlock',
},
],
settings,
)),
...settings,
};

settings.graftBase = prevDeployId;
}

console.log('RESOLVED SETTINGS', settings);

if (settings.subgraph == 'main') {
console.log('Generating the main subgraph...');

Expand Down
2 changes: 1 addition & 1 deletion subgraphs/exchanges.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type Total @entity {
timestamp: BigInt!

" which product the volume came from. Ex 'futures' or 'exchange' "
product: String!
product: String

" number of seconds the data covers after `timestamp` "
period: BigInt!
Expand Down
2 changes: 0 additions & 2 deletions subgraphs/fragments/latest-rates.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const { getContractDeployments, versions, getCurrentNetwork, getCurrentSubgraph

const exchangeRatesContractAddresses = getContractDeployments('ExchangeRates');
const systemSettingsAddresses = getContractDeployments('SystemSettings');
console.log('systemsettings', systemSettingsAddresses.length);

const systemSettingsManifests = [];
const exchangeRatesManifests = [];
Expand All @@ -18,7 +17,6 @@ const EXCHANGES_START_BLOCK = 6841188;
const SHORTS_START_BLOCK = 11513382;

systemSettingsAddresses.forEach((a, i) => {
console.log('adding a system settings', a);
systemSettingsManifests.push({
kind: 'ethereum/contract',
// for some reason sUSD has different contract name
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/main.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ type Total @entity {
" timestamp of the beginning of the time period this represents "
timestamp: BigInt!
" which product the volume came from. Ex 'futures' or 'exchange' "
product: String!
product: String
" number of seconds the data covers after `timestamp` "
period: BigInt!
" minimum power of 10 (in from USD value) the trade must be. ex, 2 means $100 or higher) "
Expand Down

0 comments on commit f4da6c8

Please sign in to comment.