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

Return batch statuses even when some timeout #1815

Commits on Mar 3, 2022

  1. Return batch statuses even when some timeout

    This change modifies the Splinter /batch_statuses endpoint so that it
    will return batch statuses, even if some of them time out. Batch
    statuses that time out are returned as "Unknown".
    
    Previously, if a single batch status were to timeout, the endpoint would
    return none at all. The endpoint result would be a non-parsable string
    error containing the problem batch ids.
    
    This change should give users of this endpoint maximal information.
    Users can use the successful ids, and they can determine programatically
    which ones timed out.
    
    Also updated several tests to validate the new expected responses.
    
    Signed-off-by: Lee Bradley <bradley@bitwise.io>
    Lee Bradley committed Mar 3, 2022
    Configuration menu
    Copy the full SHA
    765dc5b View commit details
    Browse the repository at this point in the history
  2. Recognize Unknown batches in wait_for_batches

    This change updates the wait_for_batches function in the Reqwest client
    so that it will identify Unknown batches and return an error.
    
    Signed-off-by: Lee Bradley <bradley@bitwise.io>
    Lee Bradley committed Mar 3, 2022
    Configuration menu
    Copy the full SHA
    d8bde5d View commit details
    Browse the repository at this point in the history
  3. Correct serialization so message is never dropped

    Previously, if a batch status response was "Unknown" or "Pending", the
    message field would not be returned (unlike "Invalid", "Valid" and
    "Committed"). The OpenAPI spec states that message is not an optional
    return value. This change modifies the serde serialization so that both
    the "Unknown" and "Pending" enum variants are serialized as empty
    sequences, and thus message is never empty.
    
    This change also adds tests to validate the resulting JSON output. To
    ensure that the string ouput for tests is deterministic, the
    preserve_order feature is enabled in development builds.
    
    Signed-off-by: Lee Bradley <bradley@bitwise.io>
    Lee Bradley committed Mar 3, 2022
    Configuration menu
    Copy the full SHA
    1ebca2a View commit details
    Browse the repository at this point in the history