Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
if: steps.cache-binaries.outputs.cache-hit != 'true' && env.GIT_DIFF
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.21.1
cache: true
env:
GOOS: ${{ matrix.targetos }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.21.1
cache: true

- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/setup-go@v5
if: env.GIT_DIFF
with:
go-version: 1.19
go-version: 1.21.1
cache: true
- name: revive lint
uses: morphy2k/revive-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/price-feeder-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.21.1
cache: true
cache-dependency-path: go.sum
# Parse 'v*.*.*' semantic version from 'v*.*.*' and save to
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.21.1
- name: Display Go Version
run: go version
- uses: actions/cache@v4
Expand All @@ -38,7 +38,7 @@ jobs:
- uses: actions/setup-go@v5
if: env.GIT_DIFF
with:
go-version: 1.19
go-version: 1.21.1
cache: true
cache-dependency-path: go.sum
- name: Test Unit
Expand All @@ -61,7 +61,7 @@ jobs:
- uses: actions/setup-go@v5
if: env.GIT_DIFF
with:
go-version: 1.19
go-version: 1.21.1
cache: true
- name: Test Integration
env:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Builder
FROM golang:1.19-alpine AS builder
FROM golang:1.21.1-alpine AS builder

RUN apk add --no-cache \
ca-certificates \
Expand Down
28 changes: 14 additions & 14 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"time"

"cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/go-playground/validator/v10"

"github.com/ojo-network/price-feeder/oracle/provider"
Expand All @@ -32,7 +32,7 @@ var (

// maxDeviationThreshold is the maxmimum allowed amount of standard
// deviations which validators are able to set for a given asset.
maxDeviationThreshold = sdk.MustNewDecFromStr("3.0")
maxDeviationThreshold = math.LegacyMustNewDecFromStr("3.0")
)

type (
Expand All @@ -42,8 +42,8 @@ type (
Server Server `mapstructure:"server"`
CurrencyPairs []CurrencyPair `mapstructure:"currency_pairs" validate:"required,gt=0,dive,required"`
Deviations []Deviation `mapstructure:"deviation_thresholds"`
Account Account `mapstructure:"account" validate:"required,gt=0,dive,required"`
Keyring Keyring `mapstructure:"keyring" validate:"required,gt=0,dive,required"`
Account Account `mapstructure:"account"`
Keyring Keyring `mapstructure:"keyring"`
RPC RPC `mapstructure:"rpc" validate:"required,gt=0,dive,required"`
Telemetry telemetry.Config `mapstructure:"telemetry"`
GasAdjustment float64 `mapstructure:"gas_adjustment"`
Expand Down Expand Up @@ -86,15 +86,15 @@ type (
// Account defines account related configuration that is related to the Ojo
// network and transaction signing functionality.
Account struct {
ChainID string `mapstructure:"chain_id" validate:"required"`
Address string `mapstructure:"address" validate:"required"`
Validator string `mapstructure:"validator" validate:"required"`
ChainID string `mapstructure:"chain_id"`
Address string `mapstructure:"address"`
Validator string `mapstructure:"validator"`
}

// Keyring defines the required Ojo keyring configuration.
Keyring struct {
Backend string `mapstructure:"backend" validate:"required"`
Dir string `mapstructure:"dir" validate:"required"`
Backend string `mapstructure:"backend"`
Dir string `mapstructure:"dir"`
}

// RPC defines RPC configuration of both the Ojo gRPC and Tendermint nodes.
Expand Down Expand Up @@ -156,7 +156,7 @@ func (c Config) Validate() (err error) {

func (c Config) validateDeviations() error {
for _, deviation := range c.Deviations {
threshold, err := sdk.NewDecFromStr(deviation.Threshold)
threshold, err := math.LegacyNewDecFromStr(deviation.Threshold)
if err != nil {
return fmt.Errorf("deviation thresholds must be numeric: %w", err)
}
Expand Down Expand Up @@ -270,11 +270,11 @@ func (c Config) ProviderEndpointsMap() map[types.ProviderName]provider.Endpoint
}

// DeviationsMap converts the deviation_thresholds from the config file into
// a map of sdk.Dec where the key is the base asset.
func (c Config) DeviationsMap() (map[string]sdk.Dec, error) {
deviations := make(map[string]sdk.Dec, len(c.Deviations))
// a map of math.LegacyDec where the key is the base asset.
func (c Config) DeviationsMap() (map[string]math.LegacyDec, error) {
deviations := make(map[string]math.LegacyDec, len(c.Deviations))
for _, deviation := range c.Deviations {
threshold, err := sdk.NewDecFromStr(deviation.Threshold)
threshold, err := math.LegacyNewDecFromStr(deviation.Threshold)
if err != nil {
return nil, err
}
Expand Down
Loading