Skip to content

Refine response of /transaction #5391

@0x009922

Description

@0x009922

Currently Iroha responds this way:

  • 200 when transaction is accepted. No response body provided.
  • 400 when transaction is not accepted (limits, signature verification, unexpected genesis, chain id mismatch, future timestamp, + queue errors (in queue, in blockchain, expired, maximum txs per user))
  • 500 when the queue is full

Proposal

202 Accepted for when transaction is accepted.

400 Bad Request for when:

  • tx in queue
  • tx in blockchain
  • tx expired
  • tx in future
  • limits + maximum txs per user
  • chain id mismatch

It would also be consistent to return an encoded error instead of just a string, as /queue does. Or maybe return both a string and an encoded error.

401 Unauthorized for when transaction signature verification fails.

403 Forbidden for when transaction is signed by the genesis account.

503 Service Unavailable for when the queue is full. This status code is commonly used for temporary conditions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or requestapi-changesChanges in the API for client librariesgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions