fn report_created_operation(&self, operation_type: OperationType) -> QueryResult<()> {
        self.0.conn().transaction(|| {
            let mut current_stats: ETHParams = eth_parameters::table.first(self.0.conn())?;

            // Increase the only one type of operations.
            match operation_type {
                OperationType::Commit => {
                    current_stats.commit_ops += 1;
                }
                OperationType::Verify => {
                    current_stats.verify_ops += 1;
                }
                OperationType::Withdraw => {
                    current_stats.withdraw_ops += 1;
                }
            };

            // Update the stored stats.
            update(eth_parameters::table.filter(eth_parameters::id.eq(true)))
                .set((
                    eth_parameters::commit_ops.eq(current_stats.commit_ops),
                    eth_parameters::verify_ops.eq(current_stats.verify_ops),
                    eth_parameters::withdraw_ops.eq(current_stats.withdraw_ops),
                ))
                .execute(self.0.conn())?;

            Ok(())
        })
    }
/// Updates the stats counter with the new operation reported.
/// This method should be called once **per operation**. It means that if transaction
/// for some operation was stuck, and another transaction was created for it, this method
/// **should not** be invoked.
///
/// This method expects the database to be initially prepared with inserting the actual
/// stats values. Currently the script `db-insert-eth-data.sh` is responsible for that
/// and it's invoked within `db-reset` subcommand.
Updates the stats counter with the new operation reported.
This method should be called once **per operation**. It means that if transaction
for some operation was stuck, and another transaction was created for it, this method
should not** be invoked.

This method expects the database to be initially prepared with inserting the actual
stats values. Currently the script `db-insert-eth-data.sh` is responsible for that
and it's invoked within `db-reset` subcommand.
Updates the stats counter with the new operation reported . This method should be called once ** per operation ** . It means that if transaction for some operation was stuck and another transaction was created for it this method should not ** be invoked . This method expects the database to be initially prepared with inserting the actual stats values . Currently the script ` db - insert - eth - data . sh ` is responsible for that and it ' s invoked within ` db - reset ` subcommand .
fn report_created_operation(&self, operation_type: OperationType) -> QueryResult<()> {
        self.0.conn().transaction(|| {
            let mut current_stats: ETHParams = eth_parameters::table.first(self.0.conn())?;
            // Increase the only one type of operations.
            match operation_type {
                OperationType::Commit => {
                    current_stats.commit_ops += 1;
                }
                OperationType::Verify => {
                    current_stats.verify_ops += 1;
                }
                OperationType::Withdraw => {
                    current_stats.withdraw_ops += 1;
                }
            };
            // Update the stored stats.
            update(eth_parameters::table.filter(eth_parameters::id.eq(true)))
                .set((
                    eth_parameters::commit_ops.eq(current_stats.commit_ops),
                    eth_parameters::verify_ops.eq(current_stats.verify_ops),
                    eth_parameters::withdraw_ops.eq(current_stats.withdraw_ops),
                ))
                .execute(self.0.conn())?;
            Ok(())
        })
    }
fn report_created_operation ( & self , operation_type : OperationType ) -> QueryResult < ( ) > { self . 0 . conn ( ) . transaction ( | | { let mut current_stats : ETHParams = eth_parameters :: table . first ( self . 0 . conn ( ) ) ? ; // Increase the only one type of operations. match operation_type { OperationType :: Commit => { current_stats . commit_ops += 1 ; } OperationType :: Verify => { current_stats . verify_ops += 1 ; } OperationType :: Withdraw => { current_stats . withdraw_ops += 1 ; } } ; // Update the stored stats. update ( eth_parameters :: table . filter ( eth_parameters :: id . eq ( true ) ) ) . set ( ( eth_parameters :: commit_ops . eq ( current_stats . commit_ops ) , eth_parameters :: verify_ops . eq ( current_stats . verify_ops ) , eth_parameters :: withdraw_ops . eq ( current_stats . withdraw_ops ) , ) ) . execute ( self . 0 . conn ( ) ) ? ; Ok ( ( ) ) } ) }
Updates the stats counter with the new operation reported.
Updates the stats counter with the new operation reported .
&self
operation_type
OperationType