pub fn confirm_eth_tx(&self, hash: &H256) -> QueryResult<()> {
        self.0.conn().transaction(|| {
            let eth_op_id = self.get_eth_op_id(hash)?;

            // Set the `confirmed` and `final_hash` field of the entry.
            let updated: Vec<i64> =
                update(eth_operations::table.filter(eth_operations::id.eq(eth_op_id)))
                    .set((
                        eth_operations::confirmed.eq(true),
                        eth_operations::final_hash.eq(Some(hash.as_bytes().to_vec())),
                    ))
                    .returning(eth_operations::id)
                    .get_results(self.0.conn())?;

            assert_eq!(
                updated.len(),
                1,
                "Unexpected amount of operations were confirmed"
            );

            let eth_op_id = updated[0];

            let binding: Option<ETHBinding> = eth_ops_binding::table
                .filter(eth_ops_binding::eth_op_id.eq(eth_op_id))
                .first::<ETHBinding>(self.0.conn())
                .optional()?;

            // If there is a ZKSync operation, mark it as confirmed as well.
            if let Some(binding) = binding {
                let op = operations::table
                    .filter(operations::id.eq(binding.op_id))
                    .first::<StoredOperation>(self.0.conn())?;

                update(operations::table.filter(operations::id.eq(op.id)))
                    .set(operations::confirmed.eq(true))
                    .execute(self.0.conn())
                    .map(drop)?;
            }

            Ok(())
        })
    }
/// Marks the stored Ethereum transaction as confirmed (and thus the associated `Operation`
/// is marked as confirmed as well).
Marks the stored Ethereum transaction as confirmed (and thus the associated `Operation`
is marked as confirmed as well).
Marks the stored Ethereum transaction as confirmed ( and thus the associated ` Operation ` is marked as confirmed as well ) .
pub fn confirm_eth_tx(&self, hash: &H256) -> QueryResult<()> {
        self.0.conn().transaction(|| {
            let eth_op_id = self.get_eth_op_id(hash)?;
            // Set the `confirmed` and `final_hash` field of the entry.
            let updated: Vec<i64> =
                update(eth_operations::table.filter(eth_operations::id.eq(eth_op_id)))
                    .set((
                        eth_operations::confirmed.eq(true),
                        eth_operations::final_hash.eq(Some(hash.as_bytes().to_vec())),
                    ))
                    .returning(eth_operations::id)
                    .get_results(self.0.conn())?;
            assert_eq!(
                updated.len(),
                1,
                "Unexpected amount of operations were confirmed"
            );
            let eth_op_id = updated[0];
            let binding: Option<ETHBinding> = eth_ops_binding::table
                .filter(eth_ops_binding::eth_op_id.eq(eth_op_id))
                .first::<ETHBinding>(self.0.conn())
                .optional()?;
            // If there is a ZKSync operation, mark it as confirmed as well.
            if let Some(binding) = binding {
                let op = operations::table
                    .filter(operations::id.eq(binding.op_id))
                    .first::<StoredOperation>(self.0.conn())?;
                update(operations::table.filter(operations::id.eq(op.id)))
                    .set(operations::confirmed.eq(true))
                    .execute(self.0.conn())
                    .map(drop)?;
            }
            Ok(())
        })
    }
pub fn confirm_eth_tx ( & self , hash : & H256 ) -> QueryResult < ( ) > { self . 0 . conn ( ) . transaction ( | | { let eth_op_id = self . get_eth_op_id ( hash ) ? ; // Set the `confirmed` and `final_hash` field of the entry. let updated : Vec < i64 > = update ( eth_operations :: table . filter ( eth_operations :: id . eq ( eth_op_id ) ) ) . set ( ( eth_operations :: confirmed . eq ( true ) , eth_operations :: final_hash . eq ( Some ( hash . as_bytes ( ) . to_vec ( ) ) ) , ) ) . returning ( eth_operations :: id ) . get_results ( self . 0 . conn ( ) ) ? ; assert_eq ! ( updated len ( ) 1 " " ) ; let eth_op_id = updated [ 0 ] ; let binding : Option < ETHBinding > = eth_ops_binding :: table . filter ( eth_ops_binding :: eth_op_id . eq ( eth_op_id ) ) . first :: < ETHBinding > ( self . 0 . conn ( ) ) . optional ( ) ? ; // If there is a ZKSync operation, mark it as confirmed as well. if let Some ( binding ) = binding { let op = operations :: table . filter ( operations :: id . eq ( binding . op_id ) ) . first :: < StoredOperation > ( self . 0 . conn ( ) ) ? ; update ( operations :: table . filter ( operations :: id . eq ( op . id ) ) ) . set ( operations :: confirmed . eq ( true ) ) . execute ( self . 0 . conn ( ) ) . map ( drop ) ? ; } Ok ( ( ) ) } ) }
Marks the stored Ethereum transaction as confirmed (and thus the associated `Operation`
is marked as confirmed as well).
Marks the stored Ethereum transaction as confirmed ( and thus the associated ` Operation ` is marked as confirmed as well ) .
&self
hash
&H256