Skip to content

Commit

Permalink
handle unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Nov 28, 2024
1 parent 7bc39b2 commit 78fde33
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/json_rescue_v5_extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ pub fn extract_v5_json_rescue(

pub fn decode_transaction_args(wtx: &mut WarehouseTxMaster, tx_bytes: &[u8]) -> Result<()> {
// test we can bcs decode to the transaction object
let t: TransactionV5 = bcs::from_bytes(tx_bytes).unwrap();
let t: TransactionV5 = bcs::from_bytes(tx_bytes).context(&format!(

Check failure on line 86 in src/json_rescue_v5_extract.rs

View workflow job for this annotation

GitHub Actions / clippy

temporary value dropped while borrowed
"could not bcs decode tx_bytes, for function: {}",
wtx.function
))?;

if let TransactionV5::UserTransaction(u) = &t {
if let TransactionPayload::ScriptFunction(_) = &u.raw_txn.payload {
Expand All @@ -97,8 +100,7 @@ pub fn decode_transaction_args(wtx: &mut WarehouseTxMaster, tx_bytes: &[u8]) ->
wtx.entry_function = Some(EntryFunctionArgs::V5(sf.to_owned()));
}
ScriptFunctionCallGenesis::AutopayCreateInstruction { payee, .. } => {
wtx.relation_label =
RelationLabel::Transfer(cast_legacy_account(payee)?);
wtx.relation_label = RelationLabel::Transfer(cast_legacy_account(payee)?);
wtx.entry_function = Some(EntryFunctionArgs::V5(sf.to_owned()));
}
ScriptFunctionCallGenesis::CreateAccUser { .. } => {
Expand Down
1 change: 0 additions & 1 deletion src/json_rescue_v5_load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ pub async fn rip_concurrent(start_dir: &Path, pool: &Graph) -> Result<()> {
Ok(())
}


const MAX_CONCURRENT_TASKS: usize = 4; // Define the limit for concurrent tasks

pub async fn rip_concurrent_limited(start_dir: &Path, pool: &Graph) -> Result<()> {
Expand Down
2 changes: 0 additions & 2 deletions tests/test_json_rescue_v5_load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ async fn test_load_entrypoint() -> anyhow::Result<()> {
Ok(())
}



#[tokio::test]
async fn test_rescue_v5_parse_set_wallet_tx() -> anyhow::Result<()> {
libra_forensic_db::log_setup();
Expand Down

0 comments on commit 78fde33

Please sign in to comment.