Skip to content

Commit 84be9bf

Browse files
committed
Support sending price and confidence as strings
1 parent 20a8fee commit 84be9bf

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ solana-shadow = "0.2.4"
3737
clap = { version = "4.0.32", features = ["derive"] }
3838
humantime-serde = "1.1.1"
3939
slog-envlogger = "2.2.0"
40+
serde-this-or-that = "0.4.0"
4041

4142
[dev-dependencies]
4243
tokio-util = { version = "0.7.0", features = ["full"] }

src/agent/pythd/api.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ pub mod rpc {
127127
Deserialize,
128128
Serialize,
129129
},
130+
serde_this_or_that::{
131+
as_i64,
132+
as_u64,
133+
},
130134
slog::Logger,
131135
std::{
132136
fmt::Debug,
@@ -181,7 +185,9 @@ pub mod rpc {
181185
#[derive(Serialize, Deserialize, Debug, Clone)]
182186
struct UpdatePriceParams {
183187
account: Pubkey,
188+
#[serde(deserialize_with = "as_i64")]
184189
price: Price,
190+
#[serde(deserialize_with = "as_u64")]
185191
conf: Conf,
186192
status: String,
187193
}

0 commit comments

Comments
 (0)