You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: locking.rb
    path of file: ./repos/double_entry/lib/double_entry
    
    the code of the file until where you have to start completion: # encoding: utf-8
module DoubleEntry
  # Lock financial accounts to e
    
      def perform_lock(&block)
        ensure_outermost_transaction!

        unless lock_and_call(&block)
          create_missing_account_balances
          fail LockDisaster unless lock_and_call(&block)
        end