Skip to content

Commit

Permalink
use TokenAmount.MaxValue for cursor max value.
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelPawelec-RDX committed Aug 15, 2024
1 parent 5bb2889 commit ec6222c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ namespace RadixDlt.NetworkGateway.Abstractions.Numerics;
public static readonly TokenAmount Zero;
public static readonly TokenAmount NaN;
public static readonly TokenAmount OneFullUnit;
public static readonly TokenAmount MaxValue;

private const int DecimalPrecision = 18;

Expand All @@ -83,7 +84,7 @@ namespace RadixDlt.NetworkGateway.Abstractions.Numerics;
static TokenAmount()
{
_divisor = BigInteger.Pow(10, DecimalPrecision);

MaxValue = new TokenAmount(BigInteger.Pow(2, 192), 0);
Zero = new TokenAmount(0);
NaN = new TokenAmount(true);
OneFullUnit = new TokenAmount(_divisor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1910,9 +1910,9 @@ paths:
operationId: ResourceOwnersPage
summary: Get Resource Owners Page
description: |
Returns list of all owners of given resource, ordered by Amount (fungibles)/ Number of items (non fungibles) descending.
This endpoint operates only at current state version, it is not possible to browse historical data.
Because of that it is not possible to offer stable pagination as data constantly changes. Values might change which might result in gaps or some entries being returned twice.
Returns list of all owners of a given resource, ordered by Amount (fungibles)/ Number of items (non fungibles) descending.
This endpoint operates only at the current state version, it is not possible to browse historical data.
Because of that, it is not possible to offer stable pagination as data constantly changes. Values might change, which might result in gaps or some entries being returned.
tags:
- Extensions
requestBody:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ FROM resource_owners ro
INNER JOIN entities e
ON ro.entity_id = e.id
WHERE ro.resource_entity_id = @resourceEntityId
AND (@balanceBoundary is null OR ((ro.balance, ro.id) <= (Cast(@balanceBoundary AS numeric(1000,0)), @idBoundary)))
AND (ro.balance, ro.id) <= (Cast(@balanceBoundary AS numeric(1000,0)), @idBoundary)
ORDER BY (ro.balance, ro.entity_id) DESC
LIMIT @limit",
new
{
resourceEntityId = resourceEntity.Id,
balanceBoundary = cursor?.BalanceBoundary,
balanceBoundary = cursor?.BalanceBoundary ?? TokenAmount.MaxValue.ToString(),
idBoundary = cursor?.IdBoundary ?? long.MaxValue,
limit = limit + 1,
},
Expand Down

0 comments on commit ec6222c

Please sign in to comment.