mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-04 19:19:44 +00:00
rpc: set default values in getutxotransfers
This commit is contained in:
parent
fe5e5ff44a
commit
02033f8355
2 changed files with 9 additions and 2 deletions
|
@ -516,10 +516,17 @@ func (s *Server) getUTXOTransfers(ps request.Params) (interface{}, *response.Err
|
|||
index++
|
||||
}
|
||||
|
||||
start, end, err := getTimestamps(ps.Value(index), ps.Value(index+1))
|
||||
p1, p2 := ps.Value(index), ps.Value(index+1)
|
||||
start, end, err := getTimestamps(p1, p2)
|
||||
if err != nil {
|
||||
return nil, response.NewInvalidParamsError("", err)
|
||||
}
|
||||
if p2 == nil {
|
||||
end = uint32(time.Now().Unix())
|
||||
if p1 == nil {
|
||||
start = uint32(time.Now().Add(-time.Hour * 24 * 7).Unix())
|
||||
}
|
||||
}
|
||||
|
||||
sent, recv, err := getAssetMaps(assetName)
|
||||
if err != nil {
|
||||
|
|
|
@ -1138,7 +1138,7 @@ func testRPCProtocol(t *testing.T, doRPCCall func(string, string, *testing.T) []
|
|||
if asset != "" {
|
||||
ps = append(ps, fmt.Sprintf("%q", asset))
|
||||
}
|
||||
if start != 0 {
|
||||
if start >= 0 {
|
||||
if start > int(e.chain.HeaderHeight()) {
|
||||
ps = append(ps, strconv.Itoa(int(time.Now().Unix())))
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue