Skip to content

fix:(api/fraud): fraud.Get returns potentially confusing error message #3407

Open
@distractedm1nd

Description

@distractedm1nd

From a user:

in this endpoint https://node-rpc-docs.celestia.org/?version=v0.13.5#fraud.Get
What should be Proof Type? I tried to use type shown in the docs but that is throwing error.
datastore: key not found.

This makes sense to us, because we know there is no fraud available in the store so ofc it says key not found. But this is not very intuitive.

I suggest either:

  • returning an empty array when this error is encountered (haha)
  • returning an error that is user friendly, i.e. NoFraudAvailable = "no fraud proofs were found"

I am more for option one because in my mind, it is not semantically an error. For the same reasoning that I used with blob.GetAll. But I won't block if others prefer version two.

This also signifies we should write an example for how to interact with fraud proofs over the API. I have opened an issue to add an example, showing that Subscribe makes the most sense here unless you want to poll with Get.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions