class Faker::Blockchain::Tezos

def account

Returns:
  • (String) -
def account
  encode_tz(:tz1, 20)
end

def block

Returns:
  • (String) -
def block
  encode_tz(:B, 32)
end

def contract

Returns:
  • (String) -
def contract
  encode_tz(:KT1, 20)
end

def encode_tz(prefix, payload_size)

Returns:
  • (String) -

Parameters:
  • payload_size (Integer) -- The size of the payload
  • prefix (Symbol) --
def encode_tz(prefix, payload_size)
  prefix = PREFIXES.fetch(prefix)
  packed = prefix.map(&:chr).join + Faker::Config.random.bytes(payload_size)
  checksum = OpenSSL::Digest::SHA256.digest(OpenSSL::Digest::SHA256.digest(packed))[0..3]
  Faker::Base58.encode(packed + checksum)
end

def operation

Returns:
  • (String) -
def operation
  encode_tz(:o, 32)
end

def public_key

Returns:
  • (String) -
def public_key
  encode_tz(:edpk, 32)
end

def secret_key

Returns:
  • (String) -
def secret_key
  encode_tz(:edsk, 32)
end

def signature

Returns:
  • (String) -
def signature
  encode_tz(:edsig, 64)
end