onflow / atree

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

Change `Array.Get()` to return `Value` instead of `Storable` #316

Closed fxamacker closed 1 year ago

fxamacker commented 1 year ago

Closes #315 Updates #296 #292

Description

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

Currently, Array.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.


codecov-commenter commented 1 year ago

Codecov Report

Merging #316 (044db01) into main (7c97278) will decrease coverage by 0.03%. The diff coverage is 66.66%.

@@            Coverage Diff             @@
##             main     #316      +/-   ##
==========================================
- Coverage   64.62%   64.60%   -0.03%     
==========================================
  Files          14       14              
  Lines        7991     8000       +9     
==========================================
+ Hits         5164     5168       +4     
- Misses       2152     2155       +3     
- Partials      675      677       +2     
Impacted Files Coverage Δ
array.go 69.80% <66.66%> (-0.07%) :arrow_down:

... and 2 files with indirect coverage changes