Skip to content
New issue

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

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

Already on GitHub? # to your account

Bug: Mismatching type of difficulty_trend in deprecated active_difficulty call #3323

Closed
keerifox opened this issue Jun 4, 2021 · 5 comments · Fixed by #3343
Closed

Bug: Mismatching type of difficulty_trend in deprecated active_difficulty call #3323

keerifox opened this issue Jun 4, 2021 · 5 comments · Fixed by #3343
Milestone

Comments

@keerifox
Copy link

keerifox commented Jun 4, 2021

Summary

difficulty_trend returns a string rather than an array, which caused issues in some wallets relying on it, e.g gonano wallet:

json: cannot unmarshal string into Go struct field .diffulty_trend of type []string

Node version

Nano V22.0

Build details

several community-ran nodes

OS and version

several community-ran nodes

Steps to reproduce the behavior

make an RPC call

{
  "action": "active_difficulty",
  "include_trend": "true"
}

Expected behavior

expected to produce a list as per docs page

image

Actual behavior

produces an empty string instead

"difficulty_trend": ""

Possible solution

return a single-item list

"difficulty_trend": [
  "1.000000000000000"
]

Supporting files

No response

@shryder
Copy link
Contributor

shryder commented Jun 13, 2021

This RPC command is now marked as deprecated.

@keerifox
Copy link
Author

that's what the title of this issue says yes

methods are deprecated to allow to transition away from using them, if there's a breaking change that causes existing integrations to malfunction then it defeats the purpose

@shryder
Copy link
Contributor

shryder commented Jun 16, 2021

My bad, didn't notice it in the title.

@shryder
Copy link
Contributor

shryder commented Jun 16, 2021

Looks like the RPC was completely removed and then got re-added in but now will always send an empty difficulty_trend response (RPC always returns empty string instead of empty array). I can make a pull request to make it send ["1.000000000000000"] back

shryder added a commit to shryder/nano-node that referenced this issue Jun 16, 2021
clemahieu pushed a commit that referenced this issue Jun 16, 2021
…nd" (#3323) (#3343)

* Fix RPC "active_difficulty" returning empty string as "difficulty_trend" (#3323)

* Change active_difficulty test unit accordingly
@zhyatt zhyatt added this to the V23.0 milestone Jun 22, 2021
@zhyatt
Copy link
Collaborator

zhyatt commented Jun 22, 2021

Fixed by #3343

@zhyatt zhyatt closed this as completed Jun 22, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants