Skip to content

Commit

Permalink
fix: nit
Browse files Browse the repository at this point in the history
  • Loading branch information
5lliot committed Dec 20, 2023
1 parent 07017de commit efe87dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/Gearbox-protocol/sdk-go v0.0.0-20231214104810-a20bff5392d5 h1:y4ehe0hOMaBJkEJazUkhW0sgqVd5dHKFlKNhHgG/E/M=
github.com/Gearbox-protocol/sdk-go v0.0.0-20231214104810-a20bff5392d5/go.mod h1:GniLx/DU7tCT+QSlKt9REqUaF748X8rbDNR4vAd1m+Y=
github.com/Gearbox-protocol/sdk-go v0.0.0-20231219113729-4d2522d6c5ee h1:q2ZKjPJ0JNrtrmqJ4c145ffl5LvZLx2TLA4io3Dw6h0=
github.com/Gearbox-protocol/sdk-go v0.0.0-20231219113729-4d2522d6c5ee/go.mod h1:GniLx/DU7tCT+QSlKt9REqUaF748X8rbDNR4vAd1m+Y=
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
Expand Down
19 changes: 2 additions & 17 deletions models/aggregated_block_feed/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,34 +123,19 @@ func (mdl *AQFWrapper) getRoundDataCalls(blockNum int64) (calls []multicall.Mult
}

var curvePFLatestRoundDataTimer = map[string]log.TimerFn{}
var failingv3LatestRound = map[string][]int64{}

func (mdl *AQFWrapper) processRoundData(blockNum int64, adapter *QueryPriceFeed, entry multicall.Multicall2Result) []*schemas.PriceFeed {
var priceData *schemas.PriceFeed

if entry.Success {
failingv3LatestRound[adapter.GetAddress()] = nil
isPriceInUSD := adapter.GetVersion().IsPriceInUSD()
priceData = parseRoundData(entry.ReturnData, isPriceInUSD, adapter.GetAddress())
} else if adapter.GetVersion().MoreThanEq(core.NewVersion(300)) {
// failingv3LatestRound[adapter.GetAddress()] = append(failingv3LatestRound[adapter.GetAddress()], blockNum)
if core.GetChainId(mdl.Client) == 7878 {
// if len(failingv3LatestRound[adapter.GetAddress()]) == 10 {
// log.Warnf("Can't get latestRounData in AQFWrapper for %s(%s) at %v . %v",
// adapter.GetDetailsByKey("pfType"), adapter.GetAddress(), failingv3LatestRound[adapter.GetAddress()],
// adapter.Details,
// )
// } else if len(failingv3LatestRound[adapter.GetAddress()]) > 10 {
// log.Fatalf("Can't get latestRounData in AQFWrapper for %s(%s) at %v. %v",
// adapter.GetDetailsByKey("pfType"), adapter.GetAddress(), failingv3LatestRound[adapter.GetAddress()],
// adapter.Details)
// }
// get latestRoundData can sometimes fail for anvil
// exit in those cases
return nil
} else {
log.Fatalf("Can't get latestRounData in AQFWrapper for %s(%s) at %v",
adapter.GetDetailsByKey("pfType"), adapter.GetAddress(), failingv3LatestRound[adapter.GetAddress()])
log.Fatalf("Can't get latestRounData in AQFWrapper for %s(%s) at %d",
adapter.GetDetailsByKey("pfType"), adapter.GetAddress(), blockNum)
}
} else {
switch adapter.GetDetailsByKey("pfType") {
Expand Down

0 comments on commit efe87dc

Please sign in to comment.