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

Empty 'percent_change' in get_ticker API #1620

Closed
1 of 17 tasks
Zapata opened this issue Feb 27, 2019 · 3 comments · Fixed by #1631
Closed
1 of 17 tasks

Empty 'percent_change' in get_ticker API #1620

Zapata opened this issue Feb 27, 2019 · 3 comments · Fixed by #1631

Comments

@Zapata
Copy link
Member

Zapata commented Feb 27, 2019

Bug Description

Following release 2.0.190219 the 'percent_change' field is empty in the get_ticker API when there is no value change (should be 0).

Impacts

  • API (the application programming interface)
  • Build (the build process or something prior to compiled code)
  • CLI (the command line wallet)
  • Deployment (the deployment process after building such as Docker, Travis, etc.)
  • DEX (the Decentralized EXchange, market engine, etc.)
  • P2P (the peer-to-peer network for transaction/block propagation)
  • Performance (system or user efficiency, etc.)
  • Protocol (the blockchain logic, consensus, validation, etc.)
  • Security (the security of system or user data, etc.)
  • UX (the User Experience)
  • Other (please add below)

Steps To Reproduce

curl -s --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_ticker", ["RUBLE", "USD"]], "id": 1}' https://node.bitshares.eu/ | jq
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "time": "2019-02-27T11:01:12",
    "base": "RUBLE",
    "quote": "USD",
    "latest": "68.96551724137931034482",
    "lowest_ask": "68",
    "highest_bid": "56.00518806744487678339",
    "percent_change": "",
    "base_volume": "0",
    "quote_volume": "0"
  }
}

Note that the node is running 2.0.190219 version.

Expected Behavior

curl -s --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_ticker", ["RUBLE", "USD"]], "id": 1}' https://api.dex.trading/ | jq
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "time": "2019-02-27T11:01:12",
    "base": "RUBLE",
    "quote": "USD",
    "latest": "68.96551724137931034482",
    "lowest_ask": "68",
    "highest_bid": "56.00518806744487678339",
    "percent_change": "0",
    "base_volume": "0",
    "quote_volume": "0"
  }
}

Note that the node is running a previous version 2.0.181221.

Host Environment
Version: 2.0.190219

CORE TEAM TASK LIST

  • Evaluate / Prioritize Bug Report
  • Refine User Stories / Requirements
  • Define Test Cases
  • Design / Develop Solution
  • Perform QA/Testing
  • Update Documentation
@Zapata
Copy link
Member Author

Zapata commented Feb 27, 2019

Bug introduced by #842 / PR #1549 , a missing else there I suppose .

@oxarbitrage
Copy link
Member

Thanks @Zapata , i think initializing in the top around: https://github.com/oxarbitrage/bitshares-core/blob/04f20af8333390416944e602c0380315ca4f7a88/libraries/app/database_api.cpp#L324 will do it.

Something like:

percent_change = "0";

Now i am wondering if this is important enough to go into the release branch and direct way to master now in form of hotfix.

Opinions?

@pmconrad
Copy link
Contributor

Since it breaks (some) clients we should create a hotfix release IMO.

# 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.

4 participants