Skip to content

Commit

Permalink
Implement converting method from u5 to bitarray
Browse files Browse the repository at this point in the history
  • Loading branch information
johnta0 committed Mar 11, 2018
1 parent ef73959 commit 4cff4d4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 18 deletions.
39 changes: 21 additions & 18 deletions lib/bolt11/lnaddr.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
class LnAddr
attr_accessor :currency, :amount, :multiplier, :timestamp,
:pubkey, :signature, :short_description, :description,
:payment_hash, :description_hash, :expiry, :routing_info
module Bolt11
class LnAddr
attr_accessor :currency, :amount, :multiplier, :timestamp,
:pubkey, :signature, :short_description, :description,
:payment_hash, :description_hash, :expiry, :routing_info

def initialize
@currency = ""
@amount = nil
@multiplier = nil
@timestamp = nil
@unknown_tags = []
@payment_hash = nil
@pubkey = nil
@signature = nil
@short_description = nil
@description = nil
@description_hash = nil
@expiry = nil
@routing_info = nil
def initialize
@currency = ""
@amount = nil
@multiplier = nil
@timestamp = nil
@unknown_tags = []
@payment_hash = nil
@pubkey = nil
@signature = nil
@short_description = nil
@description = nil
@description_hash = nil
@expiry = nil
@fallback_addr = nil
@routing_info = []
end
end
end
13 changes: 13 additions & 0 deletions lib/bolt11/routing_info.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Bolt11
class RoutingInfo
attr_accessor :pubkey, :short_channel_id, :fee_base_msat, :fee_proportional_millionths, :cltv_expiry_delta

def initialize(pubkey, short_channel_id, fee_base_msat, fee_proportional_millionths, cltv_expiry_delta)
@pubkey = pubkey
@short_channel_id = short_channel_id
@fee_base_msat = fee_base_msat
@fee_proportional_millionths = fee_proportional_millionths
@cltv_expiry_delta = cltv_expiry_delta
end
end
end

0 comments on commit 4cff4d4

Please sign in to comment.