module Peatio::Decredcoin::Hooks

Constants

BLOCKCHAIN_VERSION_REQUIREMENT
WALLET_VERSION_REQUIREMENT

Public Class Methods

check_compatibility() click to toggle source
# File lib/peatio/decredcoin/hooks.rb, line 8
def check_compatibility
  unless Gem::Requirement.new(BLOCKCHAIN_VERSION_REQUIREMENT)
             .satisfied_by?(Gem::Version.new(Peatio::Blockchain::VERSION))
    [
        "Decred-Coin blockchain version requirement was not suttisfied by Peatio::Blockchain.",
        "Decred-Coin 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))
    [
        "Decred-Coin wallet version requirement was not satisfied by Peatio::Wallet.",
        "Decred-Coin wallet requires #{WALLET_VERSION_REQUIREMENT}.",
        "Peatio::Wallet version is #{Peatio::Wallet::VERSION}"
    ].join('\n').tap { |s| Kernel.abort s }
  end
end
register() click to toggle source
# File lib/peatio/decredcoin/hooks.rb, line 28
def register
  Peatio::Blockchain.registry[:decredcoin] = Decredcoin::Blockchain
  Peatio::Wallet.registry[:decredcoind] = Decredcoin::Wallet
end