Class: KeyPair

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/sr25519_lib.rb

Instance Method Summary collapse

Instance Method Details

#public_keyObject

Return the keypair public key



23
24
25
26
27
28
# File 'lib/sr25519_lib.rb', line 23

def public_key
  pub_key = self[:String].to_a[64..96]
  public_key = PublicKey.new
  public_key[:String].to_ptr.write_array_of_uint8(pub_key)
  public_key
end

#to_sObject



30
31
32
# File 'lib/sr25519_lib.rb', line 30

def to_s
  self[:String].to_a.pack("c*").unpack1("H*")
end