onflow / atree

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

Refactor creating new StorableSlab #324

Closed fxamacker closed 1 year ago

fxamacker commented 1 year ago

Updates #296 #292 https://github.com/onflow/flow-go/issues/1744

Description

Currently, in order to create StorableSlab, user needs to:

This commit unexports StorableSlab fields and adds NewStorableSlab().

With this change, user can simply call NewStorableSlab().


codecov-commenter commented 1 year ago

Codecov Report

Merging #324 (37f2201) into fxamacker/unexport-SlabID-fields (33b8013) will decrease coverage by 0.12%. The diff coverage is 38.77%.

@@                         Coverage Diff                          @@
##           fxamacker/unexport-SlabID-fields     #324      +/-   ##
====================================================================
- Coverage                             64.64%   64.53%   -0.12%     
====================================================================
  Files                                    14       14              
  Lines                                  8050     8075      +25     
====================================================================
+ Hits                                   5204     5211       +7     
- Misses                                 2168     2187      +19     
+ Partials                                678      677       -1     
Impacted Files Coverage Δ
slab.go 100.00% <ø> (ø)
storage.go 74.48% <ø> (+0.31%) :arrow_up:
storable_slab.go 31.88% <25.00%> (-13.58%) :arrow_down:
array.go 69.92% <100.00%> (ø)
array_debug.go 52.28% <100.00%> (ø)
encode.go 79.36% <100.00%> (ø)
map.go 66.88% <100.00%> (+0.09%) :arrow_up:
map_debug.go 51.77% <100.00%> (ø)