missing unmarshalling of content bytes before encoding and generation… #86
Closed
ABastionOfSanity wants to merge 4 commits from
fix_cid_generation into main
pull from: fix_cid_generation
merge into: :main
:main
:zach/prefix
:roy/rm-hardcoded-records
:roy/graphql-to-ipld
:roy/qol-improvements
:murali/gql
:murali/update-fork
:murali/record-attributes
:aleem/fix-lint-errors
:murali/CIDFromJSONBytes
:update-validator-doc-v0.8.0
:feature_test_record_types
:aleem/25-wasmd
:release-v0.8.0
:nameservice_tests_github
:auction_tests
:all_test_stuff
:fix_cid_generation
:run_tests_github_action
:0-7-0-upgrade-guide
:murali/sdk-integration-tests
:murali/quick-fix
:dboreham/sdk-integration-test
:console_release
:release-v0.3.1-dev
:release-v0.6.0
:anil/lint
:murali/to_ipld_prime
:docs
:release-v0.2.0-dev
:ian/smt
Dismiss Review
Are you sure you want to dismiss this review?
Labels
Clear labels
C:CLI
C:Crypto
C:Encoding
C:Proto
C:Types
Status: Stale
Type: ADR
Type: Build
Type: CI
Type: Docs
Type: Tests
bug
dependencies
docker
documentation
duplicate
enhancement
go
good first issue
help wanted
high priority
in progress
invalid
javascript
low priority
medium priority
question
urgent
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Something isn't working
Pull requests that update a dependency file
Pull requests that update Docker code
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Pull requests that update Go code
Good for newcomers
Extra attention is needed
currently working on
This doesn't seem right
Pull requests that update Javascript code
Further information is requested
Top priority issue
This will not be worked on
An issue or PR manually copied from GitHub.
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/laconicd-deprecated#86
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This is to address
https://github.com/cerc-io/laconic-sdk/issues/7
for improperly generated CID in SetRecord endpoint.
Codecov Report
Additional details and impacted files
48.92% <100.00%> (ø)LGTM
Thanks! Please add a unit test that shows that
CIDFromJSONBytesUsingIpldPrimeandCIDFromJSONBytesboth match expected output(s)Let's remove this left over comment
Nice this simplifies things. In a separate PR we can simplify things further by getting rid of the linksystem and doing https://github.com/cerc-io/laconicd/issues/85.
In this context we don't need to pull in an entire linksystem, we can encode as dag-cbor using this, hash the output, and convert the hash into a CID using this.
Thanks for adding the test, just one small modification.
@@ -0,0 +23,4 @@}for _, tc := range testCases {deprecatedAndCorrect, _ := CIDFromJSONBytes([]byte(tc.content))We should either catch any errors returned by these functions or make sure the returned result isn't
nil/empty, because if both functions were to error out and return anil/empty result it would evaluate them as equal and the test would pass.closed by:
https://github.com/cerc-io/laconicd/pull/88
Pull request closed