Skip to content

Commit 115e604

Browse files
committed
fix: etherlink error
1 parent 65fa193 commit 115e604

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

models/aggregated_block_feed/curve_price_feed/model.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ func (adapter *CurvePriceFeed) ProcessResult(blockNum int64, results []multicall
5555
value, err := core.GetAbi("YearnPriceFeed").Unpack("latestRoundData", multicallresult)
5656
log.CheckFatal(err)
5757
price := *abi.ConvertType(value[1], new(*big.Int)).(**big.Int)
58-
log.Info(price)
5958
return &schemas.PriceFeed{
6059
RoundId: 0,
6160
PriceBI: (*core.BigInt)(price),

models/aggregated_block_feed/query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (mdl *AQFWrapper) fetchAllPrices(toSinceTill int64) int64 {
3939
timeLeft := (time.Since(loopStartTime).Seconds() * float64(toSinceTill-blockNum)) /
4040
float64(blockNum-mdl.GetLastSync())
4141
timeLeft /= 60
42-
log.Infof("Synced %d in %d rounds(%fs): TimeLeft %f mins", blockNum, rounds, time.Since(roundStartTime).Seconds(), timeLeft)
42+
log.Infof("Synced %d(inv: %d) in %d rounds(%fs): TimeLeft %f mins", blockNum, mdl.Interval, rounds, time.Since(roundStartTime).Seconds(), timeLeft)
4343
roundStartTime = time.Now()
4444
}
4545
rounds++

models/aggregated_block_feed/redstone_price_feed/command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func GetRedStoneResult(data []byte, block int64, rpc string) []byte {
3030
// Execute the command and capture its standard output.
3131
output, err := cmd.Output()
3232
if err != nil {
33+
log.Info(strings.Join(cmdstr, " "))
3334
log.Fatalf("Error executing command: %v", err)
3435
}
3536

@@ -49,7 +50,6 @@ func GetRedStoneResult(data []byte, block int64, rpc string) []byte {
4950
// Extract hex string from the last line (remove "0x" prefix if present)
5051
spls := strings.Split(strings.TrimSpace(lastLine), "0x")
5152
// Convert hex string to bytes
52-
log.Info(spls[1])
5353
bytes, err := hex.DecodeString(spls[1])
5454
if err != nil {
5555
log.Errorf("Error decoding hex string: %v", err)

repository/handlers/treasury/price.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (repo TreasuryRepo) GetRedStonemgr() redstone.RedStoneMgrI {
112112
func (repo TreasuryRepo) GetRedStonePrice(blockNum int64, oracle schemas.PriceOracleT, token string) *big.Int {
113113
if adapter := repo.IsRedStoneAdapter(blockNum, oracle, token); adapter != nil {
114114
call, isQueryable := adapter.GetCalls(blockNum)
115-
log.Info(adapter.GetPFType(), isQueryable)
115+
// log.Info(adapter.GetPFType(), isQueryable)
116116
if !isQueryable {
117117
return nil
118118
}
@@ -136,7 +136,10 @@ func (repo TreasuryRepo) IsRedStoneAdapter(blockNum int64, oracle schemas.PriceO
136136
if utils.Contains([]string{ds.RedStonePF, ds.CompositeRedStonePF, ds.PythPF}, adapter.GetDetailsByKey("pfType")) {
137137
return aggregated_block_feed.FromAdapter(adapter)
138138
}
139-
if utils.Contains([]string{ds.CurvePF}, adapter.GetDetailsByKey("pfType")) && len(aggregated_block_feed.FromAdapter(adapter).GetRedStoneUnderlyings()) > 0 {
139+
tsbytes, _ := core.CallFuncGetSingleValue(repo.client, "0x19d8ac61", common.HexToAddress(priceFeed.Hex()), blockNum, nil) // lastTimestamp
140+
ts := big.NewInt(0).SetBytes(tsbytes)
141+
if utils.Contains([]string{ds.CurvePF}, adapter.GetDetailsByKey("pfType")) &&
142+
len(aggregated_block_feed.FromAdapter(adapter).GetRedStoneUnderlyings()) > 0 || ts.Cmp(new(big.Int)) > 0 { // for get price in get value in currency
140143
return aggregated_block_feed.FromAdapter(adapter)
141144
}
142145
}

0 commit comments

Comments
 (0)