Skip to content

Commit

Permalink
Backport camelCasing JSON-RPC elements (#973)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaka authored Jul 27, 2023
1 parent b14c414 commit 4ef0106
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
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

0 comments on commit 4ef0106

Please sign in to comment.