class Faker::Blockchain::Tezos
Constants
- PREFIXES
-
@private
Public Class Methods
Source
# File lib/faker/blockchain/tezos.rb, line 31 def account encode_tz(:tz1, 20) end
Produces a random Tezos
account address
@return [String]
@example
Faker::Blockchain::Tezos.account #=> "tz1eUsgK6aj752Fbxwk5sAoEFvSDnPjZ4qvk"
@faker.version 1.9.2
Source
# File lib/faker/blockchain/tezos.rb, line 73 def block encode_tz(:B, 32) end
Produces a random Tezos
block
@return [String]
@example
Faker::Blockchain::Tezos.block #=> "BMbhs2rkY1dvAkAyRytvPsjFQ2RiPrBhYkxvWpY65dzkdSuw58a"
@faker.version 1.9.4
Source
# File lib/faker/blockchain/tezos.rb, line 45 def contract encode_tz(:KT1, 20) end
Produces a random Tezos
contract
@return [String]
@example
Faker::Blockchain::Tezos.contract #=> "KT1MroqeP15nnitB4CnNfkqHYa2NErhPPLWF"
@faker.version 1.9.2
Source
# File lib/faker/blockchain/tezos.rb, line 59 def operation encode_tz(:o, 32) end
Produces a random Tezos
operation
@return [String]
@example
Faker::Blockchain::Tezos.operation #=> "onygWYXJX3xNstFLv9PcCrhQdCkENC795xwSinmTEc1jsDN4VDa"
@faker.version 1.9.2
Source
# File lib/faker/blockchain/tezos.rb, line 101 def public_key encode_tz(:edpk, 32) end
Produces a random Tezos
public key
@return [String]
@example
Faker::Blockchain::Tezos.public_key #=> "edpkuib9x8QXRc5nWwHUg7U1dXsVmaUrUNU5sX9pVEEvwbMVdfMCeq"
@faker.version 2.15.2
Source
# File lib/faker/blockchain/tezos.rb, line 115 def secret_key encode_tz(:edsk, 32) end
Produces a random Tezos
public key
@return [String]
@example
Faker::Blockchain::Tezos.secret_key #=> "edsk3HZCAGEGpzQPnQUwQeFY4ESanFhQCgLpKriQw8GHyhKCrjHawv"
@faker.version 2.15.2
Source
# File lib/faker/blockchain/tezos.rb, line 87 def signature encode_tz(:edsig, 64) end
Produces a random Tezos
signature
@return [String]
@example
Faker::Blockchain::Tezos.signature #=> "edsigu165B7VFf3Dpw2QABVzEtCxJY2gsNBNcE3Ti7rRxtDUjqTFRpg67EdAQmY6YWPE5tKJDMnSTJDFu65gic8uLjbW2YwGvAZ"
@faker.version 1.9.2
Protected Class Methods
Source
# File lib/faker/blockchain/tezos.rb, line 126 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
@param prefix [Symbol] @param payload_size [Integer] The size of the payload
@return [String]