0xSpaceShard / starknet-devnet

A local testnet for Starknet
https://0xspaceshard.github.io/starknet-devnet/
MIT License
211 stars 77 forks source link

feat: add TransactionStatus.REVERTED to status #527

Closed kasteph closed 1 year ago

kasteph commented 1 year ago

Usage related changes

Development related changes

Checklist:

FabijanC commented 1 year ago

Can you give an example of an issue that this PR resolves?

kasteph commented 1 year ago

@FabijanC sure! There could be a case where a contract/account has a status of Reverted. However, because this doesn't exist in that dictionary, it raises a KeyError and thus the server ultimately returns an HTTP 500 to the client.

FabijanC commented 1 year ago

I thought that perhaps you would have a ready example, but I see your point

In any case, this Devnet supports only JSON-RPC specification 0.3.0 (the latest stable version is 0.4.0 and there is 0.5.0 incoming; link to spec versions). In that sense, 0.3.0 does not yet mention tx reversion, so this status was not added to Devnet.

If your PR does not in any way break the existing functionality, it could be merged, but I'd wait until Monday since it's the end of the work day (and week) in my time zone.

Devnet has mostly been rewritten in Rust, with some features still pending. You can check out the devnet-rs repo. It currently supports JSON-RPC v0.4.0, with the trace API (e.g. simulateTransactions) being added at the time of writing this.

FabijanC commented 1 year ago

Let me know if this is a high priority for you.

FabijanC commented 1 year ago

@kasteph Then I guess it's not a high priority.

kasteph commented 1 year ago

Hi @FabijanC, yes, it's not a priority. I was able to find a workaround. I'll close this issue and start looking at the Rust implementation.