Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojtek committed Nov 2, 2023
1 parent a0c188d commit f391ed0
Show file tree
Hide file tree
Showing 31 changed files with 133 additions and 709 deletions.
6 changes: 3 additions & 3 deletions database/assetft_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/json"
"fmt"

dbtypes "github.com/forbole/bdjuno/v3/database/types"
"github.com/forbole/bdjuno/v3/types"
dbtypes "github.com/forbole/bdjuno/v4/database/types"
"github.com/forbole/bdjuno/v4/types"

assetfttypes "github.com/CoreumFoundation/coreum/v3/x/asset/ft/types"
)
Expand All @@ -25,7 +25,7 @@ ON CONFLICT (one_row_id) DO UPDATE
height = excluded.height
WHERE assetft_params.height <= excluded.height`

_, err = db.Sql.Exec(stmt, string(paramsBz), params.Height)
_, err = db.SQL.Exec(stmt, string(paramsBz), params.Height)
if err != nil {
return fmt.Errorf("error while storing assetft params: %s", err)
}
Expand Down
6 changes: 3 additions & 3 deletions database/assetft_params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package database_test
import (
"encoding/json"

dbtypes "github.com/forbole/bdjuno/v3/database/types"
"github.com/forbole/bdjuno/v3/types"
dbtypes "github.com/forbole/bdjuno/v4/database/types"
"github.com/forbole/bdjuno/v4/types"

assetfttypes "github.com/CoreumFoundation/coreum/v3/x/asset/ft/types"
)
Expand Down Expand Up @@ -32,7 +32,7 @@ func (suite *DbTestSuite) TestGetAssetFTParams() {
paramsBz, err := json.Marshal(&assetFTParams)
suite.Require().NoError(err)

_, err = suite.database.Sql.Exec(
_, err = suite.database.SQL.Exec(
`INSERT INTO assetft_params (params, height) VALUES ($1, $2)`,
string(paramsBz), 10,
)
Expand Down
6 changes: 3 additions & 3 deletions database/assetnft_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/json"
"fmt"

dbtypes "github.com/forbole/bdjuno/v3/database/types"
"github.com/forbole/bdjuno/v3/types"
dbtypes "github.com/forbole/bdjuno/v4/database/types"
"github.com/forbole/bdjuno/v4/types"

assetnfttypes "github.com/CoreumFoundation/coreum/v3/x/asset/nft/types"
)
Expand All @@ -25,7 +25,7 @@ ON CONFLICT (one_row_id) DO UPDATE
height = excluded.height
WHERE assetnft_params.height <= excluded.height`

