Skip to content

Commit

Permalink
breaking change: rename response.json to response.data (#584)
Browse files Browse the repository at this point in the history
* breaking change: rename response.json to response.data

* Create sour-donkeys-draw.md

* Update sour-donkeys-draw.md
  • Loading branch information
fvictorio authored Aug 7, 2024
1 parent e90a194 commit a417e19
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/sour-donkeys-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nomicfoundation/edr": minor
---

Renamed `json` field in response to `data` and changed its type to `string | object` (specified as `string | any` due to an napi-rs limitation).
1 change: 0 additions & 1 deletion crates/edr_napi/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ export class Provider {
export class Response {
/** Returns the response data as a JSON string or a JSON object. */
get data(): string | any
get json(): string | any
get solidityTrace(): RawTrace | null
get traces(): Array<RawTrace>
}
Expand Down
6 changes: 0 additions & 6 deletions crates/edr_napi/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,6 @@ impl Response {
self.data.clone()
}

// Temporary alias for data to prevent breaking change
#[napi(getter)]
pub fn json(&self) -> Either<String, serde_json::Value> {
self.data.clone()
}

#[napi(getter)]
pub fn solidity_trace(&self) -> Option<RawTrace> {
self.solidity_trace
Expand Down

0 comments on commit a417e19

Please sign in to comment.