-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: mismatch gauge in cms and sc side (#10929)
The old alg using sc side data as the source, this cause some data in cms not reflect in google sheets. 1. The original algorithm using address as condition to match, now I modified to gid. 2. CMS side data is used as SSOT. <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on enhancing the `GaugeInfo` type structure, introducing new tests for gauge retrieval, and refining the logic for fetching and merging gauge configurations. ### Detailed summary - Added `gid` property to `GaugeInfo` type. - Included an import for `abortcontroller-polyfill.ts`. - Updated test exclusions in `vitest.config.ts`. - Created tests for gauge retrieval in `gauges.test.ts`. - Modified `fetchAllGauges` to use `gid` instead of `pid`. - Introduced `fetchGaugesSC` function for fetching smart contract gauges. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
- Loading branch information
Showing
6 changed files
with
57 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ChainId } from '@pancakeswap/chains' | ||
import { getAllGauges } from '@pancakeswap/gauges' | ||
import { getViemClients } from 'utils/viem' | ||
import { describe, it } from 'vitest' | ||
|
||
describe('get all guages', () => { | ||
it('contract gaguges and cms gauges should be match', async () => { | ||
const gauges = await getAllGauges( | ||
getViemClients({ | ||
chainId: ChainId.BSC, | ||
}), | ||
{ | ||
testnet: false, | ||
inCap: false, | ||
bothCap: false, | ||
killed: true, | ||
}, | ||
) | ||
const notMatched = gauges.find((x) => !x.pairAddress) | ||
expect(notMatched).toBeUndefined() | ||
}, 300000) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters