Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Change log itself follows [Keep a CHANGELOG](http://keepachangelog.com) format.
* Added: Support for `Armenian Language` [[@hovikman][]]
* Added: `Faker.Vehicle` [[@daytonn][]]
* Added: Elixir 1.9 support [[@igas][]]
* Added: `Faker.BlockChain.CryptoCoin` [[@thadeubrito][]]

### Changed

Expand Down Expand Up @@ -317,6 +318,7 @@ Change log itself follows [Keep a CHANGELOG](http://keepachangelog.com) format.
[@sotojuan]: https://github.com/sotojuan
[@stfnsr]: https://github.com/stfnsr
[@tbash]: https://github.com/tbash
[@thadeubrito]: https://github.com/thadeubrito
[@theabrad]: https://github.com/theabrad
[@tobyhinloopen]: https://github.com/tobyhinloopen
[@vbrazo]: https://github.com/vbrazo
Expand Down
1 change: 1 addition & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [Faker.Beer](lib/faker/beer.ex)
- [Faker.Beer.En](lib/faker/beer/en.ex)
- [Faker.Blockchain.Bitcoin](lib/faker/bitcoin.ex)
- [Faker.BlockChain.CryptoCoin](lib/faker/blockchain/crypto_coin.ex)

@vbrazo vbrazo Jul 10, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be Faker.Blockchain instead.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thadeubrito could you make this change?

<!-- C -->
- [Faker.Cat](lib/faker/cat.ex)
- [Faker.Cat.En](lib/faker/cat/en.ex)
Expand Down
125 changes: 125 additions & 0 deletions lib/faker/blockchain/crypto_coin.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
defmodule Faker.BlockChain.CryptoCoin do
import Faker, only: [sampler: 2]

@moduledoc """
Functions for generating Crypto Coin names, acronym and url_logo
"""

@doc """
Return a random Crypto Coin name

## Examples

iex> Faker.BlockChain.CryptoCoin.name()
"Dash"
iex> Faker.BlockChain.CryptoCoin.name()
"Bitcoin Gold"
iex> Faker.BlockChain.CryptoCoin.name()
"Bitcoin"
iex> Faker.BlockChain.CryptoCoin.name()
"Cardano"
"""
@spec name() :: String.t()
sampler(:name, [
"Bitcoin",
"Bitcoin Cash",
"Bitcoin Gold",
"Bitcoin SV",
"Binance Coin",
"Cardano",
"Dash",
"Decred",
"EOS.IO",
"Ethereum",
"Ethereum Classic",
"IOTA",
"Litecoin",
"Monero",
"NEM",
"NEO",
"Ripple",
"Stellar",
"Tether",
"TRON",
"Zcash"
])

@doc """
Return a random Crypto Coin acronym

## Examples

iex> Faker.BlockChain.CryptoCoin.acronym()
"DASH"
iex> Faker.BlockChain.CryptoCoin.acronym()
"BTG"
iex> Faker.BlockChain.CryptoCoin.acronym()
"BTC"
iex> Faker.BlockChain.CryptoCoin.acronym()
"ADA"
"""

@spec acronym() :: String.t()
sampler(:acronym, [
"BTC",
"BCC",
"BTG",
"BSV",
"BNB",
"ADA",
"DASH",
"DCR",
"EOS",
"ETH",
"ETC",
"IOT",
"LTC",
"XMR",
"XEM",
"NEO",
"XRP",
"XLM",
"USDT",
"TRX",
"ZEC"
])

@doc """
Return a random Crypto Coin url_logo

## Examples

iex> Faker.BlockChain.CryptoCoin.url_logo()
"https://i.imgur.com/2uX91cb.png"
iex> Faker.BlockChain.CryptoCoin.url_logo()
"https://i.imgur.com/l9cVE7c.png"
iex> Faker.BlockChain.CryptoCoin.url_logo()
"https://i.imgur.com/psBNOBq.png"
iex> Faker.BlockChain.CryptoCoin.url_logo()
"https://i.imgur.com/8qGU4zg.png"
"""
@spec url_logo() :: String.t()
sampler(:url_logo, [
"https://i.imgur.com/psBNOBq.png",
"https://i.imgur.com/ViTjr9u.png",
"https://i.imgur.com/l9cVE7c.png",
"https://i.imgur.com/DkixrAc.png",
"https://i.imgur.com/2HJr7OR.png",
"https://i.imgur.com/8qGU4zg.png",
"https://i.imgur.com/2uX91cb.png",
"https://i.imgur.com/nURXAC2.png",
"https://i.imgur.com/Cr2w77s.png",
"https://i.imgur.com/uOPFCXj.png",
"https://i.imgur.com/8wBtmQA.png",
"https://i.imgur.com/DGFCOVt.png",
"https://i.imgur.com/EFz61Ei.png",
"https://i.imgur.com/pnupcJM.png",
"https://i.imgur.com/SJ8NteF.png",
"https://i.imgur.com/BmtVrJi.png",
"https://i.imgur.com/GjAPSsL.png",
"https://i.imgur.com/COLIHUE.png",
"https://i.imgur.com/xk6pQZy.png",
"https://i.imgur.com/grG05ZK.png",
"https://i.imgur.com/mX3r4j9.png"
])
end
5 changes: 5 additions & 0 deletions test/faker/blockchain/crypto_coin_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
defmodule Faker.BlockChain.CryptoCoinTest do
use ExUnit.Case, async: true

doctest Faker.BlockChain.CryptoCoin
end