Merge pull request #1169 from nspcc-dev/neo3/rpc/fields_names_adjustment

rpc: adjust RPC calls JSON fields
This commit is contained in:
Roman Khimov 2020-07-15 18:24:54 +03:00 committed by GitHub
commit f46ed798f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 176 additions and 114 deletions

View file

@ -784,10 +784,15 @@ func (s *Server) getUnclaimedGas(ps request.Params) (interface{}, *response.Erro
neo, neoHeight := s.chain.GetGoverningTokenBalance(u)
if neo.Sign() == 0 {
return "0", nil
return result.UnclaimedGas{
Address: u,
}, nil
}
gas := s.chain.CalculateClaimable(neo, neoHeight, s.chain.BlockHeight()+1) // +1 as in C#, for the next block.
return gas.String(), nil
return result.UnclaimedGas{
Address: u,
Unclaimed: *gas,
}, nil
}
// getValidators returns the current NEO consensus nodes information and voting status.