Skip to content

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