Sha256: 0a01759df52a0a24805b0c67c8aa7e63ce7062aaffc480266e4b5bce178df64a

Contents?: true

Size: 414 Bytes

Versions: 7

Compression:

Stored size: 414 Bytes

Contents

# frozen_string_literal: true

module Lightning
  module Onion
    module FailureMessages
      module InvalidOnionVersion
        def to_payload
          [type_code, sha256_of_onion.htb.bytesize].pack('nn') + sha256_of_onion.htb
        end

        def self.load(payload)
          type_code, len, rest = payload.unpack('nnH*')
          new(type_code, rest[0..len * 2])
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lightning-onion-0.2.6 lib/lightning/onion/failure_messages/invalid_onion_version.rb
lightning-onion-0.2.5 lib/lightning/onion/failure_messages/invalid_onion_version.rb
lightning-onion-0.2.4 lib/lightning/onion/failure_messages/invalid_onion_version.rb
lightning-onion-0.2.3 lib/lightning/onion/failure_messages/invalid_onion_version.rb
lightning-onion-0.2.2 lib/lightning/onion/failure_messages/invalid_onion_version.rb
lightning-onion-0.2.1 lib/lightning/onion/failure_messages/invalid_onion_version.rb
lightning-onion-0.2.0 lib/lightning/onion/failure_messages/invalid_onion_version.rb