From e1d4547c5be8ff40a98c1f5014e30feab74f567e Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Tue, 27 Oct 2020 15:25:08 -0700 Subject: [PATCH] nits --- indexer/balance_storage_helper.go | 2 +- indexer/indexer.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/indexer/balance_storage_helper.go b/indexer/balance_storage_helper.go index 3600002..c36699d 100644 --- a/indexer/balance_storage_helper.go +++ b/indexer/balance_storage_helper.go @@ -39,7 +39,7 @@ func (h *BalanceStorageHelper) AccountBalance( block *types.BlockIdentifier, ) (*types.Amount, error) { return &types.Amount{ - Value: "0", + Value: zeroValue, Currency: currency, }, nil } diff --git a/indexer/indexer.go b/indexer/indexer.go index aaaeb31..67514cf 100644 --- a/indexer/indexer.go +++ b/indexer/indexer.go @@ -53,6 +53,9 @@ const ( // this is the estimated memory overhead for each // block fetched by the indexer. sizeMultiplier = 15 + + // zeroValue is 0 as a string + zeroValue = "0" ) var ( @@ -804,7 +807,7 @@ func (i *Indexer) GetBalance( ) if errors.Is(err, storage.ErrAccountMissing) { return &types.Amount{ - Value: "0", + Value: zeroValue, Currency: currency, }, blockResponse.Block.BlockIdentifier, nil }