[#1577] node/container: Fix typo

Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
This commit is contained in:
Ekaterina Lebedeva 2024-12-27 15:31:06 +03:00
parent 242f0095d0
commit c0221d76e6
2 changed files with 2 additions and 2 deletions

View file

@ -6,7 +6,7 @@ const (
subsection = "container" subsection = "container"
listStreamSubsection = "list_stream" listStreamSubsection = "list_stream"
// ContainerBatchSizeDefault represents he maximum amount of containers to send via stream at once. // ContainerBatchSizeDefault represents the maximum amount of containers to send via stream at once.
ContainerBatchSizeDefault = 1000 ContainerBatchSizeDefault = 1000
) )

View file

@ -36,7 +36,6 @@ func (c *Client) IterateContainersOf(idUser *user.ID, cb func(item cid.ID) error
rawID = idUser.WalletBytes() rawID = idUser.WalletBytes()
} }
cnrHash := c.client.ContractAddress()
itemCb := func(item stackitem.Item) error { itemCb := func(item stackitem.Item) error {
id, err := getCIDfromStackItem(item) id, err := getCIDfromStackItem(item)
if err != nil { if err != nil {
@ -57,6 +56,7 @@ func (c *Client) IterateContainersOf(idUser *user.ID, cb func(item cid.ID) error
// 512 is big enough value and it is beautiful. // 512 is big enough value and it is beautiful.
const batchSize = 512 const batchSize = 512
cnrHash := c.client.ContractAddress()
err := c.client.Morph().TestInvokeIterator(itemCb, batchSize, cnrHash, containersOfMethod, rawID) err := c.client.Morph().TestInvokeIterator(itemCb, batchSize, cnrHash, containersOfMethod, rawID)
if err != nil && errors.Is(err, unwrap.ErrNoSessionID) { if err != nil && errors.Is(err, unwrap.ErrNoSessionID) {
return c.iterate(idUser, cb) return c.iterate(idUser, cb)