onflow / atree

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

Unexport `SlabID` fields to prevent misuse #323

Closed fxamacker closed 1 year ago

fxamacker commented 1 year ago

Updates #296 #292 https://github.com/onflow/flow-go/issues/1744 Updates https://github.com/onflow/cadence/pull/2622 and more context at https://github.com/onflow/cadence/pull/2622#issuecomment-1622232675.

Description

Previously SlabID had two exported fields Address and Index. Address field was used in Cadence repo to obtain storage address.

We want clients to obtain storage address by calling Array.Address() or OrderedMap.Address(). This PR unexports Address field to prevent misuse.


codecov-commenter commented 1 year ago

Codecov Report

Merging #323 (33b8013) into fxamacker/rename-id-and-related-functions-and-types (adcd6fa) will decrease coverage by 0.10%. The diff coverage is 80.95%.

@@                                   Coverage Diff                                   @@
##           fxamacker/rename-id-and-related-functions-and-types     #323      +/-   ##
=======================================================================================
- Coverage                                                64.74%   64.64%   -0.10%     
=======================================================================================
  Files                                                       14       14              
  Lines                                                     8046     8050       +4     
=======================================================================================
- Hits                                                      5209     5204       -5     
- Misses                                                    2160     2168       +8     
- Partials                                                   677      678       +1     
Impacted Files Coverage Δ
array.go 69.92% <71.42%> (ø)
map.go 66.78% <80.00%> (-0.10%) :arrow_down:
storage.go 74.17% <81.81%> (-0.79%) :arrow_down:
basicarray.go 49.78% <100.00%> (ø)
storable.go 54.41% <100.00%> (ø)