Class: Solace::Serializers::AddressLookupTableDeserializer

Inherits:
BaseDeserializer show all
Defined in:
lib/solace/serializers/address_lookup_table_deserializer.rb

Instance Attribute Summary

Attributes inherited from BaseDeserializer

#io, #record

Instance Method Summary collapse

Methods inherited from BaseDeserializer

#call, #initialize

Methods inherited from Base

call, #call

Constructor Details

This class inherits a constructor from Solace::Serializers::BaseDeserializer

Instance Method Details

#next_extract_accountString

Extract the account key from the transaction

The BufferLayout is:

- [Account key (32 bytes)]


33
34
35
# File 'lib/solace/serializers/address_lookup_table_deserializer.rb', line 33

def 
  record. = Codecs.bytes_to_base58 io.read(32).bytes
end

#next_extract_readonly_indexesArray<Integer>

Extract the readonly indexes from the transaction

The BufferLayout is:

- [Number of readonly indexes (compact u16)]
- [Readonly indexes (variable length u8)]


56
57
58
59
# File 'lib/solace/serializers/address_lookup_table_deserializer.rb', line 56

def next_extract_readonly_indexes
  length, = Codecs.decode_compact_u16(io)
  record.readonly_indexes = io.read(length).unpack('C*')
end

#next_extract_writable_indexesArray<Integer>

Extract the writable indexes from the transaction

The BufferLayout is:

- [Number of writable indexes (compact u16)]
- [Writable indexes (variable length u8)]


44
45
46
47
# File 'lib/solace/serializers/address_lookup_table_deserializer.rb', line 44

def next_extract_writable_indexes
  length, = Codecs.decode_compact_u16(io)
  record.writable_indexes = io.read(length).unpack('C*')
end