Skip to content
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

fix payload filtering for parquet processor #439

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,24 +187,26 @@ impl Transaction {
block_height,
block_timestamp,
);
let payload = user_txn
let request = &user_txn
.request
.as_ref()
.expect("Getting user request failed.")
.payload
.as_ref()
.expect("Getting payload failed.");
let payload_cleaned = get_clean_payload(payload, txn_version);
let payload_type = get_payload_type(payload);
.expect("Getting user request failed.");

let (payload_cleaned, payload_type) = match request.payload.as_ref() {
Some(payload) => {
let payload_cleaned = get_clean_payload(payload, txn_version);
(payload_cleaned, Some(get_payload_type(payload)))
},
None => (None, None),
};

// let serialized_payload = serde_json::to_string(&payload_cleaned).unwrap(); // Handle errors as needed)
let serialized_payload =
payload_cleaned.map(|payload| canonical_json::to_string(&payload).unwrap());
(
Self::from_transaction_info_with_data(
transaction_info,
serialized_payload,
Some(payload_type),
payload_type,
txn_version,
transaction_type,
user_txn.events.len() as i64,
Expand Down
Loading