lib/sp_store/mocks/hash_storage.rb
# Calls empty_store_without_hash
# Then initializes disk hash tree and stores into disk
#
Calls empty_store_without_hash
Then initializes disk hash tree and stores into disk
Calls empty_store_without_hash Then initializes disk hash tree and stores into disk
def empty_store( block_size, block_count, disk_directory )
      store     = empty_store_without_hash( block_size, block_count, disk_directory )
      empty_block_hash = SpStore::Crypto.crypto_hash empty_block(block_size)
      File.open( File.join( disk_path(disk_directory), 'disk_hashes' ), 'wb') do |file|
        (0...block_count).each { file.write empty_block_hash }
      end   
      store
    end
def empty_store ( block_size , block_count , disk_directory ) store = empty_store_without_hash ( block_size , block_count , disk_directory ) empty_block_hash = SpStore :: Crypto . crypto_hash empty_block ( block_size ) File . open ( File . join ( disk_path ( disk_directory ) , 'disk_hashes' ) , 'wb' ) do | file | ( 0 ... block_count ) . each { file . write empty_block_hash } end store end
Calls empty_store_without_hash
Then initializes disk hash tree and stores into disk
Calls empty_store_without_hash Then initializes disk hash tree and stores into disk
#initialize disk hash
block_size
block_count
disk_directory