Class: Melos::Struct::ParentNode

Inherits:
Base
  • Object
show all
Defined in:
lib/melos/struct/structs.rb

Overview

7.1

Constant Summary collapse

STRUCT =
[
  [:encryption_key, :vec], # HPKEPublicKey = opaque <V>
  [:parent_hash, :vec],
  [:unmerged_leaves, :vec_of_type, :uint32] # becomes a vec of uint32
]

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Base

#deserialize_select_elem_with_context, #initialize, #raw

Constructor Details

This class inherits a constructor from Melos::Struct::Base

Instance Attribute Details

#encryption_keyObject (readonly)

Returns the value of attribute encryption_key.



60
61
62
# File 'lib/melos/struct/structs.rb', line 60

def encryption_key
  @encryption_key
end

#parent_hashObject (readonly)

Returns the value of attribute parent_hash.



60
61
62
# File 'lib/melos/struct/structs.rb', line 60

def parent_hash
  @parent_hash
end

#unmerged_leavesObject (readonly)

Returns the value of attribute unmerged_leaves.



60
61
62
# File 'lib/melos/struct/structs.rb', line 60

def unmerged_leaves
  @unmerged_leaves
end

Class Method Details

.create(encryption_key:, parent_hash:, unmerged_leaves:) ⇒ Object



67
68
69
70
71
72
73
# File 'lib/melos/struct/structs.rb', line 67

def self.create(encryption_key:, parent_hash:, unmerged_leaves:)
  new_instance = self.allocate
  new_instance.instance_variable_set(:@encryption_key, encryption_key)
  new_instance.instance_variable_set(:@parent_hash, parent_hash)
  new_instance.instance_variable_set(:@unmerged_leaves, unmerged_leaves)
  new_instance
end