1

I have a ledger asset which is a big map.

Each entry has a partition leading to another other asset, which in the worst case will have 20 entries in it associated with one entry in the ledger asset (I've limited its size). I've left this asset as the default asset type (which I guess makes it a map?) because I need to be able to iterate over these 20 entries when a certain entrypoint is called.

Say I have 100 entries in my ledger, and I call my entrypoint, targeting just one of these ledger entries.

I access the partitioned assets with something like:

const iterable_view = ledger[token_id].partitioned_asset.select(true)

If I iterate over this view, is this going to deserialise and iterate over a map of maximum length 20, or a map of maximum length 2000?

Should I be structuring my data in a different way to reduce gas costs, or using iterable big maps, or just using a map instead of a partitioned asset for example?

Where possible, my preference is to use assets, as the API is much better UX than having maps within maps.

Thanks, assistance is greatly appreciated

1 Answer 1

1

short answer is 20.

Indeed partitions are compiled as set containers of identifiers. So your usage of partitions seems good 👍.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.