Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Add Goerli support #170

Closed
wants to merge 16 commits into from
Closed

Add Goerli support #170

wants to merge 16 commits into from

Conversation

henrypalacios
Copy link
Contributor

@henrypalacios henrypalacios commented Jul 25, 2022

Summary

Closes #136

  • Add goerli network to cow-sdk instance constants (Update cow-sdk library)
  • Add the option in the network-list menu in the header UI
  • Create and verify new route prefix network /goerli
  • Enable/check routes for /goerli suffixes such as:
    • /search,
    • /address,
    • /orders,
    • /tx
  • Fill in the home page data from the goerli network subgraph

@coveralls
Copy link

coveralls commented Jul 25, 2022

Pull Request Test Coverage Report for Build 2828116247

  • 5 of 7 (71.43%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.07%) to 43.824%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/state/network/updater.tsx 1 2 50.0%
src/utils/miscellaneous.ts 1 2 50.0%
Totals Coverage Status
Change from base Build 2707860945: -0.07%
Covered Lines: 2158
Relevant Lines: 4174

💛 - Coveralls

@github-actions
Copy link

package.json Outdated Show resolved Hide resolved
src/const.ts Outdated
},
)

export const COW_SDK = [Network.MAINNET, Network.RINKEBY, Network.GNOSIS_CHAIN].reduce<
export const COW_SDK = [Network.MAINNET, Network.RINKEBY, Network.GNOSIS_CHAIN, Network.GOERLI].reduce<
Copy link
Contributor

Choose a reason for hiding this comment

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

with the latest version we can omit this and have just 1 instance instead of 4.

Then we can pass the chainId as an options object to each method of the cowApi class

src/const.ts Outdated
@@ -241,7 +242,7 @@ export const COW_SDK = [Network.MAINNET, Network.RINKEBY, Network.GNOSIS_CHAIN].
return acc
}, {})

export const COW_SDK_DEV = [Network.MAINNET, Network.RINKEBY, Network.GNOSIS_CHAIN].reduce<
export const COW_SDK_DEV = [Network.MAINNET, Network.RINKEBY, Network.GNOSIS_CHAIN, Network.GOERLI].reduce<
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

@henrypalacios henrypalacios changed the title Add option in network-list menu UI Add Goerli option in network-list menu UI Jul 26, 2022
@henrypalacios henrypalacios changed the title Add Goerli option in network-list menu UI Add Goerli option in network-list menu Jul 26, 2022
@henrypalacios henrypalacios force-pushed the 136-add-goerli branch 2 times, most recently from af592de to 38be36b Compare July 27, 2022 01:18
@henrypalacios
Copy link
Contributor Author

with the latest version we can omit this and have just 1 instance instead of 4.
Then we can pass the chainId as an options object to each method of the cowApi class

☝️ Thanks for feedback @ramirotw, I'm aware of it. But as I mentioned, I was focused first on achieving full functionality of the routes.

At this point I'm stuck looking for the bug responsible for not sending the requests to barn 🤔

image

@elena-zh
Copy link

Hey @henrypalacios , I have not tested the PR yet, just opened it and decided to leave this note for you: Gorli network color in Cowswap is a light-blue, so it would be nice, I think, to make colors consistent in both applications
image

And this issue might not be related to you current implementation, but 24h transactions show 'Infininty' %
image

package.json Outdated Show resolved Hide resolved
@ramirotw
Copy link
Contributor

ramirotw commented Aug 8, 2022

When the sdk is published I'll ping you @elena-zh to test again

image

@ramirotw ramirotw changed the title Add Goerli option in network-list menu Add Goerli support Aug 9, 2022
@ramirotw ramirotw marked this pull request as ready for review August 9, 2022 17:32
@ramirotw ramirotw requested review from alfetopito and elena-zh August 9, 2022 17:32
@alfetopito
Copy link
Collaborator

Just a note: there was an issue with the backend node being indexed. It's being addressed but expect it to not have data for a couple of minutes/hours

Copy link
Collaborator

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

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

Nice!

One small thing I noticed and I hope I did the suggestion in the right place in the code. The network name in the UI should be Görli
Screen Shot 2022-08-09 at 18 38 10

Besides that can't really test much until backend has finished with the fix

src/api/operator/operatorApi.ts Show resolved Hide resolved
src/components/NetworkSelector/index.tsx Outdated Show resolved Hide resolved
ramirotw and others added 2 commits August 9, 2022 16:36
add the thingy on top of the `o`

Co-authored-by: Leandro Boscariol <[email protected]>
Copy link
Contributor

@anxolin anxolin left a comment

Choose a reason for hiding this comment

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

It would have been nice to split this one in two:

  • Update to SDK 1.0.0
  • Add Goerli

No need to do it now, but the reason is:

  • Makes it easier to review, only Goerli changes here. So better reviews, give more code assurance
  • The PR would be easily serve as documentation on how to add a new network. We will soon need to add other networks, so it's nice to have some reference PRs for it

I had an issue testing this, not sure if I did it right. It's probably related to the issue of the indexing of the backend?

I tried to trade in Goerli using barn, but we weren't able to find the order:
https://pr170--explorer.review.gnosisdev.com/goerli/search/0x3251328616d152ecd178850af413eff15bb284b29b143d9cebe9f7870b8ce5d979063d9173c09887d536924e2f6eadbabac099f562f3829f/

Last question, why there's no volumes in the top traded tokens?

Copy link
Collaborator

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

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

Looks good, and I can see orders now!

But, it looks like the appData section in the order details broke in this PR https://pr170--explorer.review.gnosisdev.com/goerli/orders/0x125ba4899f3283620f14fff030920524c67f57dd1c9a7c53bfbcc2c5d0ef79f15b0abe214ab7875562adee331deff0fe1912fe4262f385a1
Screen Shot 2022-08-10 at 10 24 55

It looks fine on dev, so probably something with the API changes

@elena-zh
Copy link

elena-zh commented Aug 10, 2022

Hey @henrypalacios , @ramirotw , nice PR!

Some issues:

  1. Seems that @anxolin has reported it above

I tried to trade in Goerli using barn, but we weren't able to find the order:
https://pr170--explorer.review.gnosisdev.com/goerli/search/0x3251328616d152ecd178850af413eff15bb284b29b143d9cebe9f7870b8ce5d979063d9173c09887d536924e2f6eadbabac099f562f3829f/

So I also noticed, that BARN and PROD APIs are mixed up in this PR: I see orders from Prod in users' details page in Dev explorer, and do not see orders from Dev and Barn there
API mix
2. Then, when I press on the last batch ID in Gorly dashboard, open transaction details and navigate to an order details page, I see not found page, however, an order should be opened (see the video)
3. There are no links to contracts at the bottom of the page when Gorly is selected
no contracts
4. When search for a transaction from a different network (the app is opened in Mainnet, search for Gorli transaction), amounts are not loaded (currently, no issues on Prod with this)
search for ransaction from different network

  1. I also have faced a known issue Top tokens for another chain may be displayed when switch a network from an order details page #151 when I was navigated to Gorli main page, but Tokens page form GC was displayed there, so it would be nice to fix it in the near future...
    existing issue

Thanks!

@alfetopito alfetopito mentioned this pull request Aug 11, 2022
3 tasks
@ramirotw
Copy link
Contributor

Changes included in PR #182

@ramirotw ramirotw closed this Aug 18, 2022
@alfetopito alfetopito deleted the 136-add-goerli branch August 19, 2022 14:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
app:Explorer Explorer App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Goerli network
6 participants