Skip to content

Commit

Permalink
Merge branch 'umee' into woz/add-downtime-detector
Browse files Browse the repository at this point in the history
  • Loading branch information
adamewozniak authored Nov 21, 2023
2 parents 31e5f7e + 1da01c3 commit e73de12
Show file tree
Hide file tree
Showing 21 changed files with 753 additions and 994 deletions.
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@v3
with:
go-version: 1.19
go-version: 1.21
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@v3
with:
go-version: 1.19
go-version: 1.21
cache: true

- uses: actions/checkout@v3
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@v3
if: env.GIT_DIFF
with:
go-version: 1.19
go-version: 1.21
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@v3
with:
go-version: 1.19
go-version: 1.21
cache: true
cache-dependency-path: go.sum
# Parse 'umee/v*.*.*' semantic version from 'umee/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@v3
with:
go-version: 1.19
go-version: 1.21
- name: Display Go Version
run: go version
- uses: actions/cache@v3
Expand All @@ -38,7 +38,7 @@ jobs:
- uses: actions/setup-go@v3
if: env.GIT_DIFF
with:
go-version: 1.19
go-version: 1.21
cache: true
cache-dependency-path: go.sum
- name: Test Unit
Expand All @@ -61,7 +61,7 @@ jobs:
- uses: actions/setup-go@v4
if: env.GIT_DIFF
with:
go-version: 1.19
go-version: 1.21
cache: true
- name: Test Integration
env:
Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ issues:
- path: _test\.go
linters:
- gosec
- path: oracle/provider/*
linters:
- gosec
- linters:
- lll
source: "https://"
Expand Down
4 changes: 2 additions & 2 deletions 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-alpine AS builder

RUN apk add --no-cache \
ca-certificates \
Expand All @@ -18,7 +18,7 @@ RUN WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | cut -d ' ' -f 2) &&
-O /lib/libwasmvm_muslc.a && \
# verify checksum
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep $(uname -m) | cut -d ' ' -f 1)
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep $(uname -m).a | cut -d ' ' -f 1)

COPY . .
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build
Expand Down
192 changes: 104 additions & 88 deletions go.mod

Large diffs are not rendered by default.

463 changes: 268 additions & 195 deletions go.sum

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions oracle/client/chain_height.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import (
"fmt"
"sync"

tmrpcclient "github.com/cometbft/cometbft/rpc/client"
rpchttp "github.com/cometbft/cometbft/rpc/client/http"
tmctypes "github.com/cometbft/cometbft/rpc/core/types"
tmtypes "github.com/cometbft/cometbft/types"
"github.com/rs/zerolog"
tmrpcclient "github.com/tendermint/tendermint/rpc/client"
tmctypes "github.com/tendermint/tendermint/rpc/core/types"
tmtypes "github.com/tendermint/tendermint/types"

"github.com/cosmos/cosmos-sdk/client"
)

var (
Expand All @@ -33,14 +36,16 @@ type ChainHeight struct {
// starts a new goroutine subscribed to EventNewBlockHeader.
func NewChainHeight(
ctx context.Context,
rpcClient tmrpcclient.Client,
client client.TendermintRPC,
logger zerolog.Logger,
initialHeight int64,
) (*ChainHeight, error) {
if initialHeight < 1 {
return nil, fmt.Errorf("expected positive initial block height")
}

rpcClient := client.(*rpchttp.HTTP)

if !rpcClient.IsRunning() {
if err := rpcClient.Start(); err != nil {
return nil, err
Expand Down
13 changes: 7 additions & 6 deletions oracle/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,21 @@ import (
"os"
"time"

rpchttp "github.com/cometbft/cometbft/rpc/client/http"
tmjsonclient "github.com/cometbft/cometbft/rpc/jsonrpc/client"
"github.com/rs/zerolog"
umeeapp "github.com/umee-network/umee/v6/app"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/rpc"
"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/rs/zerolog"
rpchttp "github.com/tendermint/tendermint/rpc/client/http"
tmjsonclient "github.com/tendermint/tendermint/rpc/jsonrpc/client"
umeeapp "github.com/umee-network/umee/v4/app"
umeeparams "github.com/umee-network/umee/v4/app/params"
)

type (
Expand All @@ -39,7 +40,7 @@ type (
OracleAddrString string
ValidatorAddr sdk.ValAddress
ValidatorAddrString string
Encoding umeeparams.EncodingConfig
Encoding testutil.TestEncodingConfig
GasPrices string
GasAdjustment float64
GRPCEndpoint string
Expand Down
4 changes: 2 additions & 2 deletions oracle/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/rs/zerolog"
oracletypes "github.com/umee-network/umee/v4/x/oracle/types"
oracletypes "github.com/umee-network/umee/v6/x/oracle/types"
"golang.org/x/sync/errgroup"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
Expand Down Expand Up @@ -499,7 +499,7 @@ func NewProvider(
return provider.NewMockProvider(), nil

case provider.ProviderEthUniswap:
return provider.NewUniswapProvider(ctx, logger, providerName.String(), endpoint, providerPairs...), nil
return provider.NewUniswapProvider(ctx, logger, endpoint, providerPairs...)
}

return nil, fmt.Errorf("provider %s not found", providerName)
Expand Down
2 changes: 1 addition & 1 deletion oracle/param.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package oracle

import oracletypes "github.com/umee-network/umee/v4/x/oracle/types"
import oracletypes "github.com/umee-network/umee/v6/x/oracle/types"

const (
// paramsCacheInterval represents the amount of blocks
Expand Down
2 changes: 1 addition & 1 deletion oracle/param_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/stretchr/testify/require"
oracletypes "github.com/umee-network/umee/v4/x/oracle/types"
oracletypes "github.com/umee-network/umee/v6/x/oracle/types"
)

func TestParamCacheIsOutdated(t *testing.T) {
Expand Down
Loading

0 comments on commit e73de12

Please sign in to comment.