-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Monitoring and User Transaction Processors #597
Conversation
let mut signatures = vec![]; | ||
let mut user_transactions = vec![]; | ||
for txn in item.data { | ||
let txn_version = txn.version as i64; | ||
let block_height = txn.block_height as i64; | ||
let txn_data = match txn.txn_data.as_ref() { | ||
Some(txn_data) => txn_data, | ||
None => { | ||
PROCESSOR_UNKNOWN_TYPE_COUNT | ||
.with_label_values(&["UserTransactionProcessor"]) | ||
.inc(); | ||
tracing::warn!( | ||
transaction_version = txn_version, | ||
"Transaction data doesn't exist" | ||
); | ||
continue; | ||
}, | ||
}; | ||
if let TxnData::User(inner) = txn_data { | ||
let (user_transaction, sigs) = UserTransactionModel::from_transaction( | ||
inner, | ||
txn.timestamp.as_ref().unwrap(), | ||
block_height, | ||
txn.epoch as i64, | ||
txn_version, | ||
); | ||
signatures.extend(sigs); | ||
user_transactions.push(user_transaction); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we haven't been doing this for the other processors, but could we move this into a shared function to improve maintainability? someone could come in and edit the parsing logic for non-SDK processor and forget to also update the SDK processor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah good shout. added
Purpose
Add User Transaction Processor
Add Monitoring Processor
Its just the transaction stream since the processor just no-ops