mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 23:02:16 +00:00
As per conversation here: https://github.com/tendermint/tendermint/pull/3218#discussion_r251364041 This is the result of running the following code on the repo: ```bash find . -name '*.go' | grep -v 'vendor/' | xargs -n 1 goimports -w ```
34 lines
850 B
Go
34 lines
850 B
Go
package core_grpc_test
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/tendermint/tendermint/abci/example/kvstore"
|
|
core_grpc "github.com/tendermint/tendermint/rpc/grpc"
|
|
rpctest "github.com/tendermint/tendermint/rpc/test"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
// start a tendermint node in the background to test against
|
|
app := kvstore.NewKVStoreApplication()
|
|
node := rpctest.StartTendermint(app)
|
|
code := m.Run()
|
|
|
|
// and shut down proper at the end
|
|
node.Stop()
|
|
node.Wait()
|
|
os.Exit(code)
|
|
}
|
|
|
|
func TestBroadcastTx(t *testing.T) {
|
|
require := require.New(t)
|
|
res, err := rpctest.GetGRPCClient().BroadcastTx(context.Background(), &core_grpc.RequestBroadcastTx{Tx: []byte("this is a tx")})
|
|
require.Nil(err, "%+v", err)
|
|
require.EqualValues(0, res.CheckTx.Code)
|
|
require.EqualValues(0, res.DeliverTx.Code)
|
|
}
|