Module: Peatio::Electrum::Hooks

Defined in:
lib/peatio/electrum/hooks.rb

Class Method Summary collapse

Class Method Details

.check_compatibilityObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/peatio/electrum/hooks.rb', line 5

def check_compatibility
  if Peatio::Blockchain::VERSION >= '2.0'
    [
      "Electrum plugin was designed for work with 1.x. Blockchain.",
      "You have #{Peatio::Electrum::Blockchain::VERSION}."
    ].join('\n').tap { |s| Kernel.abort s }
  end

  if Peatio::Wallet::VERSION >= '2.0'
    [
      "Electrum plugin was designed for work with 1.x. Wallet.",
      "You have #{Peatio::Electrum::Wallet::VERSION}."
    ].join('\n').tap { |s| Kernel.abort s }
  end
end

.registerObject



21
22
23
24
# File 'lib/peatio/electrum/hooks.rb', line 21

def register
  Peatio::Blockchain.registry[:Electrum] = Electrum::Blockchain
  Peatio::Wallet.registry[:Electrumd] = Electrum::Wallet
end