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

refactor: Remove utils package #397

Merged
merged 1 commit into from
May 6, 2022

Conversation

shahzadlone
Copy link
Member

Resolves: #396

@shahzadlone shahzadlone added the action/no-benchmark Skips the action that runs the benchmark. label May 5, 2022
@shahzadlone shahzadlone added this to the DefraDB v0.3 milestone May 5, 2022
@shahzadlone shahzadlone self-assigned this May 5, 2022
@codecov
Copy link

codecov bot commented May 5, 2022

Codecov Report

Merging #397 (8d707ef) into develop (6e7a01d) will increase coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #397      +/-   ##
===========================================
+ Coverage    65.49%   65.64%   +0.14%     
===========================================
  Files           81       80       -1     
  Lines         9492     9471      -21     
===========================================
  Hits          6217     6217              
+ Misses        2645     2624      -21     
  Partials       630      630              
Impacted Files Coverage Δ
core/cid.go 100.00% <100.00%> (ø)
db/collection.go 56.07% <100.00%> (ø)


import (
"github.com/ipfs/go-cid"
mh "github.com/multiformats/go-multihash"
)

func NewCidV1(data []byte) (cid.Cid, error) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Noticed we were using another function with a similar name from ipfs/go-cid, signature: func NewCidV1(codecType uint64, mhash mh.Multihash) Cid {...} in datastore/blockstore.go and api/http/api.go.

so, changed the name to differentiate and to be explicit about always having SHA2_256 MhType (fine to revert back to the same name if there is preference).

Copy link
Contributor

@AndrewSisley AndrewSisley left a comment

Choose a reason for hiding this comment

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

LGTM - cheers for sorting out :)

@shahzadlone shahzadlone merged commit 222bf6d into develop May 6, 2022
@shahzadlone shahzadlone deleted the lone/refactor/remove-utils-package branch May 6, 2022 02:52
shahzadlone added a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
- RELATED ISSUE(S):
Resolves sourcenetwork#396

- DESCRIPTION:
Remove the utils package to avoid import dependencies between multiple packages. Devs are ready to have a little code duplication as a trade off.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove the Utils package
2 participants