Skip to content

Commit 7bb5488

Browse files
authored
feat(pyth-lazer) Add more context to ParseError in JRPC protocol (#2843)
1 parent 01880f7 commit 7bb5488

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lazer/contracts/solana/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lazer/contracts/solana/programs/pyth-lazer-solana-contract/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ no-log-ix-name = []
1919
idl-build = ["anchor-lang/idl-build"]
2020

2121
[dependencies]
22-
pyth-lazer-protocol = { path = "../../../../sdk/rust/protocol", version = "0.8.0" }
22+
pyth-lazer-protocol = { path = "../../../../sdk/rust/protocol", version = "0.8.1" }
2323

2424
anchor-lang = "0.30.1"
2525
bytemuck = "1.20.0"

lazer/publisher_sdk/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "Apache-2.0"
77
repository = "https://github.com/pyth-network/pyth-crosschain"
88

99
[dependencies]
10-
pyth-lazer-protocol = { version = "0.8.0", path = "../../sdk/rust/protocol" }
10+
pyth-lazer-protocol = { version = "0.8.1", path = "../../sdk/rust/protocol" }
1111
anyhow = "1.0.98"
1212
protobuf = "3.7.2"
1313
serde-value = "0.7.0"

lazer/sdk/rust/client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description = "A Rust client for Pyth Lazer"
66
license = "Apache-2.0"
77

88
[dependencies]
9-
pyth-lazer-protocol = { path = "../protocol", version = "0.8.0" }
9+
pyth-lazer-protocol = { path = "../protocol", version = "0.8.1" }
1010
tokio = { version = "1", features = ["full"] }
1111
tokio-tungstenite = { version = "0.20", features = ["native-tls"] }
1212
futures-util = "0.3"

lazer/sdk/rust/protocol/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pyth-lazer-protocol"
3-
version = "0.8.0"
3+
version = "0.8.1"
44
edition = "2021"
55
description = "Pyth Lazer SDK - protocol types."
66
license = "Apache-2.0"

lazer/sdk/rust/protocol/src/jrpc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,18 @@ pub struct JrpcErrorObject {
8787

8888
#[derive(Debug, Eq, PartialEq)]
8989
pub enum JrpcError {
90-
ParseError,
90+
ParseError(String),
9191
InternalError,
9292
}
9393

9494
// note: error codes can be found in the rfc https://www.jsonrpc.org/specification#error_object
9595
impl From<JrpcError> for JrpcErrorObject {
9696
fn from(error: JrpcError) -> Self {
9797
match error {
98-
JrpcError::ParseError => JrpcErrorObject {
98+
JrpcError::ParseError(error_message) => JrpcErrorObject {
9999
code: -32700,
100100
message: "Parse error".to_string(),
101-
data: None,
101+
data: Some(error_message.into()),
102102
},
103103
JrpcError::InternalError => JrpcErrorObject {
104104
code: -32603,

0 commit comments

Comments
 (0)