withdraw_nft in build_block_witness function
@@ -36,8 +36,8 @@ use zksync_types::{
// Local deps
use crate::witness::{
ChangePubkeyOffChainWitness, CloseAccountWitness, DepositWitness, ForcedExitWitness,
- FullExitWitness, MintNFTWitness, TransferToNewWitness, TransferWitness, WithdrawWitness,
- Witness,
+ FullExitWitness, MintNFTWitness, TransferToNewWitness, TransferWitness, WithdrawNFTWitness,
+ WithdrawWitness, Witness,
};
use crate::{
account::AccountWitness,
@@ -865,8 +865,20 @@ pub fn build_block_witness<'a>(
pub_data.extend(mint_nft_witness.get_pubdata());
offset_commitment.extend(mint_nft_witness.get_offset_commitment_data())
}
- ZkSyncOp::WithdrawNFT(_) => {
- todo!()
+ ZkSyncOp::WithdrawNFT(withdraw_nft) => {
+ let withdraw_nft_witness =
+ WithdrawNFTWitness::apply_tx(&mut witness_accum.account_tree, &withdraw_nft);
+
+ let input = SigDataInput::from_withdraw_nft_op(&withdraw_nft)?;
+ let withdraw_nft_operations = withdraw_nft_witness.calculate_operations(input);
+
+ operations.extend(withdraw_nft_operations);
+ fees.push(CollectedFee {
+ token: withdraw_nft.tx.fee_token,
+ amount: withdraw_nft.tx.fee,
+ });
+ pub_data.extend(withdraw_nft_witness.get_pubdata());
+ offset_commitment.extend(withdraw_nft_witness.get_offset_commitment_data())
}
}
}
