2016-06-21 13:19:49 -04:00
|
|
|
package rpctest
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"golang.org/x/net/context"
|
|
|
|
|
|
|
|
"github.com/tendermint/tendermint/rpc/grpc"
|
|
|
|
)
|
|
|
|
|
|
|
|
//-------------------------------------------
|
|
|
|
|
|
|
|
func TestBroadcastTx(t *testing.T) {
|
2017-02-21 19:36:18 +01:00
|
|
|
res, err := GetGRPCClient().BroadcastTx(context.Background(), &core_grpc.RequestBroadcastTx{[]byte("this is a tx")})
|
2016-06-21 13:19:49 -04:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2016-08-27 16:37:52 -04:00
|
|
|
if res.CheckTx.Code != 0 {
|
|
|
|
t.Fatalf("Non-zero check tx code: %d", res.CheckTx.Code)
|
|
|
|
}
|
2017-01-12 15:55:03 -05:00
|
|
|
if res.DeliverTx.Code != 0 {
|
|
|
|
t.Fatalf("Non-zero append tx code: %d", res.DeliverTx.Code)
|
2016-06-21 13:19:49 -04:00
|
|
|
}
|
|
|
|
}
|