@@ -35,6 +35,7 @@ pub enum PayloadPropertyValue {
35
35
BestAskPrice ( Option < Price > ) ,
36
36
PublisherCount ( Option < u16 > ) ,
37
37
Exponent ( i16 ) ,
38
+ Confidence ( Option < Price > ) ,
38
39
}
39
40
40
41
#[ derive( Debug , Clone , Default , Serialize , Deserialize ) ]
@@ -78,6 +79,9 @@ impl PayloadData {
78
79
PriceFeedProperty :: Exponent => {
79
80
PayloadPropertyValue :: Exponent ( * exponent)
80
81
}
82
+ PriceFeedProperty :: Confidence => {
83
+ PayloadPropertyValue :: Confidence ( feed. confidence )
84
+ }
81
85
} )
82
86
. collect ( ) ,
83
87
} )
@@ -115,6 +119,10 @@ impl PayloadData {
115
119
writer. write_u8 ( PriceFeedProperty :: Exponent as u8 ) ?;
116
120
writer. write_i16 :: < BO > ( * exponent) ?;
117
121
}
122
+ PayloadPropertyValue :: Confidence ( confidence) => {
123
+ writer. write_u8 ( PriceFeedProperty :: Confidence as u8 ) ?;
124
+ write_option_price :: < BO > ( & mut writer, * confidence) ?;
125
+ }
118
126
}
119
127
}
120
128
}
@@ -157,6 +165,8 @@ impl PayloadData {
157
165
PayloadPropertyValue :: PublisherCount ( read_option_u16 :: < BO > ( & mut reader) ?)
158
166
} else if property == PriceFeedProperty :: Exponent as u8 {
159
167
PayloadPropertyValue :: Exponent ( reader. read_i16 :: < BO > ( ) ?)
168
+ } else if property == PriceFeedProperty :: Confidence as u8 {
169
+ PayloadPropertyValue :: Confidence ( read_option_price :: < BO > ( & mut reader) ?)
160
170
} else {
161
171
bail ! ( "unknown property" ) ;
162
172
} ;
0 commit comments