Method: Multichain::CLI#verify

Defined in:
lib/multichain/cli.rb

#verify(hex) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/multichain/cli.rb', line 24

def verify hex
  url = Encoder.extract(Encoder.dehexify(hex))[:url]
  v = Encoder.verify hex

  case v
    when true
      puts "The URL '#{url}' is verified"
      exit 0 unless ENV['TEST']

    when false
      puts "The URL '#{url}' is not verified"
      exit 1 unless ENV['TEST']
  end
end