Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: refactor neofs-sdk-go related operations in upload-bin #3756

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

AliceInHunterland
Copy link
Contributor

@AliceInHunterland AliceInHunterland commented Dec 13, 2024

No description provided.

@AliceInHunterland
Copy link
Contributor Author

Haven't found the place where

decode constructors are available now, u may find them useful https://github.com/nspcc-dev/neofs-sdk-go/blob/0b9bb748ea16370c9b88090a902413324e86bcf1/container/id/id.go#L40

can be useful yet.

we are operating with OIDs as bytes. example:
copy(buf[blockIndex%indexFileSize*oid.Size:], resOid[:])

@cthulhu-rider is it okay/correct?

@AliceInHunterland
Copy link
Contributor Author

AliceInHunterland commented Dec 13, 2024

Check with the uploader and fetcher.

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 83.11%. Comparing base (388ee25) to head (39cec7d).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
cli/util/upload_bin.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3756      +/-   ##
==========================================
+ Coverage   83.03%   83.11%   +0.07%     
==========================================
  Files         335      335              
  Lines       46752    46748       -4     
==========================================
+ Hits        38821    38855      +34     
+ Misses       6337     6297      -40     
- Partials     1594     1596       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#3756 (comment)

@AliceInHunterland create an issue for that, we'll reuse decoders instead of raw bytes copying. We're OK with the current version for now.

Please, write back once you check the updated version on small index files.

@cthulhu-rider
Copy link
Contributor

we are operating with OIDs as bytes

yep, now this is legit for any ID, they are fixed as arrays and comparable

@AliceInHunterland
Copy link
Contributor Author

Checked

@cthulhu-rider
Copy link
Contributor

cthulhu-rider commented Dec 13, 2024

Haven't found the place where

var containerID cid.ID
if err = containerID.DecodeString(containerIDStr); err != nil {

can now be

containerID, err := containerID.DecodeString(containerIDStr)
if err != nil {

just another way, but mb u find var declaration better

@AnnaShaleva AnnaShaleva merged commit 3f651cd into master Dec 13, 2024
33 of 34 checks passed
@AnnaShaleva AnnaShaleva deleted the neofs-sdk-update branch December 13, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants