Class: Solace::Serializers::AddressLookupTableDeserializer
- Inherits:
-
BaseDeserializer
- Object
- BaseDeserializer
- Solace::Serializers::AddressLookupTableDeserializer
- Defined in:
- lib/solace/serializers/address_lookup_table_deserializer.rb
Overview
Deserializes a Solana address lookup table from a binary format.
Instance Attribute Summary
Attributes inherited from BaseDeserializer
Instance Method Summary collapse
-
#next_extract_account ⇒ String
Extract the account key from the transaction.
-
#next_extract_readonly_indexes ⇒ Array<Integer>
Extract the readonly indexes from the transaction.
-
#next_extract_writable_indexes ⇒ Array<Integer>
Extract the writable indexes from the transaction.
Methods inherited from BaseDeserializer
Constructor Details
This class inherits a constructor from Solace::Serializers::BaseDeserializer
Instance Method Details
#next_extract_account ⇒ String
Extract the account key from the transaction
The BufferLayout is:
- [Account key (32 bytes)]
31 32 33 |
# File 'lib/solace/serializers/address_lookup_table_deserializer.rb', line 31 def next_extract_account record.account = Codecs.bytes_to_base58 io.read(32).bytes end |
#next_extract_readonly_indexes ⇒ Array<Integer>
Extract the readonly indexes from the transaction
The BufferLayout is:
- [Number of readonly indexes (compact u16)]
- [Readonly indexes (variable length u8)]
54 55 56 57 |
# File 'lib/solace/serializers/address_lookup_table_deserializer.rb', line 54 def next_extract_readonly_indexes length, = Codecs.decode_compact_u16(io) record.readonly_indexes = io.read(length).unpack('C*') end |
#next_extract_writable_indexes ⇒ Array<Integer>
Extract the writable indexes from the transaction
The BufferLayout is:
- [Number of writable indexes (compact u16)]
- [Writable indexes (variable length u8)]
42 43 44 45 |
# File 'lib/solace/serializers/address_lookup_table_deserializer.rb', line 42 def next_extract_writable_indexes length, = Codecs.decode_compact_u16(io) record.writable_indexes = io.read(length).unpack('C*') end |