Skip to content

Commit 7fd96ad

Browse files
committed
wip
1 parent 6013ccf commit 7fd96ad

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

clients/graphql_client.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (c *GraphQLClient) GetDynamicFields(
102102

103103
var first *int
104104
if req.Limit != nil {
105-
limit := int(*req.Limit) // #nosec G115 -- pagination limit is always small
105+
limit := *req.Limit
106106
first = &limit
107107
}
108108

@@ -190,13 +190,6 @@ func (c *GraphQLClient) GetOwnedObjects(
190190
return nil, fmt.Errorf("address is required")
191191
}
192192

193-
// Convert limit from *uint to *int
194-
var limitPtr *int
195-
if req.Limit != nil {
196-
limit := int(*req.Limit) // #nosec G115 -- pagination limit is always small
197-
limitPtr = &limit
198-
}
199-
200193
// Convert cursor from *iotago.ObjectID to *string
201194
var cursorPtr *string
202195
if req.Cursor != nil {
@@ -243,7 +236,7 @@ func (c *GraphQLClient) GetOwnedObjects(
243236
}
244237

245238
// Call GraphQL GetOwnedObjects
246-
resp, err := iotagraphql.GetOwnedObjects(ctx, c.client, *req.Address, limitPtr, cursorPtr,
239+
resp, err := iotagraphql.GetOwnedObjects(ctx, c.client, *req.Address, req.Limit, cursorPtr,
247240
showBcs, showContent, showDisplay, showType, showOwner, showPreviousTransaction, showStorageRebate, filterPtr)
248241
if err != nil {
249242
return nil, err
@@ -300,7 +293,7 @@ func (c *GraphQLClient) QueryTransactionBlocks(
300293

301294
// Handle pagination - GraphQL uses first/after for forward, last/before for backward
302295
if req.Limit != nil {
303-
limit := int(*req.Limit) // #nosec G115 -- pagination limit is always small
296+
limit := *req.Limit
304297
if req.DescendingOrder {
305298
last = &limit
306299
} else {

clients/iota-go/iotaclient/api_exented.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (c *Client) GetDynamicFieldObject(
3434
type GetDynamicFieldsRequest struct {
3535
ParentObjectID *iotago.ObjectID
3636
Cursor *iotago.ObjectID // optional
37-
Limit *uint // optional
37+
Limit *int // optional
3838
}
3939

4040
func (c *Client) GetDynamicFields(
@@ -55,7 +55,7 @@ type GetOwnedObjectsRequest struct {
5555
Cursor *iotago.ObjectID
5656
// [optional] Limit is the maximum number of items returned per page, defaults to [QUERY_MAX_RESULT_LIMIT_OBJECTS] if not
5757
// provided
58-
Limit *uint
58+
Limit *int
5959
}
6060

6161
func (c *Client) GetOwnedObjects(
@@ -78,7 +78,7 @@ func (c *Client) GetOwnedObjects(
7878
type QueryEventsRequest struct {
7979
Query *iotajsonrpc.EventFilter
8080
Cursor *iotajsonrpc.EventId // optional
81-
Limit *uint // optional
81+
Limit *int // optional
8282
DescendingOrder bool // optional
8383
}
8484

@@ -93,7 +93,7 @@ func (c *Client) QueryEvents(
9393
type QueryTransactionBlocksRequest struct {
9494
Query *iotajsonrpc.IotaTransactionBlockResponseQuery
9595
Cursor *iotago.TransactionDigest // optional
96-
Limit *uint // optional
96+
Limit *int // optional
9797
DescendingOrder bool // optional
9898
}
9999

@@ -125,7 +125,7 @@ func (c *Client) ResolveNameServiceAddress(ctx context.Context, iotaName string)
125125
type ResolveNameServiceNamesRequest struct {
126126
Owner *iotago.Address
127127
Cursor *iotago.ObjectID // optional
128-
Limit *uint // optional
128+
Limit *int // optional
129129
}
130130

131131
func (c *Client) ResolveNameServiceNames(

0 commit comments

Comments
 (0)