Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.
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
28 changes: 13 additions & 15 deletions tests/e2e/block_sdk_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,24 @@ var (
NumFullNodes: &numFullNodes,
Version: "latest",
NoHostMount: &noHostMount,
GasAdjustment: &gasAdjustment,
ChainConfig: ibc.ChainConfig{
EncodingConfig: encodingConfig,
Images: []ibc.DockerImage{
image,
},
Type: "cosmos",
Name: "block-sdk",
Denom: denom,
ChainID: "chain-id-0",
Bin: "testappd",
Bech32Prefix: "cosmos",
CoinType: "118",
GasAdjustment: gasAdjustment,
GasPrices: fmt.Sprintf("0%s", denom),
TrustingPeriod: "48h",
NoHostMount: noHostMount,
UsingNewGenesisCommand: true,
ModifyGenesis: cosmos.ModifyGenesis(genesisKV),
ConfigFileOverrides: map[string]any{"config/config.toml": ictestutil.Toml{"consensus": consensusParams}},
Type: "cosmos",
Name: "block-sdk",
Denom: denom,
ChainID: "chain-id-0",
Bin: "testappd",
Bech32Prefix: "cosmos",
CoinType: "118",
GasAdjustment: gasAdjustment,
GasPrices: fmt.Sprintf("0%s", denom),
TrustingPeriod: "48h",
NoHostMount: noHostMount,
ModifyGenesis: cosmos.ModifyGenesis(genesisKV),
ConfigFileOverrides: map[string]any{"config/config.toml": ictestutil.Toml{"consensus": consensusParams}},
},
}
)
Expand Down
14 changes: 7 additions & 7 deletions tests/e2e/block_sdk_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"github.com/skip-mev/block-sdk/lanes/free"
)

const (
initBalance = 1000000000000
var (
initBalance = sdk.NewInt(1000000000000)
)

type committedTx struct {
Expand Down Expand Up @@ -694,7 +694,7 @@ func (s *E2ETestSuite) TestInvalidBids() {
msgs[i] = Tx{
User: s.user1,
Msgs: []sdk.Msg{banktypes.NewMsgSend(s.user1.Address(), s.user2.Address(), sdk.NewCoins(sdk.NewCoin(s.denom, sdk.NewInt(100))))},
SequenceIncrement: uint64(i + 1),
SequenceIncrement: int64(i + 1),
Height: height + 1,
}
}
Expand Down Expand Up @@ -1301,7 +1301,7 @@ func (s *E2ETestSuite) TestNetwork() {
for i := 0; i < numTxs; i++ {
for _, user := range s.fuzzusers {
fee := rand.Int63n(100000)
sequenceOffset := uint64(i)
sequenceOffset := int64(i)

normalTx := s.CreateDummyNormalTx(user, s.user1, sendAmount, sequenceOffset, fee)
s.BroadcastTxs(context.Background(), s.chain.(*cosmos.CosmosChain), []Tx{normalTx})
Expand Down Expand Up @@ -1329,7 +1329,7 @@ func (s *E2ETestSuite) TestNetwork() {

for i := 0; i < numTxs; i++ {
for _, user := range s.fuzzusers {
sequenceOffset := uint64(i)
sequenceOffset := int64(i)

freeTx := s.CreateDummyFreeTx(user, validators[0], delegation, sequenceOffset)
s.BroadcastTxs(context.Background(), s.chain.(*cosmos.CosmosChain), []Tx{freeTx})
Expand Down Expand Up @@ -1403,7 +1403,7 @@ func (s *E2ETestSuite) TestNetwork() {

for i := 0; i < numTxs; i++ {
for _, user := range s.fuzzusers[3:6] {
sequenceOffset := uint64(i)
sequenceOffset := int64(i)

freeTx := s.CreateDummyFreeTx(user, validators[0], delegation, sequenceOffset)
txs = append(txs, freeTx)
Expand All @@ -1414,7 +1414,7 @@ func (s *E2ETestSuite) TestNetwork() {
for i := 0; i < numTxs; i++ {
for _, user := range s.fuzzusers[6:10] {
fee := rand.Int63n(100000)
sequenceOffset := uint64(i)
sequenceOffset := int64(i)
normalTx := s.CreateDummyNormalTx(user, s.user1, sendAmount, sequenceOffset, fee)
txs = append(txs, normalTx)
}
Expand Down
22 changes: 11 additions & 11 deletions tests/e2e/chain_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func BuildInterchain(t *testing.T, ctx context.Context, chain ibc.Chain) *interc
}

// CreateTx creates a new transaction to be signed by the given user, including a provided set of messages
func (s *E2ETestSuite) CreateTx(ctx context.Context, chain *cosmos.CosmosChain, user cosmos.User, seqIncrement, height uint64, GasPrice int64, msgs ...sdk.Msg) []byte {
func (s *E2ETestSuite) CreateTx(ctx context.Context, chain *cosmos.CosmosChain, user cosmos.User, seqIncrement, height int64, GasPrice int64, msgs ...sdk.Msg) []byte {
// create tx factory + Client Context
txf, err := s.bc.GetFactory(ctx, user)
s.Require().NoError(err)
Expand All @@ -105,14 +105,14 @@ func (s *E2ETestSuite) CreateTx(ctx context.Context, chain *cosmos.CosmosChain,

// set timeout height
if height != 0 {
txf = txf.WithTimeoutHeight(height)
txf = txf.WithTimeoutHeight(uint64(height))
}

// get gas for tx
txf.WithGas(25000000)

// update sequence number
txf = txf.WithSequence(txf.Sequence() + seqIncrement)
txf = txf.WithSequence(txf.Sequence() + uint64(seqIncrement))
txf = txf.WithGasPrices(sdk.NewDecCoins(sdk.NewDecCoin(chain.Config().Denom, math.NewInt(GasPrice))).String())

// sign the tx
Expand All @@ -128,7 +128,7 @@ func (s *E2ETestSuite) CreateTx(ctx context.Context, chain *cosmos.CosmosChain,
}

func (s *E2ETestSuite) CreateDummyAuctionBidTx(
height uint64,
height int64,
searcher ibc.Wallet,
bid sdk.Coin,
) Tx {
Expand All @@ -151,7 +151,7 @@ func (s *E2ETestSuite) CreateDummyAuctionBidTx(
func (s *E2ETestSuite) CreateDummyNormalTx(
from, to ibc.Wallet,
coins sdk.Coins,
sequenceOffset uint64,
sequenceOffset int64,
gasPrice int64,
) Tx {
msgSend := banktypes.NewMsgSend(
Expand All @@ -174,7 +174,7 @@ func (s *E2ETestSuite) CreateDummyFreeTx(
user ibc.Wallet,
validator sdk.ValAddress,
delegation sdk.Coin,
sequenceOffset uint64,
sequenceOffset int64,
) Tx {
delegateMsg := stakingtypes.NewMsgDelegate(
sdk.AccAddress(user.Address()),
Expand Down Expand Up @@ -218,8 +218,8 @@ type Tx struct {
User cosmos.User
Msgs []sdk.Msg
GasPrice int64
SequenceIncrement uint64
Height uint64
SequenceIncrement int64
Height int64
SkipInclusionCheck bool
ExpectFail bool
IgnoreChecks bool
Expand Down Expand Up @@ -425,7 +425,7 @@ func Block(t *testing.T, chain *cosmos.CosmosChain, height int64) *rpctypes.Resu
}

// WaitForHeight waits for the chain to reach the given height
func WaitForHeight(t *testing.T, chain *cosmos.CosmosChain, height uint64) {
func WaitForHeight(t *testing.T, chain *cosmos.CosmosChain, height int64) {
// wait for next height
err := testutil.WaitForCondition(30*time.Second, 100*time.Millisecond, func() (bool, error) {
pollHeight, err := chain.Height(context.Background())
Expand All @@ -439,8 +439,8 @@ func WaitForHeight(t *testing.T, chain *cosmos.CosmosChain, height uint64) {

// VerifyBlockWithExpectedBlock takes in a list of raw tx bytes and compares each tx hash to the tx hashes in the block.
// The expected block is the block that should be returned by the chain at the given height.
func VerifyBlockWithExpectedBlock(t *testing.T, chain *cosmos.CosmosChain, height uint64, txs [][]byte) {
block := Block(t, chain, int64(height))
func VerifyBlockWithExpectedBlock(t *testing.T, chain *cosmos.CosmosChain, height int64, txs [][]byte) {
block := Block(t, chain, height)
blockTxs := block.Block.Data.Txs

t.Logf("verifying block %d", height)
Expand Down
76 changes: 41 additions & 35 deletions tests/e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,37 @@ require (
cosmossdk.io/api v0.3.1 // indirect
cosmossdk.io/core v0.6.1 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
cosmossdk.io/errors v1.0.0 // indirect
cosmossdk.io/errors v1.0.1 // indirect
cosmossdk.io/log v1.2.1 // indirect
cosmossdk.io/math v1.2.0
cosmossdk.io/tools/rosetta v0.2.1 // indirect
github.com/cosmos/cosmos-sdk v0.47.6
github.com/skip-mev/block-sdk v1.0.0 // reference local
github.com/strangelove-ventures/interchaintest/v7 v7.0.0-20230905210439-3e17efc70581
github.com/strangelove-ventures/interchaintest/v7 v7.0.1-0.20240325195828-f24fdd5fa4cd
github.com/stretchr/testify v1.8.4
go.uber.org/zap v1.25.0
golang.org/x/sync v0.5.0
golang.org/x/sync v0.6.0
)

require (
github.com/cometbft/cometbft v0.37.2
google.golang.org/grpc v1.59.0
google.golang.org/grpc v1.60.1
)

require (
cloud.google.com/go v0.110.9 // indirect
cloud.google.com/go/compute v1.23.2 // indirect
cloud.google.com/go v0.110.10 // indirect
cloud.google.com/go/compute v1.23.3 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.4 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
cloud.google.com/go/iam v1.1.5 // indirect
cloud.google.com/go/storage v1.35.1 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.2 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect
github.com/ChainSafe/go-schnorrkel/1 v0.0.0-00010101000000-000000000000 // indirect
github.com/ComposableFi/go-subkey/v2 v2.0.0-tm03420 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
Expand All @@ -64,11 +65,13 @@ require (
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/cockroachdb/errors v1.10.0 // indirect
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v1.1.0 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect
github.com/cometbft/cometbft-db v0.8.0 // indirect
github.com/cometbft/cometbft-db v0.11.0 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect
Expand Down Expand Up @@ -98,10 +101,10 @@ require (
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/dvsekhvalnov/jose2go v1.5.1-0.20231206184617-48ba0b76bc88 // indirect
github.com/ethereum/go-ethereum v1.10.20 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/getsentry/sentry-go v0.23.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
Expand All @@ -119,8 +122,8 @@ require (
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/mux v1.8.1 // indirect
Expand Down Expand Up @@ -153,7 +156,7 @@ require (
github.com/lib/pq v1.10.9 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-libp2p v0.27.8 // indirect
github.com/linxGnu/grocksdb v1.8.0 // indirect
github.com/linxGnu/grocksdb v1.8.12 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand Down Expand Up @@ -190,17 +193,19 @@ require (
github.com/rakyll/statik v0.1.7 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rs/cors v1.8.3 // indirect
github.com/rs/zerolog v1.30.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.16.0 // indirect
github.com/spf13/viper v1.18.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
Expand All @@ -210,25 +215,26 @@ require (
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.18.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.143.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/api v0.153.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading