fixing error for first request
This commit is contained in:
parent
177e68a514
commit
29616a19c9
|
@ -2,8 +2,8 @@ CREATE SCHEMA banking_stage_results;
|
|||
|
||||
CREATE TABLE banking_stage_results.transaction_infos (
|
||||
signature CHAR(88) NOT NULL,
|
||||
message CHAR(1280),
|
||||
errors CHAR(10000) NOT NULL,
|
||||
message text,
|
||||
errors text,
|
||||
is_executed BOOL,
|
||||
is_confirmed BOOL,
|
||||
first_notification_slot BIGINT NOT NULL,
|
||||
|
|
|
@ -68,9 +68,11 @@ async fn main() {
|
|||
x.add_notification(&transaction);
|
||||
}
|
||||
None => {
|
||||
let mut x = TransactionInfo::new(&transaction);
|
||||
x.add_notification(&transaction);
|
||||
map_of_infos.insert(
|
||||
sig,
|
||||
TransactionInfo::new(transaction.signature, transaction.slot),
|
||||
x,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,14 +79,26 @@ pub struct TransactionInfo {
|
|||
}
|
||||
|
||||
impl TransactionInfo {
|
||||
pub fn new(signature: String, first_notification_slot: Slot) -> Self {
|
||||
pub fn new(notification: &SubscribeUpdateBankingTransactionResults) -> Self {
|
||||
let mut errors = HashMap::new();
|
||||
let is_executed = notification.error.is_none();
|
||||
|
||||
match ¬ification.error {
|
||||
Some(e) => {
|
||||
let error: TransactionError = bincode::deserialize(&e.err).unwrap();
|
||||
let key = ErrorKey { error, slot: notification.slot };
|
||||
errors.insert( key, 1);
|
||||
},
|
||||
None => {
|
||||
}
|
||||
};
|
||||
Self {
|
||||
signature,
|
||||
signature: notification.signature.clone(),
|
||||
transaction_message: None,
|
||||
errors: HashMap::new(),
|
||||
is_executed: false,
|
||||
errors,
|
||||
is_executed,
|
||||
is_confirmed: false,
|
||||
first_notification_slot,
|
||||
first_notification_slot: notification.slot,
|
||||
cu_requested: None,
|
||||
prioritization_fees: None,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue