Method: CLPublicKey.from_json

Defined in:
lib/types/cl_public_key.rb

.from_json(json) ⇒ Object



146
147
148
149
150
151
152
# File 'lib/types/cl_public_key.rb', line 146

def self.from_json(json)
  parsed = JSON.parse(json).deep_symbolize_keys
  bytes = Utils::Base16.decode16(parsed[:bytes])
  tag = bytes[0]
  raw_public_key = bytes[1..]
  CLPublicKey.new(raw_public_key, tag)
end