Class: ZKSync::KeyStore

Inherits:
Object
  • Object
show all
Defined in:
lib/zksync/key_store.rb

Instance Method Summary collapse

Constructor Details

#initialize(root_key) ⇒ KeyStore

Returns a new instance of KeyStore.



20
21
22
# File 'lib/zksync/key_store.rb', line 20

def initialize(root_key)
  @root_key = root_key
end

Instance Method Details

#file_key(archive_path) ⇒ Object



32
33
34
# File 'lib/zksync/key_store.rb', line 32

def file_key(archive_path)
  fs_key.child_key(".file:#{archive_path}")
end

#fs_keyObject



28
29
30
# File 'lib/zksync/key_store.rb', line 28

def fs_key
  @fs_key ||= top_key.child_key(".fskey")
end

#page_key(archive_path, page_num, page_hash) ⇒ Object



36
37
38
# File 'lib/zksync/key_store.rb', line 36

def page_key(archive_path, page_num, page_hash)
  file_key(archive_path).child_key(".page:#{page_num}::#{page_hash}")
end

#top_keyObject



24
25
26
# File 'lib/zksync/key_store.rb', line 24

def top_key
  @top_key ||= @root_key.child_key(".topkey")
end