Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

GetInclusionStates api call is broken #1350

Closed
GalRogozinski opened this issue Feb 19, 2019 · 2 comments · Fixed by #1685
Closed

GetInclusionStates api call is broken #1350

GalRogozinski opened this issue Feb 19, 2019 · 2 comments · Fixed by #1685
Assignees
Labels
C-API Component - API

Comments

@GalRogozinski
Copy link
Contributor

GalRogozinski commented Feb 19, 2019

Bug description

Currently getInclusionStates api call is broken

IRI version

1.6.0

Steps To Reproduce

  1. Given:
milestone1 = RGAGQUXZ9VIVSKJHBUOYLDRZAVWHT9FWEBTDOILMZOEYXSGSZFEFLFYELJMQULYOGHHXGIF9ZHYDA9999
milestone2 = EAXDHOSARLDVKFLZMCJQMPI9MNCFZ9UMUXVRZKDKWXMWGASQNWWNYUWJBWRGCBVMO9WCSXCOBPIHZ9999
txBetweenM2_M3 = SHHCZGOPU9DB9HNMONJNOFRVQCRMFJNBP9OGQSRTMWSHVILTUSQKJBF9Y9QT9FGPSVXSVWDTBKNSZ9999
milestone3 = QYVQXYJBJEZCUPWLSHPIBYAXIPYULBKCDWGYH9XK9HGGEXLHCJAOEVV9WTJNHWXDIKNHQACQHESKA9999
pendingAfterM3 = A9JGAJIXRZW9KB9T9TODDXTWTFZLROWJDQZTVUNDENJQOEULME9YTFESCNAEMSLJJXCEZLEHF9SSZ9999
milestone4 = UOCCDROJVEIJLXBQFVO9ITKKDFTA9GPCQNTBIBEXBEGBRGFAGTZ9XSSDCKHCODJ9KAFDOLUGBPYGA9999
  1. Then
{"command": "getInclusionStates", "transactions": [milestone1, milestone2, txBetweenM2_M3, milestone3, milestone4], "tips": [pendingAfterM3]}
[ false, false, false, false, false ]
{"command": "getInclusionStates", "transactions": [milestone1, milestone2, txBetweenM2_M3, milestone3, milestone4], "tips": [txBetweenM2_M3]}
[ true, true, true, false, false ]
{"command": "getInclusionStates", "transactions": [milestone1, milestone2, txBetweenM2_M3, milestone3, milestone4], "tips": [pendingAfterM3, txBetweenM2_M3]}
[ false, false, true, false, false ]

Expected behaviour

Last command should return [ true, true, true, false, false ]

Actual behaviour

[ false, false, true, false, false ]

@GalRogozinski
Copy link
Contributor Author

In my opinion the following should be done:

  1. Implement a new apiCall getLatestInclusionState that only receives a list of transactions and returns a list of booleans that show confirmation states according to milestones
  2. Have the libraries and trinity migrate to use this new API call
  3. Delete the old getInclusionStates call. Or, if there is a use case for it, create a proper spec for it and then reimplement it from scratch.

@GalRogozinski
Copy link
Contributor Author

no need for a new api call, simply change getInclusionState

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C-API Component - API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants