diff --git a/bin/check_electrum_wallet_completeness b/bin/check_electrum_wallet_completeness index bfe12b5b97a3e5fc0ad04dbbd145236e78b7626c..4500ad70bc17f7ea01592d8eb766ecab8c441fad 100755 --- a/bin/check_electrum_wallet_completeness +++ b/bin/check_electrum_wallet_completeness @@ -1,10 +1,10 @@ #!/usr/bin/ruby # frozen_string_literal: true -require 'redis' -require 'dhall' -require_relative '../lib/redis_addresses' -require_relative '../lib/electrum' +require "redis" +require "dhall" +require_relative "../lib/redis_addresses" +require_relative "../lib/electrum" config = Dhall::Coder @@ -18,6 +18,7 @@ electrum_addrs = electrum.listaddresses get_addresses_with_users(redis).each do |addr, keys| unless electrum_addrs.include?(addr) - puts "The address #{addr} (included in #{keys.join(", ")}) isn't included in electrum's list" + puts "The address #{addr} (included in #{keys.join(', ')}) "\ + "isn't included in electrum's list" end end diff --git a/bin/correct_duplicate_addrs b/bin/correct_duplicate_addrs index 3911ef7cb7f1740df3ea1f51688ce163005ed537..4bb8bfa182fc8ba57de46bcdff9f13ec2c61bb2d 100755 --- a/bin/correct_duplicate_addrs +++ b/bin/correct_duplicate_addrs @@ -6,17 +6,19 @@ # run this after looking into why # Theoretically they could be piped together directly for automated fixing -require 'redis' +require "redis" redis = Redis.new -customer_id = ENV['DEFAULT_CUSTOMER_ID'] +customer_id = ENV["DEFAULT_CUSTOMER_ID"] unless customer_id - puts "The env-var DEFAULT_CUSTOMER_ID must be set to the ID of the customer who will receive the duplicated addrs, preferably a support customer or something linked to notifications when stray money is sent to these addresses" + puts "The env-var DEFAULT_CUSTOMER_ID must be set to the ID of the customer "\ + "who will receive the duplicated addrs, preferably a support customer or "\ + "something linked to notifications when stray money is sent to these "\ + "addresses" exit 1 end - STDIN.each_line do |line| match = line.match(/^(\w+) is used by the following \d+ keys: (.*)/) unless match diff --git a/bin/detect_duplicate_addrs b/bin/detect_duplicate_addrs index c68e5e5731cb8102d36974dbf2b61c9e09e247ae..4f47d3445ed96879be0bcc140bccc86bea7e2efe 100755 --- a/bin/detect_duplicate_addrs +++ b/bin/detect_duplicate_addrs @@ -1,13 +1,13 @@ #!/usr/bin/ruby # frozen_string_literal: true -require 'redis' -require_relative '../lib/redis_addresses' +require "redis" +require_relative "../lib/redis_addresses" redis = Redis.new get_addresses_with_users(redis).each do |addr, keys| if keys.length > 1 - puts "#{addr} is used by the following #{keys.length} keys: #{keys.join(" ")}" + puts "#{addr} is used by the following #{keys.length} keys: #{keys.join(' ')}" end end diff --git a/bin/reassert_electrum_notification b/bin/reassert_electrum_notification index af398eb8d4b4b6797732bf72fea971e6dacdb285..4b3d4f82ba3733320ab45c45a842e20f90bbcc1d 100755 --- a/bin/reassert_electrum_notification +++ b/bin/reassert_electrum_notification @@ -1,10 +1,10 @@ #!/usr/bin/ruby # frozen_string_literal: true -require 'redis' -require 'dhall' -require_relative '../lib/redis_addresses' -require_relative '../lib/electrum' +require "redis" +require "dhall" +require_relative "../lib/redis_addresses" +require_relative "../lib/electrum" config = Dhall::Coder @@ -22,7 +22,8 @@ get_addresses_with_users(redis).each do |addr, keys| end customer_id = match[1] - url = "https://pay.jmp.chat/electrum_notify?address=#{addr}&customer_id=#{customer_id}" + url = "https://pay.jmp.chat/electrum_notify?"\ + "address=#{addr}&customer_id=#{customer_id}" unless electrum.notify(addr, url) puts "Failed to setup #{addr} to notify #{url}. Skipping"