Class: Immudb::TxMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/immudb/tx_metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blRootObject

Returns the value of attribute blRoot.



15
16
17
# File 'lib/immudb/tx_metadata.rb', line 15

def blRoot
  @blRoot
end

#blTxIDObject

Returns the value of attribute blTxID.



15
16
17
# File 'lib/immudb/tx_metadata.rb', line 15

def blTxID
  @blTxID
end

#ehObject

Returns the value of attribute eh.



15
16
17
# File 'lib/immudb/tx_metadata.rb', line 15

def eh
  @eh
end

#iDObject

Returns the value of attribute iD.



15
16
17
# File 'lib/immudb/tx_metadata.rb', line 15

def iD
  @iD
end

#nEntriesObject

Returns the value of attribute nEntries.



15
16
17
# File 'lib/immudb/tx_metadata.rb', line 15

def nEntries
  @nEntries
end

#prevAlhObject

Returns the value of attribute prevAlh.



15
16
17
# File 'lib/immudb/tx_metadata.rb', line 15

def prevAlh
  @prevAlh
end

#tsObject

Returns the value of attribute ts.



15
16
17
# File 'lib/immudb/tx_metadata.rb', line 15

def ts
  @ts
end

Instance Method Details

#alhObject



17
18
19
20
21
22
23
24
# File 'lib/immudb/tx_metadata.rb', line 17

def alh
  bi = [@iD].pack("Q>") + @prevAlh
  bj = [@ts.to_i, @nEntries.to_i].pack("Q>L>")
  bj = bj + @eh + [@blTxID].pack("Q>") + @blRoot
  inner_hash = Digest::SHA256.digest(bj)
  bi = bi + inner_hash
  Digest::SHA256.digest(bi)
end

#bytesObject



26
27
28
# File 'lib/immudb/tx_metadata.rb', line 26

def bytes
  nil
end