@@ -27,11 +27,11 @@ use {
27
27
Result ,
28
28
} ,
29
29
chrono:: Utc ,
30
- pyth_sdk:: {
31
- Identifier ,
30
+ pyth_sdk:: Identifier ,
31
+ pyth_sdk_solana:: state:: {
32
+ PriceComp ,
32
33
PriceStatus ,
33
34
} ,
34
- pyth_sdk_solana:: state:: PriceComp ,
35
35
serde:: {
36
36
Deserialize ,
37
37
Serialize ,
@@ -431,13 +431,14 @@ impl Adapter {
431
431
}
432
432
}
433
433
434
- // TODO: implement Display on pyth_sdk:: PriceStatus and then just call pyth_sdk:: PriceStatus::to_string
434
+ // TODO: implement Display on PriceStatus and then just call PriceStatus::to_string
435
435
fn price_status_to_str ( price_status : PriceStatus ) -> String {
436
436
match price_status {
437
437
PriceStatus :: Unknown => "unknown" ,
438
438
PriceStatus :: Trading => "trading" ,
439
439
PriceStatus :: Halted => "halted" ,
440
440
PriceStatus :: Auction => "auction" ,
441
+ PriceStatus :: Ignored => "ignored" ,
441
442
}
442
443
. to_string ( )
443
444
}
@@ -549,6 +550,7 @@ impl Adapter {
549
550
"trading" => Ok ( PriceStatus :: Trading ) ,
550
551
"halted" => Ok ( PriceStatus :: Halted ) ,
551
552
"auction" => Ok ( PriceStatus :: Auction ) ,
553
+ "ignored" => Ok ( PriceStatus :: Ignored ) ,
552
554
_ => Err ( anyhow ! ( "invalid price status: {:#?}" , status) ) ,
553
555
}
554
556
}
@@ -619,14 +621,12 @@ mod tests {
619
621
} ,
620
622
} ,
621
623
iobuffer:: IoBuffer ,
622
- pyth_sdk:: {
623
- Identifier ,
624
- PriceStatus ,
625
- } ,
624
+ pyth_sdk:: Identifier ,
626
625
pyth_sdk_solana:: state:: {
627
626
PriceAccount ,
628
627
PriceComp ,
629
628
PriceInfo ,
629
+ PriceStatus ,
630
630
PriceType ,
631
631
Rational ,
632
632
} ,
@@ -1108,7 +1108,7 @@ mod tests {
1108
1108
agg : PriceInfo {
1109
1109
price : 736382 ,
1110
1110
conf : 85623946 ,
1111
- status : pyth_sdk :: PriceStatus :: Unknown ,
1111
+ status : pyth_sdk_solana :: state :: PriceStatus :: Unknown ,
1112
1112
corp_act : pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1113
1113
pub_slot : 7262746 ,
1114
1114
} ,
@@ -1161,7 +1161,7 @@ mod tests {
1161
1161
agg : PriceInfo {
1162
1162
price : 8474837 ,
1163
1163
conf : 27468478 ,
1164
- status : pyth_sdk :: PriceStatus :: Unknown ,
1164
+ status : PriceStatus :: Unknown ,
1165
1165
corp_act : pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1166
1166
pub_slot : 2736478 ,
1167
1167
} ,
@@ -1173,14 +1173,14 @@ mod tests {
1173
1173
agg: PriceInfo {
1174
1174
price: 85698 ,
1175
1175
conf: 23645 ,
1176
- status: pyth_sdk :: PriceStatus :: Trading ,
1176
+ status: PriceStatus :: Trading ,
1177
1177
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1178
1178
pub_slot: 14765 ,
1179
1179
} ,
1180
1180
latest: PriceInfo {
1181
1181
price: 46985 ,
1182
1182
conf: 32565 ,
1183
- status: pyth_sdk :: PriceStatus :: Trading ,
1183
+ status: PriceStatus :: Trading ,
1184
1184
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1185
1185
pub_slot: 4368 ,
1186
1186
} ,
@@ -1233,7 +1233,7 @@ mod tests {
1233
1233
agg : PriceInfo {
1234
1234
price : 8254826 ,
1235
1235
conf : 6385638 ,
1236
- status : pyth_sdk :: PriceStatus :: Trading ,
1236
+ status : PriceStatus :: Trading ,
1237
1237
corp_act : pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1238
1238
pub_slot : 58462846 ,
1239
1239
} ,
@@ -1246,14 +1246,14 @@ mod tests {
1246
1246
agg: PriceInfo {
1247
1247
price: 8251 ,
1248
1248
conf: 7653 ,
1249
- status: pyth_sdk :: PriceStatus :: Trading ,
1249
+ status: PriceStatus :: Trading ,
1250
1250
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1251
1251
pub_slot: 365545 ,
1252
1252
} ,
1253
1253
latest: PriceInfo {
1254
1254
price: 65465 ,
1255
1255
conf: 451 ,
1256
- status: pyth_sdk :: PriceStatus :: Trading ,
1256
+ status: PriceStatus :: Trading ,
1257
1257
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1258
1258
pub_slot: 886562 ,
1259
1259
} ,
@@ -1266,14 +1266,14 @@ mod tests {
1266
1266
agg: PriceInfo {
1267
1267
price: 39865 ,
1268
1268
conf: 7456 ,
1269
- status: pyth_sdk :: PriceStatus :: Unknown ,
1269
+ status: PriceStatus :: Unknown ,
1270
1270
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1271
1271
pub_slot: 865 ,
1272
1272
} ,
1273
1273
latest: PriceInfo {
1274
1274
price: 5846 ,
1275
1275
conf: 32468 ,
1276
- status: pyth_sdk :: PriceStatus :: Unknown ,
1276
+ status: PriceStatus :: Unknown ,
1277
1277
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1278
1278
pub_slot: 7158 ,
1279
1279
} ,
@@ -1324,7 +1324,7 @@ mod tests {
1324
1324
agg : PriceInfo {
1325
1325
price : 876384 ,
1326
1326
conf : 1349364 ,
1327
- status : pyth_sdk :: PriceStatus :: Trading ,
1327
+ status : PriceStatus :: Trading ,
1328
1328
corp_act : pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1329
1329
pub_slot : 987236484 ,
1330
1330
} ,
@@ -1337,14 +1337,14 @@ mod tests {
1337
1337
agg: PriceInfo {
1338
1338
price: 54842 ,
1339
1339
conf: 599755 ,
1340
- status: pyth_sdk :: PriceStatus :: Trading ,
1340
+ status: PriceStatus :: Trading ,
1341
1341
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1342
1342
pub_slot: 1976465 ,
1343
1343
} ,
1344
1344
latest: PriceInfo {
1345
1345
price: 394764 ,
1346
1346
conf: 26485 ,
1347
- status: pyth_sdk :: PriceStatus :: Trading ,
1347
+ status: PriceStatus :: Trading ,
1348
1348
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1349
1349
pub_slot: 369454 ,
1350
1350
} ,
@@ -1357,14 +1357,14 @@ mod tests {
1357
1357
agg: PriceInfo {
1358
1358
price: 65649 ,
1359
1359
conf: 55896 ,
1360
- status: pyth_sdk :: PriceStatus :: Unknown ,
1360
+ status: PriceStatus :: Unknown ,
1361
1361
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1362
1362
pub_slot: 32976 ,
1363
1363
} ,
1364
1364
latest: PriceInfo {
1365
1365
price: 18616 ,
1366
1366
conf: 254458 ,
1367
- status: pyth_sdk :: PriceStatus :: Trading ,
1367
+ status: PriceStatus :: Trading ,
1368
1368
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1369
1369
pub_slot: 3126545 ,
1370
1370
} ,
@@ -1418,7 +1418,7 @@ mod tests {
1418
1418
agg : PriceInfo {
1419
1419
price : 397492 ,
1420
1420
conf : 33487 ,
1421
- status : pyth_sdk :: PriceStatus :: Trading ,
1421
+ status : PriceStatus :: Trading ,
1422
1422
corp_act : pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1423
1423
pub_slot : 529857382 ,
1424
1424
} ,
@@ -1431,14 +1431,14 @@ mod tests {
1431
1431
agg: PriceInfo {
1432
1432
price: 69854 ,
1433
1433
conf: 732565 ,
1434
- status: pyth_sdk :: PriceStatus :: Unknown ,
1434
+ status: PriceStatus :: Unknown ,
1435
1435
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1436
1436
pub_slot: 213654 ,
1437
1437
} ,
1438
1438
latest: PriceInfo {
1439
1439
price: 79556 ,
1440
1440
conf: 565461 ,
1441
- status: pyth_sdk :: PriceStatus :: Trading ,
1441
+ status: PriceStatus :: Trading ,
1442
1442
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1443
1443
pub_slot: 863125 ,
1444
1444
} ,
@@ -1451,14 +1451,14 @@ mod tests {
1451
1451
agg: PriceInfo {
1452
1452
price: 3265 ,
1453
1453
conf: 8962196 ,
1454
- status: pyth_sdk :: PriceStatus :: Trading ,
1454
+ status: PriceStatus :: Trading ,
1455
1455
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1456
1456
pub_slot: 301541 ,
1457
1457
} ,
1458
1458
latest: PriceInfo {
1459
1459
price: 465132 ,
1460
1460
conf: 8476531 ,
1461
- status: pyth_sdk :: PriceStatus :: Unknown ,
1461
+ status: PriceStatus :: Unknown ,
1462
1462
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1463
1463
pub_slot: 78964 ,
1464
1464
} ,
@@ -1509,7 +1509,7 @@ mod tests {
1509
1509
agg : PriceInfo {
1510
1510
price : 836489 ,
1511
1511
conf : 6769467 ,
1512
- status : pyth_sdk :: PriceStatus :: Trading ,
1512
+ status : PriceStatus :: Trading ,
1513
1513
corp_act : pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1514
1514
pub_slot : 6863892 ,
1515
1515
} ,
@@ -1521,14 +1521,14 @@ mod tests {
1521
1521
agg: PriceInfo {
1522
1522
price: 61478 ,
1523
1523
conf: 312545 ,
1524
- status: pyth_sdk :: PriceStatus :: Trading ,
1524
+ status: PriceStatus :: Trading ,
1525
1525
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1526
1526
pub_slot: 302156 ,
1527
1527
} ,
1528
1528
latest: PriceInfo {
1529
1529
price: 85315 ,
1530
1530
conf: 754256 ,
1531
- status: pyth_sdk :: PriceStatus :: Unknown ,
1531
+ status: PriceStatus :: Unknown ,
1532
1532
corp_act: pyth_sdk_solana:: state:: CorpAction :: NoCorpAct ,
1533
1533
pub_slot: 7101326 ,
1534
1534
} ,
0 commit comments