Skip to content

Commit 1e6cb68

Browse files
committed
Update comments based on David's review
1 parent d1d393e commit 1e6cb68

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

pyth-sdk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2018"
66
license = "Apache-2.0"
77
homepage = "https://pyth.network"
88
repository = "https://github.com/pyth-network/pyth-sdk-rs"
9-
description = "pyth price oracle data structures and example usage"
9+
description = "Data structures and utilites for the Pyth price oracle"
1010
keywords = [ "pyth", "oracle" ]
1111
readme = "README.md"
1212

pyth-sdk/src/lib.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use schemars::JsonSchema;
88
mod price_conf;
99
pub use price_conf::PriceConf;
1010

11+
/// This consists of 32 bytes and it is currently based on largest Public Key size on various blockchains.
1112
pub type ProductIdentifier = [u8; 32];
1213

1314
/// Represents availability status of a price feed.
@@ -80,6 +81,7 @@ pub struct Price {
8081
impl Price {
8182
/**
8283
* Get the current price and confidence interval as fixed-point numbers of the form a * 10^e.
84+
*
8385
* Returns a struct containing the current price, confidence interval, and the exponent for both
8486
* numbers. Returns `None` if price information is currently unavailable for any reason.
8587
*/
@@ -97,8 +99,8 @@ impl Price {
9799

98100
/**
99101
* Get the exponential moving average price (ema_price) and a confidence interval on the result.
100-
* Returns `None` if the ema price is currently unavailable.
101102
*
103+
* Returns `None` if the ema price is currently unavailable.
102104
* At the moment, the confidence interval returned by this method is computed in
103105
* a somewhat questionable way, so we do not recommend using it for high-value applications.
104106
*/
@@ -112,8 +114,9 @@ impl Price {
112114
}
113115

114116
/**
115-
* Get the current price of this account in a different quote currency. If this account
116-
* represents the price of the product X/Z, and `quote` represents the price of the product Y/Z,
117+
* Get the current price of this account in a different quote currency.
118+
*
119+
* If this account represents the price of the product X/Z, and `quote` represents the price of the product Y/Z,
117120
* this method returns the price of X/Y. Use this method to get the price of e.g., mSOL/SOL from
118121
* the mSOL/USD and SOL/USD accounts.
119122
*
@@ -140,7 +143,9 @@ impl Price {
140143
}
141144

142145
/**
143-
* Get the price of a basket of currencies. Each entry in `amounts` is of the form
146+
* Get the price of a basket of currencies.
147+
*
148+
* Each entry in `amounts` is of the form
144149
* `(price, qty, qty_expo)`, and the result is the sum of `price * qty * 10^qty_expo`.
145150
* The result is returned with exponent `result_expo`.
146151
*

rustfmt.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ struct_field_align_threshold = 80
1616

1717
# Allow up to two blank lines for grouping.
1818
blank_lines_upper_bound = 2
19+
20+
# Wrap comments
21+
comment_width = 120
22+
wrap_comments = true

0 commit comments

Comments
 (0)