From 211402fd306c1ee9aa177fd0d3177ce4e60d807b Mon Sep 17 00:00:00 2001 From: xiaohuo Date: Fri, 2 Apr 2021 14:39:55 +0800 Subject: [PATCH] chore: move some commet --- rosetta/services/account.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rosetta/services/account.go b/rosetta/services/account.go index 2f7873620..50faf332f 100644 --- a/rosetta/services/account.go +++ b/rosetta/services/account.go @@ -56,12 +56,12 @@ func (s *AccountAPI) AccountBalance( blockNum := rpc.BlockNumber(block.Header().Header.Number().Int64()) balance := new(big.Int) - // delegated balance if request.AccountIdentifier.SubAccount != nil { subAccount := request.AccountIdentifier.SubAccount ty, exist := subAccount.Metadata["type"] - if exist && ty.(string) == "delegation" { + // delegated balance + if exist && ty.(string) == Delegation { validatorAddr := subAccount.Address validators, delegations := s.hmy.GetDelegationsByDelegatorByBlock(addr, block) for index, validator := range validators { @@ -70,7 +70,7 @@ func (s *AccountAPI) AccountBalance( } } // pending undelegated balance - } else if exist && ty.(string) == "undelegation" { + } else if exist && ty.(string) == UnDelegation { validatorAddr := subAccount.Address validators, delegations := s.hmy.GetDelegationsByDelegatorByBlock(addr, block) for index, validator := range validators {