_, err = db.Sql.Exec(stmt, string(paramsBz), params.Height)
_, err = db.SQL.Exec(stmt, string(paramsBz), params.Height)
if err != nil {
return fmt.Errorf("error while storing assetnft params: %s", err)
}
Expand Down
6 changes: 3 additions & 3 deletions database/assetnft_params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package database_test
import (
"encoding/json"

dbtypes "github.com/forbole/bdjuno/v3/database/types"
"github.com/forbole/bdjuno/v3/types"
dbtypes "github.com/forbole/bdjuno/v4/database/types"
"github.com/forbole/bdjuno/v4/types"

assetnfttypes "github.com/CoreumFoundation/coreum/v3/x/asset/nft/types"
)
Expand Down Expand Up @@ -32,7 +32,7 @@ func (suite *DbTestSuite) TestGetAssetNFTParams() {
paramsBz, err := json.Marshal(&assetNFTParams)
suite.Require().NoError(err)

_, err = suite.database.Sql.Exec(
_, err = suite.database.SQL.Exec(
`INSERT INTO assetnft_params (params, height) VALUES ($1, $2)`,
string(paramsBz), 10,
)
Expand Down
6 changes: 3 additions & 3 deletions database/customparams_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"encoding/json"
"fmt"

"github.com/forbole/bdjuno/v3/types"
"github.com/forbole/bdjuno/v4/types"

dbtypes "github.com/forbole/bdjuno/v3/database/types"
dbtypes "github.com/forbole/bdjuno/v4/database/types"
)

// SaveCustomParamsParams saves the given x/customparams parameters inside the database
Expand All @@ -23,7 +23,7 @@ ON CONFLICT (one_row_id) DO UPDATE
SET staking_params = excluded.staking_params,
height = excluded.height
WHERE customparams_params.height <= excluded.height`
_, err = db.Sql.Exec(stmt, string(stakingParamsBz), params.Height)
_, err = db.SQL.Exec(stmt, string(stakingParamsBz), params.Height)
if err != nil {
return fmt.Errorf("error while storing customparams params: %s", err)
}
Expand Down
6 changes: 3 additions & 3 deletions database/customparams_params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package database_test
import (
"encoding/json"

dbtypes "github.com/forbole/bdjuno/v3/database/types"
"github.com/forbole/bdjuno/v3/types"
dbtypes "github.com/forbole/bdjuno/v4/database/types"
"github.com/forbole/bdjuno/v4/types"

customparamstypes "github.com/CoreumFoundation/coreum/v3/x/customparams/types"
)
Expand Down Expand Up @@ -34,7 +34,7 @@ func (suite *DbTestSuite) TestGetCustomParamsParams() {
paramsBz, err := json.Marshal(&customparamsParams)
suite.Require().NoError(err)

_, err = suite.database.Sql.Exec(
_, err = suite.database.SQL.Exec(
`INSERT INTO customparams_params (staking_params, height) VALUES ($1, $2)`,
string(paramsBz), 10,
)
Expand Down
6 changes: 3 additions & 3 deletions database/feemodel_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/json"
"fmt"

dbtypes "github.com/forbole/bdjuno/v3/database/types"
"github.com/forbole/bdjuno/v3/types"
dbtypes "github.com/forbole/bdjuno/v4/database/types"
"github.com/forbole/bdjuno/v4/types"

feemodeltypes "github.com/CoreumFoundation/coreum/v3/x/feemodel/types"
)
Expand All @@ -25,7 +25,7 @@ ON CONFLICT (one_row_id) DO UPDATE
height = excluded.height
WHERE feemodel_params.height <= excluded.height`

_, err = db.Sql.Exec(stmt, string(paramsBz), params.Height)
_, err = db.SQL.Exec(stmt, string(paramsBz), params.Height)
if err != nil {
return fmt.Errorf("error while storing feemodel params: %s", err)
}
Expand Down
6 changes: 3 additions & 3 deletions database/feemodel_params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package database_test
import (
"encoding/json"

dbtypes "github.com/forbole/bdjuno/v3/database/types"
"github.com/forbole/bdjuno/v3/types"
dbtypes "github.com/forbole/bdjuno/v4/database/types"
"github.com/forbole/bdjuno/v4/types"

feemodeltypes "github.com/CoreumFoundation/coreum/v3/x/feemodel/types"
)
Expand Down Expand Up @@ -32,7 +32,7 @@ func (suite *DbTestSuite) TestGetFeeModelParams() {
paramsBz, err := json.Marshal(&feemodelParams)
suite.Require().NoError(err)

_, err = suite.database.Sql.Exec(
_, err = suite.database.SQL.Exec(
`INSERT INTO feemodel_params (params, height) VALUES ($1, $2)`,
string(paramsBz), 10,
)
Expand Down
2 changes: 1 addition & 1 deletion database/staking_validators_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package database_test

import (
tmtypes "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/cometbft/cometbft/proto/tendermint/types"

"github.com/forbole/bdjuno/v4/types"

Expand Down
37 changes: 19 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,29 @@ module github.com/forbole/bdjuno/v4

go 1.20

replace (
// cosmos keyring
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
// dgrijalva/jwt-go is deprecated and doesn't receive security updates.
// TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2
// Fix upstream GHSA-h395-qcrw-5vmq vulnerability.
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0
// https://github.com/cosmos/cosmos-sdk/issues/14949
// pin the version of goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 required by SDK v47 upgrade guide.
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
)
replace github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.47.2

require (
cosmossdk.io/math v1.1.2
cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462
github.com/CoreumFoundation/coreum/v3 v3.0.0-20231102084816-3f621c7b16c0
github.com/CosmWasm/wasmd v0.41.0
github.com/cometbft/cometbft v0.37.2
github.com/cosmos/cosmos-sdk v0.47.5
github.com/cosmos/gogoproto v1.4.10
github.com/forbole/juno/v5 v5.2.0
github.com/go-co-op/gocron v1.35.0
github.com/gogo/protobuf v1.3.2
github.com/golangci/golangci-lint v1.54.2
github.com/jmoiron/sqlx v1.3.5
github.com/lib/pq v1.10.9
github.com/pelletier/go-toml v1.9.5
github.com/prometheus/client_golang v1.17.0
github.com/proullon/ramsql v0.1.2
github.com/rs/zerolog v1.31.0
github.com/samber/lo v1.38.1
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.4
github.com/tendermint/tendermint v0.35.9
google.golang.org/grpc v1.58.0
gopkg.in/yaml.v3 v3.0.1
)
Expand All @@ -60,7 +51,7 @@ require (
github.com/Antonboom/nilnil v0.1.7 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
github.com/CoreumFoundation/coreum/v3 v3.0.0-20231102084816-3f621c7b16c0 // indirect
github.com/CosmWasm/wasmvm v1.3.0 // indirect
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
Expand All @@ -72,6 +63,7 @@ require (
github.com/ashanbrown/forbidigo v1.6.0 // indirect
github.com/ashanbrown/makezero v1.1.1 // indirect
github.com/aws/aws-sdk-go v1.44.203 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
Expand All @@ -91,6 +83,9 @@ require (
github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
github.com/cockroachdb/errors v1.10.0 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect
github.com/cometbft/cometbft-db v0.8.0 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
Expand All @@ -114,6 +109,7 @@ require (
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/esimonov/ifshort v1.0.4 // indirect
Expand All @@ -124,6 +120,7 @@ require (
github.com/firefart/nonamedreturns v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fzipp/gocyclo v0.6.0 // indirect
github.com/getsentry/sentry-go v0.23.0 // indirect
github.com/go-critic/go-critic v0.9.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
Expand All @@ -140,7 +137,6 @@ require (
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.1.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
Expand All @@ -157,6 +153,7 @@ require (
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/uuid v1.3.1 // indirect
Expand Down Expand Up @@ -199,13 +196,16 @@ require (
github.com/kisielk/gotool v1.0.0 // indirect
github.com/kkHAIKE/contextcheck v1.1.4 // indirect
github.com/klauspost/compress v1.16.3 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/kulti/thelper v0.6.3 // indirect
github.com/kunwardeep/paralleltest v1.0.8 // indirect
github.com/kyoh86/exportloopref v0.1.11 // indirect
github.com/ldez/gomoddirectives v0.2.3 // indirect
github.com/ldez/tagliatelle v0.5.0 // indirect
github.com/leonklingele/grouper v1.1.1 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/linxGnu/grocksdb v1.7.16 // indirect
github.com/lufeee/execinquery v1.2.1 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
Expand All @@ -230,6 +230,7 @@ require (
github.com/nishanths/predeclared v0.2.2 // indirect
github.com/nunnatsa/ginkgolinter v0.13.5 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
github.com/pkg/errors v0.9.1 // indirect
Expand All @@ -245,6 +246,7 @@ require (
github.com/rakyll/statik v0.1.7 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rs/cors v1.8.3 // indirect
github.com/ryancurrah/gomodguard v1.3.0 // indirect
github.com/ryanrolds/sqlclosecheck v0.4.0 // indirect
Expand Down Expand Up @@ -272,7 +274,6 @@ require (
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect
github.com/tdakkota/asciicheck v0.2.0 // indirect
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tetafro/godot v1.4.14 // indirect
github.com/tidwall/btree v1.6.0 // indirect
Expand Down Expand Up @@ -329,4 +330,4 @@ require (

// This is to avoid warnings while running the binary
// See here: https://github.com/desmos-labs/desmos/pull/1131#discussion_r1194090419
//replace github.com/cosmos/gogoproto => github.com/cosmos/gogoproto v1.4.8
replace github.com/cosmos/gogoproto => github.com/cosmos/gogoproto v1.4.8
Loading

0 comments on commit f391ed0

Please sign in to comment.