@@ -374,23 +374,28 @@ pub struct PriceFeedMetadata {
374
374
#[ serde( rename_all = "snake_case" ) ]
375
375
pub enum AssetType {
376
376
Crypto ,
377
- #[ serde( rename = "fx" ) ]
378
- FX ,
377
+ Fx ,
379
378
Equity ,
380
379
Metal ,
381
380
Rates ,
382
381
CryptoRedemptionRate ,
382
+ Commodities ,
383
+ CryptoIndex ,
384
+ CryptoNav ,
383
385
}
384
386
385
387
impl Display for AssetType {
386
388
fn fmt ( & self , f : & mut Formatter ) -> FmtResult {
387
389
match self {
388
390
AssetType :: Crypto => write ! ( f, "crypto" ) ,
389
- AssetType :: FX => write ! ( f, "fx" ) ,
391
+ AssetType :: Fx => write ! ( f, "fx" ) ,
390
392
AssetType :: Equity => write ! ( f, "equity" ) ,
391
393
AssetType :: Metal => write ! ( f, "metal" ) ,
392
394
AssetType :: Rates => write ! ( f, "rates" ) ,
393
395
AssetType :: CryptoRedemptionRate => write ! ( f, "crypto_redemption_rate" ) ,
396
+ AssetType :: Commodities => write ! ( f, "commodities" ) ,
397
+ AssetType :: CryptoIndex => write ! ( f, "crypto_index" ) ,
398
+ AssetType :: CryptoNav => write ! ( f, "crypto_nav" ) ,
394
399
}
395
400
}
396
401
}
@@ -409,8 +414,8 @@ mod tests {
409
414
. trim_matches( '"' )
410
415
) ;
411
416
assert_eq ! (
412
- AssetType :: FX . to_string( ) ,
413
- serde_json:: to_string( & AssetType :: FX )
417
+ AssetType :: Fx . to_string( ) ,
418
+ serde_json:: to_string( & AssetType :: Fx )
414
419
. unwrap( )
415
420
. trim_matches( '"' )
416
421
) ;
@@ -438,5 +443,23 @@ mod tests {
438
443
. unwrap( )
439
444
. trim_matches( '"' )
440
445
) ;
446
+ assert_eq ! (
447
+ AssetType :: Commodities . to_string( ) ,
448
+ serde_json:: to_string( & AssetType :: Commodities )
449
+ . unwrap( )
450
+ . trim_matches( '"' )
451
+ ) ;
452
+ assert_eq ! (
453
+ AssetType :: CryptoIndex . to_string( ) ,
454
+ serde_json:: to_string( & AssetType :: CryptoIndex )
455
+ . unwrap( )
456
+ . trim_matches( '"' )
457
+ ) ;
458
+ assert_eq ! (
459
+ AssetType :: CryptoNav . to_string( ) ,
460
+ serde_json:: to_string( & AssetType :: CryptoNav )
461
+ . unwrap( )
462
+ . trim_matches( '"' )
463
+ ) ;
441
464
}
442
465
}
0 commit comments