From 480ab113830a9018068a0a5cf91c5c34f547c9af Mon Sep 17 00:00:00 2001 From: Benjamin Bollen <ben@erisindustries.com> Date: Sun, 18 Sep 2016 22:12:43 +0200 Subject: [PATCH] client: clean up DumpStorage() --- client/client.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/client.go b/client/client.go index fb0de81f..4e834959 100644 --- a/client/client.go +++ b/client/client.go @@ -140,16 +140,19 @@ func (erisNodeClient *ErisNodeClient) GetAccount(address []byte) (*acc.Account, } // DumpStorage returns the full storage for an account. -func (erisNodeClient *ErisNodeClient) DumpStorage(address []byte) (*core_types.Storage) { +func (erisNodeClient *ErisNodeClient) DumpStorage(address []byte) (storage *core_types.Storage, err error) { client := rpcclient.NewClientURI(erisNodeClient.broadcastRPC) resultStorage, err := tendermint_client.DumpStorage(client, address) if err != nil { - + err = fmt.Errorf("Error connecting to node (%s) to get storage for account (%X): %s", + erisNodeClient.broadcastRPC, address, err.Error()) + return nil, err } // UnwrapResultDumpStorage is an inefficient full deep copy, // to transform the type to /core/types.Storage // TODO: removing go-wire and go-rpc allows us to collapse these types - return tendermint_types.UnwrapResultDumpStorage(resultStorage) + storage = tendermint_types.UnwrapResultDumpStorage(resultStorage) + return } //-------------------------------------------------------------------------------------------- -- GitLab