rpc: provide old transfers in getnep5transfers

Return performed transfers even if contract was migrated.
This commit is contained in:
Evgenii Stratonikov 2020-07-21 17:49:03 +03:00
parent 7cd1bca1e1
commit f0d75afc48
6 changed files with 95 additions and 29 deletions

View file

@ -658,6 +658,11 @@ func (s *Server) getDecimals(h util.Uint160, cache map[util.Uint160]int64) (int6
if d, ok := cache[h]; ok {
return d, nil
}
m, err := s.chain.GetNEP5Metadata(h)
if err == nil {
cache[h] = m.Decimals
return m.Decimals, nil
}
script, err := request.CreateFunctionInvocationScript(h, request.Params{
{
Type: request.StringT,