Skip to content

Commit 799eea4

Browse files
committed
fix: lt for underlying cmv310
1 parent aee2bae commit 799eea4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

models/credit_manager/cm_v3/model.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cm_v3
22

33
import (
44
"math/big"
5+
"math/rand/v2"
56

67
"github.com/Gearbox-protocol/sdk-go/core"
78
"github.com/Gearbox-protocol/sdk-go/core/schemas"
@@ -37,10 +38,10 @@ func NewCMv3(addr string, client core.ClientI, repo ds.RepositoryI, discoveredAt
3738
}
3839
mdl.SetParams(params)
3940
mdl.addCreditConfiguratorAdapter(mdl.GetDetailsByKey("configurator"))
40-
mdl.Repo.UpdateFees(0, "", mdl.GetDetailsByKey("configurator"), params)
41+
mdl.Repo.UpdateFees(10000+uint(rand.Int()), "", mdl.GetDetailsByKey("configurator"), params)
4142
configurator := mdl.GetDetailsByKey("configurator")
4243
tokenHash := common.HexToHash(mdl.GetUnderlyingToken())
43-
ltData, err := core.CallFuncGetSingleValue(mdl.Client, "0x78327438", common.HexToAddress(configurator), discoveredAt, tokenHash[:])
44+
ltData, err := core.CallFuncGetSingleValue(mdl.Client, "0x78327438", common.HexToAddress(mdl.Address), discoveredAt, tokenHash[:])
4445
if err == nil {
4546
lt := new(big.Int).SetBytes(ltData)
4647
mdl.Repo.AddAllowedTokenV2(0, "", configurator, &schemas.AllowedToken{
@@ -53,7 +54,7 @@ func NewCMv3(addr string, client core.ClientI, repo ds.RepositoryI, discoveredAt
5354
})
5455
log.Infof("Liquidation threshold for cm %s is set to %s", mdl.GetAddress(), lt)
5556
} else {
56-
log.Warnf("Liquidation threshold data is not set for cm %s, using default value %v.", mdl.GetAddress(), err)
57+
log.Fatalf("Liquidation threshold data is not set for cm %s, using default value %v.", mdl.GetAddress(), err)
5758
}
5859
return mdl
5960
}

watcher/index.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func newMetEngine(reg *prometheus.Registry, eng ds.EngineI, _cfg *config.Config)
8080

8181
func corsHandler(h http.Handler) http.HandlerFunc {
8282
return func(w http.ResponseWriter, r *http.Request) {
83-
w.Header().Add("Connection", "keep-alive")
83+
// w.Header().Add("Connection", "keep-alive")
8484
w.Header().Add("Access-Control-Allow-Origin", "*")
8585
w.Header().Add("Access-Control-Allow-Methods", "OPTIONS, GET")
8686
w.Header().Add("Access-Control-Allow-Headers", "content-type")

0 commit comments

Comments
 (0)