You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
532 B

  1. package rpctest
  2. import (
  3. "testing"
  4. "golang.org/x/net/context"
  5. "github.com/tendermint/tendermint/rpc/grpc"
  6. )
  7. //-------------------------------------------
  8. func TestBroadcastTx(t *testing.T) {
  9. res, err := clientGRPC.BroadcastTx(context.Background(), &core_grpc.RequestBroadcastTx{[]byte("this is a tx")})
  10. if err != nil {
  11. t.Fatal(err)
  12. }
  13. if res.CheckTx.Code != 0 {
  14. t.Fatalf("Non-zero check tx code: %d", res.CheckTx.Code)
  15. }
  16. if res.AppendTx.Code != 0 {
  17. t.Fatalf("Non-zero append tx code: %d", res.AppendTx.Code)
  18. }
  19. }