Skip to content

Commit

Permalink
fix: Missing gauge (#10801)
Browse files Browse the repository at this point in the history
<!--
Before opening a pull request, please read the [contributing
guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md)
first
-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on fixing a missing gauge in the `@pancakeswap/gauges`
package by updating the logic in the `getAllGauges.ts` file to correctly
handle gauge configurations.

### Detailed summary
- Updated variable name from `presets` to `gaugesConfig` for clarity.
- Introduced sorting of `gaugesConfig` based on `gid` before assigning
it to `presets`.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
  • Loading branch information
chefjackson authored Oct 9, 2024
1 parent 9abb91e commit 447ceb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/strange-forks-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@pancakeswap/gauges': patch
---

Fix missing gauge
3 changes: 2 additions & 1 deletion packages/gauges/src/getAllGauges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export const getAllGauges = async (
},
): Promise<Gauge[]> => {
const { testnet, inCap, bothCap, killed, blockNumber } = options
const presets = testnet ? CONFIG_TESTNET : await getGauges()
const gaugesConfig = testnet ? CONFIG_TESTNET : await getGauges()
const presets = gaugesConfig.sort((a, b) => (a.gid < b.gid ? -1 : 1))

const allGaugeInfos = await fetchAllGauges(client, {
blockNumber,
Expand Down

0 comments on commit 447ceb3

Please sign in to comment.