Skip to content

Commit

Permalink
Merge pull request #29 from Overmuse/SR/previous_close
Browse files Browse the repository at this point in the history
SR/previous close
  • Loading branch information
SebRollen authored May 18, 2021
2 parents 805cef4 + d9527a5 commit 03d0ae9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polygon"
version = "0.9.0"
version = "0.9.1"
authors = ["Sebastian Rollen <[email protected]>"]
edition = "2018"

Expand Down
6 changes: 4 additions & 2 deletions src/rest/stocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,9 @@ pub struct PreviousClose {
pub h: Decimal,
pub l: Decimal,
pub c: Decimal,
pub v: u64,
// TODO: This should be an integer, but Polygon sometimes returns the value in scientific
// notation, which messes with deserialization
pub v: Decimal,
pub vw: Decimal,
pub t: u64,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -421,7 +423,7 @@ mod test {
Matcher::UrlEncoded("apiKey".into(), "TOKEN".into()),
Matcher::UrlEncoded("unadjusted".into(), "false".into())
]))
.with_body(r#"{"ticker":"AAPL","status":"OK","queryCount":1,"resultsCount":1,"adjusted":true,"results":[{"T":"AAPL","v":131704427,"vw":116.3058,"o":115.55,"c":115.97,"h":117.59,"l":114.13,"t":1605042000000}],"request_id":"6a7e466379af0a71039d60cc78e72282"}"#).create();
.with_body(r#"{"ticker":"AAPL","status":"OK","queryCount":1,"resultsCount":1,"adjusted":true,"results":[{"T":"AAPL","v":1.31704427e+079,"vw":116.3058,"o":115.55,"c":115.97,"h":117.59,"l":114.13,"t":1605042000000}],"request_id":"6a7e466379af0a71039d60cc78e72282"}"#).create();

let url = mockito::server_url();

Expand Down

0 comments on commit 03d0ae9

Please sign in to comment.