smoldot icon indicating copy to clipboard operation
smoldot copied to clipboard

camelCase transaction status to align with Substrate

Open jsdw opened this issue 2 years ago • 1 comments

Hey! An error cropped up via Ink in trying to use Subxt to communicate with Smoldot:

error on call `wait_for_in_block`: Serialization(Error("unknown variant `Ready`, expected one of `future`, `ready`, `broadcast`, `inBlock`, `retracted`, `finalityTimeout`, `finalized`, `usurped`, `dropped`, `invalid`", line: 1, column: 8))', /Users/bruno/.cargo/git/checkouts/ink-1add513eda8f5a89/9c9215f/crates/e2e/src/xts.rs:270:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I believe the reason for the issue was that Smoldot's author_submitAndWatchExtrinsic returns transaction statuses whose variants aren't camelCased, whereas the Substrate RPC method does camelCase (see https://github.com/paritytech/substrate/blob/283106b19b85bc8deb232cfa624eed195f143541/client/transaction-pool/api/src/lib.rs#L106)

So I wonder whether you'd be open to applying the same camelCasing in Smoldot to align?

jsdw avatar Mar 16 '23 16:03 jsdw

twiggy diff report

Difference in .wasm size before and after this pull request.


 Delta Bytes │ Item
─────────────┼──────────────────
          +0 ┊ Σ [0 Total Rows]

github-actions[bot] avatar Mar 16 '23 17:03 github-actions[bot]