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

Empty 'percent_change' in get_ticker API #1620

Closed
Zapata opened this issue Feb 27, 2019 · 3 comments

Comments

Projects
None yet
4 participants
@Zapata
Copy link
Member

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

This comment has been minimized.

Copy link
Member Author

commented Feb 27, 2019

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

@oxarbitrage

This comment has been minimized.

Copy link
Member

commented Feb 27, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Feb 27, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.