Module: Peatio::Dash::Hooks

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

Constant Summary collapse

BLOCKCHAIN_VERSION_REQUIREMENT =
"~> 1.0.0"
WALLET_VERSION_REQUIREMENT =
"~> 1.0.0"

Class Method Summary collapse

Class Method Details

.check_compatibilityObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/peatio/dash/hooks.rb', line 10

def check_compatibility
  unless Gem::Requirement.new(BLOCKCHAIN_VERSION_REQUIREMENT)
                         .satisfied_by?(Gem::Version.new(Peatio::Blockchain::VERSION))
    [
      "Dash blockchain version requiremnt was not suttisfied by Peatio::Blockchain.",
      "Dash blockchain requires #{BLOCKCHAIN_VERSION_REQUIREMENT}.",
      "Peatio::Blockchain version is #{Peatio::Blockchain::VERSION}"
    ].join('\n').tap {|s| Kernel.abort s }
  end

  unless Gem::Requirement.new(WALLET_VERSION_REQUIREMENT)
                         .satisfied_by?(Gem::Version.new(Peatio::Wallet::VERSION))
    [
      "Dash wallet version requiremnt was not suttisfied by Peatio::Wallet.",
      "Dash wallet requires #{WALLET_VERSION_REQUIREMENT}.",
      "Peatio::Wallet version is #{Peatio::Wallet::VERSION}"
    ].join('\n').tap {|s| Kernel.abort s }
  end
end

.registerObject



30
31
32
33
# File 'lib/peatio/dash/hooks.rb', line 30

def register
  Peatio::Blockchain.registry[:dash] = Dash::Blockchain
  Peatio::Wallet.registry[:dashd] = Dash::Wallet
end