From f81718eea4549824ca74d5cfc43fea298859b2fb Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 30 Mar 2016 13:20:55 -0700 Subject: [PATCH] Fix tx encoding --- tests/tendermint/main.go | 4 ++-- tests/tmsp/main.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/tendermint/main.go b/tests/tendermint/main.go index 9c037e192..0dbfedfa6 100644 --- a/tests/tendermint/main.go +++ b/tests/tendermint/main.go @@ -71,7 +71,7 @@ func main() { //fmt.Println("tx:", tx) // Write request - txBytes := wire.BinaryBytes(tx) + txBytes := wire.BinaryBytes(struct{ types.Tx }{tx}) request := rpctypes.NewRPCRequest("fakeid", "broadcast_tx_sync", Arr(txBytes)) reqBytes := wire.JSONBytes(request) //fmt.Print(".") @@ -121,7 +121,7 @@ func main() { //fmt.Println("tx:", tx) // Write request - txBytes := wire.BinaryBytes(tx) + txBytes := wire.BinaryBytes(struct{ types.Tx }{tx}) request := rpctypes.NewRPCRequest("fakeid", "broadcast_tx_sync", Arr(txBytes)) reqBytes := wire.JSONBytes(request) //fmt.Print(".") diff --git a/tests/tmsp/main.go b/tests/tmsp/main.go index 7e38768ef..c5d1e7254 100644 --- a/tests/tmsp/main.go +++ b/tests/tmsp/main.go @@ -56,10 +56,10 @@ func testSendTx() { sig := tPriv.PrivKey.Sign(signBytes) tx.Inputs[0].Signature = sig //fmt.Println("tx:", tx) - fmt.Printf("Signed TX bytes: %X\n", wire.BinaryBytes(tx)) + fmt.Printf("Signed TX bytes: %X\n", wire.BinaryBytes(struct{ types.Tx }{tx})) // Write request - txBytes := wire.BinaryBytes(tx) + txBytes := wire.BinaryBytes(struct{ types.Tx }{tx}) res := bcApp.AppendTx(txBytes) fmt.Println(res) if res.IsErr() { @@ -132,7 +132,7 @@ func testSequence() { // fmt.Printf("ADDR: %X -> %X\n", tx.Inputs[0].Address, tx.Outputs[0].Address) // Write request - txBytes := wire.BinaryBytes(tx) + txBytes := wire.BinaryBytes(struct{ types.Tx }{tx}) res := bcApp.AppendTx(txBytes) if res.IsErr() { Exit("AppendTx error: " + res.Error()) @@ -178,7 +178,7 @@ func testSequence() { // fmt.Printf("ADDR: %X -> %X\n", tx.Inputs[0].Address, tx.Outputs[0].Address) // Write request - txBytes := wire.BinaryBytes(tx) + txBytes := wire.BinaryBytes(struct{ types.Tx }{tx}) res := bcApp.AppendTx(txBytes) if res.IsErr() { Exit("AppendTx error: " + res.Error())