From 7ebf011fcd200ee51bfbb5315ed9ebb9f8c02989 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Wed, 3 May 2017 16:58:21 +0200 Subject: [PATCH] Fixed rpctypes.Request creation to new format --- benchmarks/simu/counter.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/benchmarks/simu/counter.go b/benchmarks/simu/counter.go index a22162b97..e9502f956 100644 --- a/benchmarks/simu/counter.go +++ b/benchmarks/simu/counter.go @@ -7,11 +7,11 @@ import ( "fmt" "github.com/gorilla/websocket" - . "github.com/tendermint/tmlibs/common" - "github.com/tendermint/tendermint/rpc/lib/client" - "github.com/tendermint/tendermint/rpc/lib/types" "github.com/tendermint/go-wire" _ "github.com/tendermint/tendermint/rpc/core/types" // Register RPCResponse > Result types + "github.com/tendermint/tendermint/rpc/lib/client" + "github.com/tendermint/tendermint/rpc/lib/types" + . "github.com/tendermint/tmlibs/common" ) func main() { @@ -37,13 +37,16 @@ func main() { for i := 0; ; i++ { binary.BigEndian.PutUint64(buf, uint64(i)) //txBytes := hex.EncodeToString(buf[:n]) - request := rpctypes.NewRPCRequest("fakeid", + request, err := rpctypes.MapToRequest("fakeid", "broadcast_tx", map[string]interface{}{"tx": buf[:8]}) + if err != nil { + Exit(err.Error()) + } reqBytes := wire.JSONBytes(request) //fmt.Println("!!", string(reqBytes)) fmt.Print(".") - err := ws.WriteMessage(websocket.TextMessage, reqBytes) + err = ws.WriteMessage(websocket.TextMessage, reqBytes) if err != nil { Exit(err.Error()) }