From d153a9e67d1af6f5ae33a43e5c535acb5fbcc461 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Wed, 11 Oct 2023 11:43:59 +0800 Subject: [PATCH] Fix `valid_dao_withdraw_transaction` panic --- verification/src/transaction_verifier.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/verification/src/transaction_verifier.rs b/verification/src/transaction_verifier.rs index 11214f583f..309fffb91f 100644 --- a/verification/src/transaction_verifier.rs +++ b/verification/src/transaction_verifier.rs @@ -585,10 +585,16 @@ impl CapacityVerifier { .resolved_inputs .iter() .any(|cell_meta| { - cell_uses_dao_type_script( - &cell_meta.cell_output, - self.dao_type_hash.as_ref().expect("No dao system cell"), - ) + cell_meta + .cell_output + .type_() + .to_opt() + .map(|t| { + Into::::into(t.hash_type()) == Into::::into(ScriptHashType::Type) + && &t.code_hash() + == self.dao_type_hash.as_ref().expect("No dao system cell") + }) + .unwrap_or(false) }) } }