Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add og subgraph queries #4044

Conversation

daywiss
Copy link
Contributor

@daywiss daywiss commented Jul 5, 2023

Issues

we recently deployed an OG subgraph. We want to add queries to it to further optimize calls when requesting historical data.

Fixes #

Changes

(Briefly describe the changes made in this PR)

  1. this removes all the event based queries and replaces them with calls to the OG subgraph
  2. this also fixes an issue with incorrect data type being returned from subgraph query, number changed to bignumber
  3. this also updates to production subgraph points, and updates any missing contract addresses in constants

How to test

(Explain how the changes can be tested, including any required setup steps)

  1. go to the proposal: #/barnbridge.eth/proposal/0x74cf6f3372aaeebfc2e99ff54604a5e63ca3d44cb84bdbf202a85581dfac9f5d
    see that there is no warning in console Error querying module details from the graph. this means it used the subgraph function successfully. it shows that it has been executed.

To-Do

(List any outstanding tasks be addressed before or after this PR is merged)

Self-review checklist

  • I have performed a full self-review of my changes
  • I have tested my changes on a preview deployment
  • I have tested my changes on different screen sizes (sm, md)
  • I have tested my changes on a custom domain

Additional notes or considerations

(Include any other relevant information or context that may be helpful for the reviewer)

@vercel
Copy link

vercel bot commented Jul 5, 2023

@daywiss is attempting to deploy a commit to the snapshot Team on Vercel.

A member of the Team first needs to authorize it.

proposalHash: proposalHash,
proposalTxHash: event.transactionHash,
logIndex: event.logIndex
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was just re-formatted to use async await

);
}
)
]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove all events now from the graph function call now that we have OG subgraphs

@daywiss daywiss marked this pull request as ready for review July 5, 2023 12:42
@daywiss daywiss force-pushed the david/uma-1618-add-og-subgraph-calls-to-osnap branch from d1ab7bd to cd23095 Compare July 5, 2023 13:25
@daywiss
Copy link
Contributor Author

daywiss commented Jul 5, 2023

we are making an update to the subgraphs, which will require some changes to this pr

@daywiss daywiss closed this Jul 5, 2023
@daywiss daywiss reopened this Jul 6, 2023
@daywiss daywiss force-pushed the david/uma-1618-add-og-subgraph-calls-to-osnap branch from cd23095 to 4800d21 Compare July 6, 2023 13:56
},
{
network: '42161',
name: 'OptimisticGovernor',
subgraph:
'https://api.thegraph.com/subgraphs/name/md0x/arbitrum-optimistic-governor'
'https://api.thegraph.com/subgraphs/name/umaprotocol/arbitrum-optimistic-governor'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding production endpoints

return 'proposal-approved';

// Proposal is approved if it has been settled without a disputer and hasn't been executed.
if (assertionEvent.isSettled && !proposalExecuted) return 'proposal-approved';
if (assertionEvent?.isSettled && !proposalExecuted)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ensuring this exists

@daywiss daywiss force-pushed the david/uma-1618-add-og-subgraph-calls-to-osnap branch from 78f8586 to 72be9f4 Compare July 6, 2023 14:13
@daywiss daywiss force-pushed the david/uma-1618-add-og-subgraph-calls-to-osnap branch from c289e8e to f606942 Compare July 6, 2023 15:04
@daywiss daywiss force-pushed the david/uma-1618-add-og-subgraph-calls-to-osnap branch from ea13d14 to e0f1ff5 Compare July 7, 2023 12:53
Copy link
Member

@bonustrack bonustrack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK

@bonustrack bonustrack merged commit be90667 into snapshot-labs:develop Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants