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

Quick and dirty ABCI++ branch #61

Closed
wants to merge 3 commits into from
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
21 changes: 21 additions & 0 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,27 @@ func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx

}

func (app *BaseApp) PrepareProposal(req abci.RequestPrepareProposal) abci.ResponsePrepareProposal {
return abci.ResponsePrepareProposal{
BlockData: req.BlockData,
}
}

func (app *BaseApp) ProcessProposal(req abci.RequestProcessProposal) abci.ResponseProcessProposal {
return abci.ResponseProcessProposal{
Result: abci.ResponseProcessProposal_ACCEPT,
}
}

func (app *BaseApp) ExtendVote(req abci.RequestExtendVote) abci.ResponseExtendVote {
return abci.ResponseExtendVote{}
}

// Verify application's vote extension data
func (app *BaseApp) VerifyVoteExtension(req abci.RequestVerifyVoteExtension) abci.ResponseVerifyVoteExtension {
return abci.ResponseVerifyVoteExtension{}
}

// Commit implements the ABCI interface. It will commit all state that exists in
// the deliver state's multi-store and includes the resulting commit ID in the
// returned abci.ResponseCommit. Commit will set the check state based on the
Expand Down
2 changes: 1 addition & 1 deletion baseapp/baseapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (ps *paramStore) Get(_ sdk.Context, key []byte, ptr interface{}) {
}

func defaultLogger() log.Logger {
logger, _ := log.NewDefaultLogger("plain", "info", false)
logger, _ := log.NewDefaultLogger("plain", "info")
return logger.With("module", "sdk/app")
}

Expand Down
2 changes: 1 addition & 1 deletion baseapp/grpcrouter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestRegisterQueryServiceTwice(t *testing.T) {
// Setup baseapp.
db := dbm.NewMemDB()
encCfg := simapp.MakeTestEncodingConfig()
logger, _ := log.NewDefaultLogger("plain", "info", false)
logger, _ := log.NewDefaultLogger("plain", "info")
app := baseapp.NewBaseApp("test", logger, db)
app.SetInterfaceRegistry(encCfg.InterfaceRegistry)
testdata.RegisterInterfaces(encCfg.InterfaceRegistry)
Expand Down
18 changes: 17 additions & 1 deletion client/grpc/tmservice/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"testing"
"time"

"github.com/stretchr/testify/suite"

Expand All @@ -26,6 +27,7 @@ type IntegrationTestSuite struct {
}

func (s *IntegrationTestSuite) SetupSuite() {
fmt.Println("setting up suite ===================================================================")
s.T().Log("setting up integration test suite")

cfg := network.DefaultConfig()
Expand All @@ -38,17 +40,20 @@ func (s *IntegrationTestSuite) SetupSuite() {
s.Require().NoError(err)

_, err = s.network.WaitForHeight(1)
fmt.Println("done waiting for height 1 ------")
s.Require().NoError(err)

s.queryClient = tmservice.NewServiceClient(s.network.Validators[0].ClientCtx)
}

func (s *IntegrationTestSuite) TearDownSuite() {
s.T().Log("tearing down integration test suite")
fmt.Println("cleaning up -----------------------------------------------------------------------------------------")
s.network.Cleanup()
}

func (s IntegrationTestSuite) TestQueryNodeInfo() {
fmt.Println("testing query node info")
val := s.network.Validators[0]

res, err := s.queryClient.GetNodeInfo(context.Background(), &tmservice.GetNodeInfoRequest{})
Expand All @@ -63,6 +68,7 @@ func (s IntegrationTestSuite) TestQueryNodeInfo() {
}

func (s IntegrationTestSuite) TestQuerySyncing() {
fmt.Println("testing syncing query")
val := s.network.Validators[0]

_, err := s.queryClient.GetSyncing(context.Background(), &tmservice.GetSyncingRequest{})
Expand All @@ -75,6 +81,7 @@ func (s IntegrationTestSuite) TestQuerySyncing() {
}

func (s IntegrationTestSuite) TestQueryLatestBlock() {
fmt.Println("testing latest BLOCK height")
val := s.network.Validators[0]

_, err := s.queryClient.GetLatestBlock(context.Background(), &tmservice.GetLatestBlockRequest{})
Expand All @@ -87,17 +94,22 @@ func (s IntegrationTestSuite) TestQueryLatestBlock() {
}

func (s IntegrationTestSuite) TestQueryBlockByHeight() {
fmt.Println("querying by block height")
val := s.network.Validators[0]
_, err := s.queryClient.GetBlockByHeight(context.Background(), &tmservice.GetBlockByHeightRequest{Height: 1})
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
defer cancel()
_, err := s.queryClient.GetBlockByHeight(ctx, &tmservice.GetBlockByHeightRequest{Height: 1})
s.Require().NoError(err)

fmt.Println("doing the rest thing")
restRes, err := rest.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/blocks/%d", val.APIAddress, 1))
s.Require().NoError(err)
var blockInfoRes tmservice.GetBlockByHeightResponse
s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(restRes, &blockInfoRes))
}

func (s IntegrationTestSuite) TestQueryLatestValidatorSet() {
fmt.Println("testing query latest validator set")
val := s.network.Validators[0]

// nil pagination
Expand Down Expand Up @@ -133,6 +145,7 @@ func (s IntegrationTestSuite) TestQueryLatestValidatorSet() {
}

func (s IntegrationTestSuite) TestLatestValidatorSet_GRPC() {
fmt.Println("testing latest validator set grpc")
vals := s.network.Validators
testCases := []struct {
name string
Expand Down Expand Up @@ -164,6 +177,7 @@ func (s IntegrationTestSuite) TestLatestValidatorSet_GRPC() {
}

func (s IntegrationTestSuite) TestLatestValidatorSet_GRPCGateway() {
fmt.Println("testing latest validator set by gateway")
vals := s.network.Validators
testCases := []struct {
name string
Expand Down Expand Up @@ -196,6 +210,7 @@ func (s IntegrationTestSuite) TestLatestValidatorSet_GRPCGateway() {
}

func (s IntegrationTestSuite) TestValidatorSetByHeight_GRPC() {
fmt.Println("testing latest validator set by height")
vals := s.network.Validators
testCases := []struct {
name string
Expand Down Expand Up @@ -225,6 +240,7 @@ func (s IntegrationTestSuite) TestValidatorSetByHeight_GRPC() {
}

func (s IntegrationTestSuite) TestValidatorSetByHeight_GRPCGateway() {
fmt.Println("testing latest validator set gprc")
vals := s.network.Validators
testCases := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion crypto/armor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import (
"github.com/stretchr/testify/require"
"github.com/tendermint/crypto/bcrypt"
tmcrypto "github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/xsalsa20symmetric"

"github.com/cosmos/cosmos-sdk/codec/legacy"
"github.com/cosmos/cosmos-sdk/crypto"
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/crypto/xsalsa20symmetric"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/types"
)
Expand Down
13 changes: 7 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@ require (
cloud.google.com/go v0.99.0 // indirect
cloud.google.com/go/storage v1.14.0 // indirect
filippo.io/edwards25519 v1.0.0-beta.2 // indirect
github.com/Workiva/go-datastructures v1.0.53 // indirect
github.com/aws/aws-sdk-go v1.40.45 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/celestiaorg/go-leopard v0.1.0 // indirect
github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4 // indirect
github.com/celestiaorg/nmt v0.8.0 // indirect
github.com/celestiaorg/rsmt2d v0.3.0 // indirect
github.com/cenkalti/backoff/v4 v4.1.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
Expand All @@ -77,8 +80,6 @@ require (
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c // indirect
github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-kit/kit v0.12.0 // indirect
Expand Down Expand Up @@ -107,26 +108,24 @@ require (
github.com/lib/pq v1.10.4 // indirect
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20210609091139-0a56a4bca00b // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
github.com/rs/cors v1.8.2 // indirect
github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect
github.com/spf13/afero v1.8.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
github.com/ulikunitz/xz v0.5.8 // indirect
github.com/vivint/infectious v0.0.0-20200605153912-25a574ae18a3 // indirect
github.com/zondax/hid v0.9.0 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.opencensus.io v0.23.0 // indirect
Expand Down Expand Up @@ -154,3 +153,5 @@ replace github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210
replace github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0

replace github.com/cosmos/cosmos-sdk/db => ./db

replace github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v0.0.2-0.20220213210438-e45fc9406561
Loading