forked from faker-ruby/faker
/
tezos.rb
32 lines (25 loc) · 865 Bytes
/
tezos.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true
require_relative '../../test_helper'
class TestFakerTezos < Test::Unit::TestCase
def test_contract
assert Faker::Blockchain::Tezos.contract.match(/^KT1[1-9A-Za-z][^OIl]{20,40}/)
end
def test_account
assert Faker::Blockchain::Tezos.account.match(/^tz1[1-9A-Za-z][^OIl]{20,40}/)
end
def test_operation
assert Faker::Blockchain::Tezos.operation.match(/^o[1-9A-Za-z][^OIl]{20,40}/)
end
def test_block
assert Faker::Tezos.block.match(/^B[1-9A-Za-z][^OIl]{20,40}/)
end
def test_signature
assert Faker::Blockchain::Tezos.signature.match(/^edsig[1-9A-Za-z][^OIl]{20,40}/)
end
def test_deterministic_contract
Faker::Config.random = Random.new(42)
v = Faker::Blockchain::Tezos.contract
Faker::Config.random = Random.new(42)
assert v == Faker::Blockchain::Tezos.contract
end
end