Skip to content

Commit

Permalink
fix err
Browse files Browse the repository at this point in the history
  • Loading branch information
neitdung committed Jan 7, 2025
1 parent 735a815 commit e489374
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 22 deletions.
16 changes: 7 additions & 9 deletions database/bank_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"

dbtypes "github.com/forbole/callisto/v4/database/types"

bddbtypes "github.com/forbole/callisto/v4/database/types"
)

func (suite *DbTestSuite) TestBigDipperDb_SaveSupply() {
Expand All @@ -19,9 +17,9 @@ func (suite *DbTestSuite) TestBigDipperDb_SaveSupply() {
suite.Require().NoError(err)

// Verify the data
expected := bddbtypes.NewSupplyRow(dbtypes.NewDbCoins(original), 10)
expected := dbtypes.NewSupplyRow(dbtypes.NewDbCoins(original), 10)

var rows []bddbtypes.SupplyRow
var rows []dbtypes.SupplyRow
err = suite.database.Sqlx.Select(&rows, `SELECT * FROM supply`)
suite.Require().NoError(err)
suite.Require().Len(rows, 1, "supply table should contain only one row")
Expand All @@ -38,7 +36,7 @@ func (suite *DbTestSuite) TestBigDipperDb_SaveSupply() {
suite.Require().NoError(err)

// Verify the data
rows = []bddbtypes.SupplyRow{}
rows = []dbtypes.SupplyRow{}
err = suite.database.Sqlx.Select(&rows, `SELECT * FROM supply`)
suite.Require().NoError(err)
suite.Require().Len(rows, 1, "supply table should contain only one row")
Expand All @@ -52,9 +50,9 @@ func (suite *DbTestSuite) TestBigDipperDb_SaveSupply() {
suite.Require().NoError(err)

// Verify the data
expected = bddbtypes.NewSupplyRow(dbtypes.NewDbCoins(coins), 10)
expected = dbtypes.NewSupplyRow(dbtypes.NewDbCoins(coins), 10)

rows = []bddbtypes.SupplyRow{}
rows = []dbtypes.SupplyRow{}
err = suite.database.Sqlx.Select(&rows, `SELECT * FROM supply`)
suite.Require().NoError(err)
suite.Require().Len(rows, 1, "supply table should contain only one row")
Expand All @@ -68,9 +66,9 @@ func (suite *DbTestSuite) TestBigDipperDb_SaveSupply() {
suite.Require().NoError(err)

// Verify the data
expected = bddbtypes.NewSupplyRow(dbtypes.NewDbCoins(coins), 20)
expected = dbtypes.NewSupplyRow(dbtypes.NewDbCoins(coins), 20)

rows = []bddbtypes.SupplyRow{}
rows = []dbtypes.SupplyRow{}
err = suite.database.Sqlx.Select(&rows, `SELECT * FROM supply`)
suite.Require().NoError(err)
suite.Require().Len(rows, 1, "supply table should contain only one row")
Expand Down
17 changes: 8 additions & 9 deletions database/distribution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/forbole/callisto/v4/types"

distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
bddbtypes "github.com/forbole/callisto/v4/database/types"
)

func (suite *DbTestSuite) TestBigDipperDb_SaveCommunityPool() {
Expand All @@ -21,8 +20,8 @@ func (suite *DbTestSuite) TestBigDipperDb_SaveCommunityPool() {
suite.Require().NoError(err)

// Verify data
expected := bddbtypes.NewCommunityPoolRow(dbtypes.NewDbDecCoins(original), 10)
var rows []bddbtypes.CommunityPoolRow
expected := dbtypes.NewCommunityPoolRow(dbtypes.NewDbDecCoins(original), 10)
var rows []dbtypes.CommunityPoolRow
err = suite.database.Sqlx.Select(&rows, `SELECT * FROM community_pool`)
suite.Require().NoError(err)
suite.Require().Len(rows, 1, "community_pool table should contain only one row")
Expand All @@ -36,8 +35,8 @@ func (suite *DbTestSuite) TestBigDipperDb_SaveCommunityPool() {
suite.Require().NoError(err)

// Verify data
expected = bddbtypes.NewCommunityPoolRow(dbtypes.NewDbDecCoins(original), 10)
rows = []bddbtypes.CommunityPoolRow{}
expected = dbtypes.NewCommunityPoolRow(dbtypes.NewDbDecCoins(original), 10)
rows = []dbtypes.CommunityPoolRow{}
err = suite.database.Sqlx.Select(&rows, `SELECT * FROM community_pool`)
suite.Require().NoError(err)
suite.Require().Len(rows, 1, "community_pool table should contain only one row")
Expand All @@ -51,8 +50,8 @@ func (suite *DbTestSuite) TestBigDipperDb_SaveCommunityPool() {
suite.Require().NoError(err)

// Verify data
expected = bddbtypes.NewCommunityPoolRow(dbtypes.NewDbDecCoins(coins), 10)
rows = []bddbtypes.CommunityPoolRow{}
expected = dbtypes.NewCommunityPoolRow(dbtypes.NewDbDecCoins(coins), 10)
rows = []dbtypes.CommunityPoolRow{}
err = suite.database.Sqlx.Select(&rows, `SELECT * FROM community_pool`)
suite.Require().NoError(err)
suite.Require().Len(rows, 1, "community_pool table should contain only one row")
Expand All @@ -66,8 +65,8 @@ func (suite *DbTestSuite) TestBigDipperDb_SaveCommunityPool() {
suite.Require().NoError(err)

// Verify data
expected = bddbtypes.NewCommunityPoolRow(dbtypes.NewDbDecCoins(coins), 11)
rows = []bddbtypes.CommunityPoolRow{}
expected = dbtypes.NewCommunityPoolRow(dbtypes.NewDbDecCoins(coins), 11)
rows = []dbtypes.CommunityPoolRow{}
err = suite.database.Sqlx.Select(&rows, `SELECT * FROM community_pool`)
suite.Require().NoError(err)
suite.Require().Len(rows, 1, "community_pool table should contain only one row")
Expand Down
2 changes: 1 addition & 1 deletion database/multistaking.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (db *Db) SaveMSEvent(msEvents []dbtypes.MSEvent, height int64) error {
var param []interface{}
for i, msEvent := range msEvents {
vi := i * 5
query += fmt.Sprintf("($%d,$%d,$%d),", vi+1, vi+2, vi+3, vi+4, vi+5)
query += fmt.Sprintf("($%d,$%d,$%d,$%d,$%d),", vi+1, vi+2, vi+3, vi+4, vi+5)
param = append(param, height, msEvent.Name, msEvent.ValAddr, msEvent.DelAddr, msEvent.Amount)
}

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ require (
github.com/cometbft/cometbft v0.38.12
github.com/cosmos/cosmos-sdk v0.50.10
github.com/cosmos/gogoproto v1.7.0
github.com/cosmos/ibc-go/v8 v8.5.1
github.com/evmos/os v0.0.0-20241002122822-02a9121016ee
github.com/forbole/juno/v6 v6.0.1
github.com/go-co-op/gocron v1.37.0
github.com/golangci/golangci-lint v1.55.2
Expand All @@ -22,6 +24,7 @@ require (
github.com/pelletier/go-toml v1.9.5
github.com/prometheus/client_golang v1.20.1
github.com/proullon/ramsql v0.1.3
github.com/realio-tech/multi-staking-module v0.0.0-00010101000000-000000000000
github.com/realiotech/realio-network v1.0.0-rc5-testnet
github.com/rs/zerolog v1.33.0
github.com/spf13/cobra v1.8.1
Expand Down Expand Up @@ -110,7 +113,6 @@ require (
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/iavl v1.2.0 // indirect
github.com/cosmos/ibc-go/modules/capability v1.0.1 // indirect
github.com/cosmos/ibc-go/v8 v8.5.1 // indirect
github.com/cosmos/ics23/go v0.11.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
github.com/curioswitch/go-reassign v0.2.0 // indirect
Expand All @@ -129,7 +131,6 @@ require (
github.com/esimonov/ifshort v1.0.4 // indirect
github.com/ethereum/go-ethereum v1.11.5 // indirect
github.com/ettle/strcase v0.1.1 // indirect
github.com/evmos/os v0.0.0-20241002122822-02a9121016ee // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/fatih/structtag v1.2.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
Expand Down Expand Up @@ -273,7 +274,6 @@ require (
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/realio-tech/multi-staking-module v0.0.0-00010101000000-000000000000 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
Expand Down

0 comments on commit e489374

Please sign in to comment.