From 0cc22e11345c8d15deef41921d3cc96792bf4a66 Mon Sep 17 00:00:00 2001 From: GeertJohan Date: Mon, 5 May 2014 21:23:18 +0200 Subject: [PATCH] Make btcrpcclient use the new and consistent reply types. --- chain.go | 4 ++-- mining.go | 8 ++++---- net.go | 4 ++-- rawtransactions.go | 2 +- wallet.go | 16 ++++++++-------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/chain.go b/chain.go index edb2362c..9e580824 100644 --- a/chain.go +++ b/chain.go @@ -126,13 +126,13 @@ func (r FutureGetBlockVerboseResult) Receive() (*btcjson.BlockResult, error) { } // Ensure the returned data is the expected type. - blockResult, ok := reply.(btcjson.BlockResult) + blockResult, ok := reply.(*btcjson.BlockResult) if !ok { return nil, fmt.Errorf("unexpected response type for "+ "getblock (verbose=1): %T\n", reply) } - return &blockResult, nil + return blockResult, nil } // GetBlockVerboseAsync returns an instance of a type that can be used to get diff --git a/mining.go b/mining.go index efd73424..924c3caf 100644 --- a/mining.go +++ b/mining.go @@ -146,13 +146,13 @@ func (r FutureGetMiningInfoResult) Receive() (*btcjson.GetMiningInfoResult, erro } // Ensure the returned data is the expected type. - result, ok := reply.(btcjson.GetMiningInfoResult) + result, ok := reply.(*btcjson.GetMiningInfoResult) if !ok { return nil, fmt.Errorf("unexpected response type for "+ "getmininginfo: %T\n", reply) } - return &result, nil + return result, nil } // GetMiningInfoAsync returns an instance of a type that can be used to get @@ -286,13 +286,13 @@ func (r FutureGetWork) Receive() (*btcjson.GetWorkResult, error) { } // Ensure the returned data is the expected type. - result, ok := reply.(btcjson.GetWorkResult) + result, ok := reply.(*btcjson.GetWorkResult) if !ok { return nil, fmt.Errorf("unexpected response type for "+ "getwork (request data): %T\n", reply) } - return &result, nil + return result, nil } // GetWorkAsync returns an instance of a type that can be used to get the result diff --git a/net.go b/net.go index 072fa094..5cf6f4d4 100644 --- a/net.go +++ b/net.go @@ -297,13 +297,13 @@ func (r FutureGetNetTotalsResult) Receive() (*btcjson.GetNetTotalsResult, error) } // Ensure the returned data is the expected type. - totals, ok := reply.(btcjson.GetNetTotalsResult) + totals, ok := reply.(*btcjson.GetNetTotalsResult) if !ok { return nil, fmt.Errorf("unexpected response type for "+ "getnettotals: %T\n", reply) } - return &totals, nil + return totals, nil } // GetNetTotalsAsync returns an instance of a type that can be used to get the diff --git a/rawtransactions.go b/rawtransactions.go index c12783e6..53a29c04 100644 --- a/rawtransactions.go +++ b/rawtransactions.go @@ -322,7 +322,7 @@ func (r FutureSignRawTransactionResult) Receive() (*btcwire.MsgTx, bool, error) } // Ensure the returned data is the expected type. - result, ok := reply.(btcjson.SignRawTransactionResult) + result, ok := reply.(*btcjson.SignRawTransactionResult) if !ok { return nil, false, fmt.Errorf("unexpected response type for "+ "signrawtransaction: %T\n", reply) diff --git a/wallet.go b/wallet.go index d599e0e8..1b35e10f 100644 --- a/wallet.go +++ b/wallet.go @@ -29,13 +29,13 @@ func (r FutureGetTransactionResult) Receive() (*btcjson.GetTransactionResult, er } // Ensure the returned data is the expected type. - result, ok := reply.(btcjson.GetTransactionResult) + result, ok := reply.(*btcjson.GetTransactionResult) if !ok { return nil, fmt.Errorf("unexpected response type for "+ "gettransaction: %T\n", reply) } - return &result, nil + return result, nil } // GetTransactionAsync returns an instance of a type that can be used to get the @@ -173,13 +173,13 @@ func (r FutureListSinceBlockResult) Receive() (*btcjson.ListSinceBlockResult, er } // Ensure the returned data is the expected type. - listResult, ok := reply.(btcjson.ListSinceBlockResult) + listResult, ok := reply.(*btcjson.ListSinceBlockResult) if !ok { return nil, fmt.Errorf("unexpected response type for "+ "listsinceblock: %T\n", reply) } - return &listResult, nil + return listResult, nil } // ListSinceBlockAsync returns an instance of a type that can be used to get @@ -690,13 +690,13 @@ func (r FutureCreateMultisigResult) Receive() (*btcjson.CreateMultiSigResult, er } // Ensure the returned data is the expected type. - result, ok := reply.(btcjson.CreateMultiSigResult) + result, ok := reply.(*btcjson.CreateMultiSigResult) if !ok { return nil, fmt.Errorf("unexpected response type for "+ "createmultisig: %T\n", reply) } - return &result, nil + return result, nil } // CreateMultisigAsync returns an instance of a type that can be used to get @@ -1001,13 +1001,13 @@ func (r FutureValidateAddressResult) Receive() (*btcjson.ValidateAddressResult, } // Ensure the returned data is the expected type. - result, ok := reply.(btcjson.ValidateAddressResult) + result, ok := reply.(*btcjson.ValidateAddressResult) if !ok { return nil, fmt.Errorf("unexpected response type for "+ "validateaddress: %T\n", reply) } - return &result, nil + return result, nil } // ValidateAddressAsync returns an instance of a type that can be used to get