onflow / atree

Atree provides scalable arrays and scalable ordered maps.
https://onflow.org
Apache License 2.0
39 stars 16 forks source link

Change `OrderedMap.Get()` to return `Value` instead of `Storable` #318

Closed fxamacker closed 1 year ago

fxamacker commented 1 year ago

Closes #317 Updates #296 #292

Description

This PR changes OrderedMap.Get() to return Value instead of Storable.

Currently, OrderedMap.Get() returns Storable and client converts returned Storable to Value. However, it only makes sense to return Storable if client needs to remove register (slab) by StorageID (StorageIDStorable).

Get() should only provide value without possibility of client manipulating the underlying storable.

This is prep work for Atree Register Inlining (#292) and will also harden the API.

Corresponding PR for Array.Get() is PR #316.