Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Upgrade Umee branch to SDK v0.47 #208

Closed
Closed
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
145 changes: 79 additions & 66 deletions go.mod

Large diffs are not rendered by default.

314 changes: 173 additions & 141 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 @@
"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"

Check failure on line 15 in oracle/client/client.go

View workflow job for this annotation

GitHub Actions / test-unit

missing go.sum entry for module providing package github.com/umee-network/umee/v6/app (imported by github.com/ojo-network/price-feeder/oracle/client); to add:

Check failure on line 15 in oracle/client/client.go

View workflow job for this annotation

GitHub Actions / test-integration

missing go.sum entry for module providing package github.com/umee-network/umee/v6/app (imported by github.com/ojo-network/price-feeder/oracle/client); to add:

"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 @@
OracleAddrString string
ValidatorAddr sdk.ValAddress
ValidatorAddrString string
Encoding umeeparams.EncodingConfig
Encoding testutil.TestEncodingConfig
GasPrices string
GasAdjustment float64
GRPCEndpoint string
Expand Down
3 changes: 1 addition & 2 deletions oracle/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"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"

Check failure on line 17 in oracle/oracle.go

View workflow job for this annotation

GitHub Actions / test-unit

missing go.sum entry for module providing package github.com/umee-network/umee/v6/x/oracle/types (imported by github.com/ojo-network/price-feeder/oracle); to add:
"golang.org/x/sync/errgroup"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
Expand Down Expand Up @@ -289,7 +289,6 @@
providerCandles types.AggregatedProviderCandles,
providerPrices types.AggregatedProviderPrices,
) (types.CurrencyPairDec, error) {

conversionRates, err := CalcCurrencyPairRates(
providerCandles,
providerPrices,
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
2 changes: 1 addition & 1 deletion oracle/provider/uniswap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/hasura/go-graphql-client"
"github.com/rs/zerolog"
"github.com/stretchr/testify/suite"
"github.com/tendermint/tendermint/libs/rand"
"github.com/cometbft/cometbft/libs/rand"

"github.com/ojo-network/price-feeder/oracle/types"
)
Expand Down
2 changes: 1 addition & 1 deletion price-feeder.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ provider_timeout = "1000000s"
[server]
listen_addr = "0.0.0.0:7171"
read_timeout = "20s"
verbose_cors = true
verbose_cors = false
write_timeout = "20s"

[account]
Expand Down
Loading