Browse Source

Conform to new go-wire TypeByte behavior

pull/1780/head
Jae Kwon 9 years ago
parent
commit
2d9abb06ca
2 changed files with 4 additions and 4 deletions
  1. +3
    -3
      example/golang/dummy_test.go
  2. +1
    -1
      server/server.go

+ 3
- 3
example/golang/dummy_test.go View File

@ -72,7 +72,7 @@ func TestStream(t *testing.T) {
var n int var n int
var err error var err error
var req types.Request = types.RequestAppendTx{TxBytes: []byte("test")} var req types.Request = types.RequestAppendTx{TxBytes: []byte("test")}
wire.WriteBinaryLengthPrefixed(req, conn, &n, &err)
wire.WriteBinaryLengthPrefixed(struct{ types.Request }{req}, conn, &n, &err)
if err != nil { if err != nil {
t.Fatal(err.Error()) t.Fatal(err.Error())
} }
@ -80,7 +80,7 @@ func TestStream(t *testing.T) {
// Sometimes send flush messages // Sometimes send flush messages
if counter%123 == 0 { if counter%123 == 0 {
t.Log("flush") t.Log("flush")
wire.WriteBinaryLengthPrefixed(types.RequestFlush{}, conn, &n, &err)
wire.WriteBinaryLengthPrefixed(struct{ types.Request }{types.RequestFlush{}}, conn, &n, &err)
if err != nil { if err != nil {
t.Fatal(err.Error()) t.Fatal(err.Error())
} }
@ -89,7 +89,7 @@ func TestStream(t *testing.T) {
// Send final flush message // Send final flush message
var n int var n int
wire.WriteBinaryLengthPrefixed(types.RequestFlush{}, conn, &n, &err)
wire.WriteBinaryLengthPrefixed(struct{ types.Request }{types.RequestFlush{}}, conn, &n, &err)
if err != nil { if err != nil {
t.Fatal(err.Error()) t.Fatal(err.Error())
} }


+ 1
- 1
server/server.go View File

@ -146,7 +146,7 @@ func handleResponses(closeConn chan error, responses <-chan types.Response, conn
var res = <-responses var res = <-responses
var n int var n int
var err error var err error
wire.WriteBinaryLengthPrefixed(res, bufWriter, &n, &err)
wire.WriteBinaryLengthPrefixed(struct{ types.Response }{res}, bufWriter, &n, &err)
if err != nil { if err != nil {
closeConn <- fmt.Errorf("Error in handleResponses: %v", err.Error()) closeConn <- fmt.Errorf("Error in handleResponses: %v", err.Error())
return return


Loading…
Cancel
Save