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

Backport camelCasing JSON-RPC elements #973

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions lib/src/json_rpc/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,37 +702,37 @@ pub enum FollowEvent<'a> {
#[serde(rename = "prunedBlockHashes")]
pruned_blocks_hashes: Vec<HashHexString>,
},
#[serde(rename = "operation-body-done")]
#[serde(rename = "operationBodyDone")]
OperationBodyDone {
#[serde(rename = "operationId")]
operation_id: Cow<'a, str>,
value: Vec<HexString>,
},
#[serde(rename = "operation-call-done")]
#[serde(rename = "operationCallDone")]
OperationCallDone {
#[serde(rename = "operationId")]
operation_id: Cow<'a, str>,
output: HexString,
},
#[serde(rename = "operation-inaccessible")]
#[serde(rename = "operationInaccessible")]
OperationInaccessible {
#[serde(rename = "operationId")]
operation_id: Cow<'a, str>,
},
#[serde(rename = "operation-storage-items")]
#[serde(rename = "operationStorageItems")]
OperationStorageItems {
#[serde(rename = "operationId")]
operation_id: Cow<'a, str>,
items: Vec<ChainHeadStorageResponseItem>,
},
#[serde(rename = "operation-storage-done")]
#[serde(rename = "operationStorageDone")]
OperationStorageDone {
#[serde(rename = "operationId")]
operation_id: Cow<'a, str>,
},
#[serde(rename = "operation-waiting-for-continue")]
#[serde(rename = "operationWaitingForContinue")]
OperationWaitingForContinue,
#[serde(rename = "operation-error")]
#[serde(rename = "operationError")]
OperationError {
#[serde(rename = "operationId")]
operation_id: Cow<'a, str>,
Expand Down Expand Up @@ -783,7 +783,7 @@ pub struct ChainHeadStorageResponseItem {
#[serde(skip_serializing_if = "Option::is_none")]
pub hash: Option<HexString>,
#[serde(
rename = "closest-descendant-merkle-value",
rename = "closestDescendantMerkleValue",
skip_serializing_if = "Option::is_none"
)]
pub closest_descendant_merkle_value: Option<HexString>,
Expand All @@ -795,11 +795,11 @@ pub enum ChainHeadStorageType {
Value,
#[serde(rename = "hash")]
Hash,
#[serde(rename = "closest-descendant-merkle-value")]
#[serde(rename = "closestDescendantMerkleValue")]
ClosestDescendantMerkleValue,
#[serde(rename = "descendants-values")]
#[serde(rename = "descendantsValues")]
DescendantsValues,
#[serde(rename = "descendants-hashes")]
#[serde(rename = "descendantsHashes")]
DescendantsHashes,
}

Expand Down
4 changes: 4 additions & 0 deletions wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Changed

- The `operation-body-done`, `operation-call-done`, `operation-storage-done`, `operation-storage-items`, `operation-waiting-for-continue`, `operation-inaccessible`, and `operation-error` events, and the `closest-descendant-merkle-value`, `descendants-values`, and `descendants-hashes` item types of the new JSON-RPC API have been renamed and are now camelCased (`operationBodyDone`, `operationStorageItems`, `descendantsValues`, etc.), in accordance with the latest changes in the JSON-RPC API specification. ([#973](https://github.com/smol-dot/smoldot/pull/973))

## 1.0.14 - 2023-07-26

### Changed
Expand Down
2 changes: 1 addition & 1 deletion wasm-node/javascript/test/chainHead.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ test('chainHead_unstable_body works', async t => {
.then(async (chain) => {
while (true) {
const parsed = JSON.parse(await chain.nextJsonRpcResponse());
if (parsed.method == "chainHead_unstable_followEvent" && parsed.params.result.event == "operation-inaccessible") {
if (parsed.method == "chainHead_unstable_followEvent" && parsed.params.result.event == "operationInaccessible") {
t.pass();
break;
}
Expand Down