Class: Faker::Blockchain::Tezos

Inherits:
Faker::Base show all
Defined in:
lib/faker/blockchain/tezos.rb

Constant Summary collapse

PREFIXES =
{
  tz1: [6, 161, 159],
  KT1: [2, 90, 121],
  edpk: [13, 15, 37, 217],
  edsk: [13, 15, 58, 7],
  edsig: [9, 245, 205, 134, 18],
  B: [1, 52],
  o: [5, 116]
}.freeze

Constants inherited from Faker::Base

Faker::Base::LLetters, Faker::Base::Letters, Faker::Base::NOT_GIVEN, Faker::Base::Numbers, Faker::Base::ULetters

Class Method Summary collapse

Methods inherited from Faker::Base

bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, generate, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, translate, unique, with_locale

Class Method Details

.accountString

Produces a random Tezos account address

Examples:

Faker::Blockchain::Tezos.
  #=> "tz1eUsgK6aj752Fbxwk5sAoEFvSDnPjZ4qvk"

Returns:



31
32
33
# File 'lib/faker/blockchain/tezos.rb', line 31

def 
  encode_tz(:tz1, 20)
end

.blockString

Produces a random Tezos block

Examples:

Faker::Blockchain::Tezos.block
  #=> "BMbhs2rkY1dvAkAyRytvPsjFQ2RiPrBhYkxvWpY65dzkdSuw58a"

Returns:



73
74
75
# File 'lib/faker/blockchain/tezos.rb', line 73

def block
  encode_tz(:B, 32)
end

.contractString

Produces a random Tezos contract

Examples:

Faker::Blockchain::Tezos.contract
  #=> "KT1MroqeP15nnitB4CnNfkqHYa2NErhPPLWF"

Returns:



45
46
47
# File 'lib/faker/blockchain/tezos.rb', line 45

def contract
  encode_tz(:KT1, 20)
end

.operationString

Produces a random Tezos operation

Examples:

Faker::Blockchain::Tezos.operation
  #=> "onygWYXJX3xNstFLv9PcCrhQdCkENC795xwSinmTEc1jsDN4VDa"

Returns:



59
60
61
# File 'lib/faker/blockchain/tezos.rb', line 59

def operation
  encode_tz(:o, 32)
end

.public_keyString

Produces a random Tezos public key

Examples:

Faker::Blockchain::Tezos.public_key
  #=> "edpkuib9x8QXRc5nWwHUg7U1dXsVmaUrUNU5sX9pVEEvwbMVdfMCeq"

Returns:



101
102
103
# File 'lib/faker/blockchain/tezos.rb', line 101

def public_key
  encode_tz(:edpk, 32)
end

.secret_keyString

Produces a random Tezos public key

Examples:

Faker::Blockchain::Tezos.secret_key
  #=> "edsk3HZCAGEGpzQPnQUwQeFY4ESanFhQCgLpKriQw8GHyhKCrjHawv"

Returns:



115
116
117
# File 'lib/faker/blockchain/tezos.rb', line 115

def secret_key
  encode_tz(:edsk, 32)
end

.signatureString

Produces a random Tezos signature

Examples:

Faker::Blockchain::Tezos.signature
  #=> "edsigu165B7VFf3Dpw2QABVzEtCxJY2gsNBNcE3Ti7rRxtDUjqTFRpg67EdAQmY6YWPE5tKJDMnSTJDFu65gic8uLjbW2YwGvAZ"

Returns:



87
88
89
# File 'lib/faker/blockchain/tezos.rb', line 87

def signature
  encode_tz(:edsig, 64)
end