Skip to content

Commit

Permalink
fix: call onblockchange for poolquotakeeper
Browse files Browse the repository at this point in the history
  • Loading branch information
5lliot committed Nov 8, 2023
1 parent a6f0c88 commit 14601d8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion debts/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ func (eng *DebtEngine) GetTokenLastPrice(addr string, version core.VersionType,
} else if eng.repo.GetWETHAddr() == addr {
return core.WETHPrice
}
} else if version.Eq(2) {
} else if version.Eq(2) || version.Eq(300) {
if eng.tokenLastPriceV2[addr] != nil {
return eng.tokenLastPriceV2[addr].PriceBI.Convert()
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ require (

replace github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.1

// replace github.com/Gearbox-protocol/sdk-go v0.0.0-20231025152649-9d89bc0f48e4 => ../sdk-go
// replace github.com/Gearbox-protocol/sdk-go v0.0.0-20231108015408-b05755fd4238 => ../sdk-go
3 changes: 2 additions & 1 deletion models/wrappers/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ func (s SyncWrapper) onBlockChange(lastBlockNum int64) {
calls = append(calls, call)
}
case *pool_quota_keeper.PoolQuotaKeeper:
_ = 1
// make all the tokens update to be saved in the db.
v.OnBlockChange(lastBlockNum)
}
}
results := core.MakeMultiCall(s.Client, lastBlockNum, false, calls)
Expand Down

0 comments on commit 14601d8

Please sign in to comment.