Skip to content

Commit

Permalink
oracle util
Browse files Browse the repository at this point in the history
  • Loading branch information
rbajollari committed Jan 15, 2025
1 parent f46db74 commit 62dd1f5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/ojo-network/price-feeder

go 1.22.7
go 1.23

toolchain go1.23.1

Expand All @@ -17,7 +17,7 @@ require (
github.com/hashicorp/go-metrics v0.5.3
github.com/justinas/alice v1.2.0
github.com/mitchellh/mapstructure v1.5.0
github.com/ojo-network/ojo v0.4.0-rc1.0.20240912201233-2af60de6026b
github.com/ojo-network/ojo v0.5.1-rc3.0.20250115184042-c9d13e9aa254
github.com/rs/cors v1.11.1
github.com/rs/zerolog v1.33.0
github.com/spf13/cobra v1.8.1
Expand All @@ -37,7 +37,7 @@ require (
cloud.google.com/go/compute/metadata v0.5.0 // indirect
cloud.google.com/go/iam v1.1.12 // indirect
cloud.google.com/go/storage v1.41.0 // indirect
cosmossdk.io/api v0.7.5 // indirect
cosmossdk.io/api v0.7.6 // indirect
cosmossdk.io/client/v2 v2.0.0-beta.3 // indirect
cosmossdk.io/collections v0.4.0 // indirect
cosmossdk.io/core v0.11.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX
cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg=
cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0=
cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ=
cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY=
cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
cosmossdk.io/client/v2 v2.0.0-beta.3 h1:+TTuH0DwQYsUq2JFAl3fDZzKq5gQG7nt3dAattkjFDU=
cosmossdk.io/client/v2 v2.0.0-beta.3/go.mod h1:CZcL41HpJPOOayTCO28j8weNBQprG+SRiKX39votypo=
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
Expand Down Expand Up @@ -1207,8 +1207,8 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q=
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s=
github.com/ojo-network/ojo v0.4.0-rc1.0.20240912201233-2af60de6026b h1:fQbREPiTgw5I16a1dTAeTRy3BxHG2MxBidCsl9JoQw4=
github.com/ojo-network/ojo v0.4.0-rc1.0.20240912201233-2af60de6026b/go.mod h1:CNZnRR7TSK/fZ2iUDVfEzVv1hXYsdC/yLW/tczC/1sw=
github.com/ojo-network/ojo v0.5.1-rc3.0.20250115184042-c9d13e9aa254 h1:X7r9AqGylW6EfLqol70OH0W2zTdq4yEp5B8q6Sx2BOo=
github.com/ojo-network/ojo v0.5.1-rc3.0.20250115184042-c9d13e9aa254/go.mod h1:ODWVIrPeaW4NvLaUiQH775CefPdvyhaSOADQvOl+RzU=
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
Expand Down
11 changes: 9 additions & 2 deletions oracle/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ func CreatePairProvidersFromCurrencyPairProvidersList(

for _, pair := range currencyPairs {
for _, provider := range pair.Providers {
poolId := uint64(0)

Check failure on line 241 in oracle/util.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

var poolId should be poolID
if provider == pair.ExternLiquidityProvider {
poolId = pair.PoolId
}
if len(pair.PairAddress) > 0 {
for _, uniPair := range pair.PairAddress {
if (uniPair.AddressProvider == provider) && (uniPair.Address != "") {
Expand All @@ -255,8 +259,11 @@ func CreatePairProvidersFromCurrencyPairProvidersList(
providerPairs[types.ProviderName(provider)] = append(
providerPairs[types.ProviderName(provider)],
types.CurrencyPair{
Base: pair.BaseDenom,
Quote: pair.QuoteDenom,
Base: pair.BaseDenom,
Quote: pair.QuoteDenom,
BaseProxy: pair.BaseProxyDenom,
QuoteProxy: pair.QuoteProxyDenom,
PoolId: poolId,
},
)
}
Expand Down

0 comments on commit 62dd1f5

Please sign in to comment.