Skip to content

Commit 9d3368e

Browse files
committed
fix: Price from priceoracle != nil
1 parent 122867e commit 9d3368e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

repository/token.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ func (repo *Repository) getValueInCurrency(blockNum int64, oracle schemas.PriceO
121121
price, err := poContract.GetPrice(opts, common.HexToAddress(token))
122122
if err != nil {
123123
price = repo.GetRedStonePrice(blockNum, oracle, token)
124-
if price != nil {
125-
log.Fatalf("%v %s %d %s %s at block %d", err, oracle, amount, token, currencyAddr, blockNum)
124+
if price == nil {
125+
log.Fatalf("err:%v oracle:%s amount:%d token:%s currencyAddr:%s at block %d", err, oracle, amount, token, currencyAddr, blockNum)
126126
}
127127
}
128128
amountInCurrency := utils.GetInt64(new(big.Int).Mul(amount, price), repo.GetToken(token).Decimals)

0 commit comments

Comments
 (0)