Files
tendermint/rpc/grpc/grpc_test.go
T
Callum WatersandGitHub c5c2aafad2 abci: implement finalize block (#9468)
Adds the `FinalizeBlock` method which replaces `BeginBlock`, `DeliverTx`, and `EndBlock` in a single call.
2022-11-28 23:12:28 +01:00

36 lines
845 B
Go

package coregrpc_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.NewInMemoryApplication()
node := rpctest.StartTendermint(app)
code := m.Run()
// and shut down proper at the end
rpctest.StopTendermint(node)
os.Exit(code)
}
func TestBroadcastTx(t *testing.T) {
res, err := rpctest.GetGRPCClient().BroadcastTx(
context.Background(),
&core_grpc.RequestBroadcastTx{Tx: kvstore.NewTx("hello", "world")},
)
require.NoError(t, err)
require.EqualValues(t, 0, res.CheckTx.Code)
require.EqualValues(t, 0, res.TxResult.Code)
}