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

fix: basicnode.NewInt returns pointer (like others) #525

Merged
merged 1 commit into from
Jun 19, 2023
Merged

fix: basicnode.NewInt returns pointer (like others) #525

merged 1 commit into from
Jun 19, 2023

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Jun 16, 2023

basicnode.NewInt should return a pointer to plainInt, similarly to the other types (string, float, bytes, etc). When writing tests for this PR and mocking interfaces, I was getting a pretty interesting error: the Decoded version of an int was returning a *plainInt, while the basicnode.NewInt was returning plainInt, causing the mock to fail.

All the other node types work well. There is an inconsistency between how ints are created and assigned. This does not happen with other types. I assume this was something overlooked. It would be nice if this could get released.

cc @rvagg

@hacdias hacdias marked this pull request as ready for review June 16, 2023 08:01
Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

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

ack, good find, nice to have tests that expose this kind of thing!

@rvagg rvagg merged commit 499e9b9 into ipld:master Jun 19, 2023
@hacdias hacdias deleted the fix/basic-int branch June 19, 2023 06:35
@rvagg
Copy link
Member

rvagg commented Jun 27, 2023

FYI @hacdias, I'm going to cut a release with this but I'm currently working through some traversal stuff that may either result in breaking changes or feature additions and I'd like to bundle that up in a larger release since we have a bunch of stuff backlogged. So I'll be getting there soon and this isn't forgotten (I now have untagged releases in my own go.mods which are uncomfortable so I'm alert to it).

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.

2 participants