├── app └── .gitkeep ├── ui ├── .gitkeep └── README.md ├── child_chain └── .gitkeep ├── state_channel ├── .gitkeep └── StateChannel.v.py ├── .gitignore ├── research ├── README.md ├── articles.md ├── tournament_issues.md └── encryption.md ├── p2p ├── Cargo.toml ├── src │ └── lib.rs └── Cargo.lock ├── game ├── README.md ├── Cargo.toml ├── src │ ├── game_types │ │ └── mod.rs │ ├── deck │ │ ├── test.rs │ │ └── mod.rs │ ├── table │ │ ├── dealer.rs │ │ ├── mod.rs │ │ └── test.rs │ ├── card │ │ ├── suit.rs │ │ ├── mod.rs │ │ └── test.rs │ ├── main.rs │ ├── player │ │ └── mod.rs │ ├── hand │ │ ├── mod.rs │ │ └── test.rs │ └── rankings │ │ └── mod.rs └── Cargo.lock ├── development.env ├── parent_chain ├── project.json ├── contracts │ ├── Greeter.sol │ └── Cashier.v.py ├── tests │ └── test_greeter.py ├── requirements-dev.txt └── .gitignore ├── .travis.yml └── README.md /app/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /child_chain/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /state_channel/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/README.md: -------------------------------------------------------------------------------- 1 | Unity 2D Framework 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | *.swp 3 | 4 | *.env 5 | !development.env 6 | -------------------------------------------------------------------------------- /research/README.md: -------------------------------------------------------------------------------- 1 | Contains all the shit I need to figure out 2 | -------------------------------------------------------------------------------- /state_channel/StateChannel.v.py: -------------------------------------------------------------------------------- 1 | participants: address 2 | 3 | @public 4 | def startChannel(): 5 | self.participants = msg.sender 6 | -------------------------------------------------------------------------------- /p2p/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "p2p" 3 | version = "0.1.0" 4 | authors = ["Deon "] 5 | 6 | [dependencies] 7 | crust = "0.30.1" 8 | -------------------------------------------------------------------------------- /game/README.md: -------------------------------------------------------------------------------- 1 | ## Poker Game Implementation 2 | 3 | ### Game Types 4 | [ ] Texas Holdem 5 | [ ] Omaha 6 | [ ] Omaha Hi/Lo 7 | [ ] Stud 8 | [ ] Razz 9 | 10 | 11 | -------------------------------------------------------------------------------- /game/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "poker" 3 | version = "0.1.0" 4 | authors = ["Deon "] 5 | 6 | [dependencies] 7 | rand = "0.3.18" 8 | dotenv = "0.13.0" 9 | -------------------------------------------------------------------------------- /research/articles.md: -------------------------------------------------------------------------------- 1 | [virtue poker](https://virtue.poker/public/Virtue-Poker-White-Paper-0.9.pdf) 2 | [mental poker](https://www.cs.purdue.edu/homes/ninghui/readings/Qual2/Goldwasser-Micali82.pdf) 3 | -------------------------------------------------------------------------------- /game/src/game_types/mod.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | 3 | #[derive(Debug, PartialEq, Eq)] 4 | pub enum GameTypes { 5 | TexasHoldem, 6 | Omaha, 7 | OmahaHiLo, 8 | Stud, 9 | Razz 10 | } 11 | -------------------------------------------------------------------------------- /development.env: -------------------------------------------------------------------------------- 1 | HOST_NAME=127.0.0.1 # 0.0.0.0 2 | POKER_RPC_PORT=http://localhost:8545 3 | POKER_WS_PORT=ws://localhost:8546 4 | STATE_CHANNEL_PORT=36610 5 | PLASMA_PORT=36611 6 | POKER_APP_PORT=36612 7 | POKER_GAME_PORT=36613 8 | -------------------------------------------------------------------------------- /p2p/src/lib.rs: -------------------------------------------------------------------------------- 1 | extern crate crust; 2 | 3 | use crust::{Config, ConnectionInfoResult, Uid}; 4 | 5 | #[cfg(test)] 6 | mod tests { 7 | #[test] 8 | fn it_works() { 9 | assert_eq!(2 + 2, 4); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /parent_chain/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "8", 3 | "compilation": { 4 | "contracts_source_dirs": ["./contracts"], 5 | "import_remappings": [], 6 | "backend": { 7 | "class": "populus.compilation.backends.VyperBackend" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | os: linux 2 | dist: trusty 3 | sudo: required 4 | language: rust 5 | rust: 6 | - stable 7 | - beta 8 | - nightly 9 | matrix: 10 | allow_failures: 11 | - rust: nightly 12 | fast_finish: true 13 | cache: cargo 14 | script: 15 | - cd game 16 | - cargo build --verbose --all 17 | - cargo test --verbose --all 18 | -------------------------------------------------------------------------------- /game/src/deck/test.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | use super::*; 4 | use deck::*; 5 | use card; 6 | 7 | #[test] 8 | fn should_have_52_cards() { 9 | } 10 | 11 | #[test] 12 | fn should_be_able_to_use_global_cards() { 13 | let cards: Vec = card::create(); 14 | let card_ref = card::allocate(&cards); 15 | let deck: &[&Card] = &card_ref[..]; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /parent_chain/contracts/Greeter.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.0; 2 | 3 | contract Greeter { 4 | string public greeting; 5 | 6 | // TODO: Populus seems to get no bytecode if `internal` 7 | function Greeter() public { 8 | greeting = 'Hello'; 9 | } 10 | 11 | function setGreeting(string _greeting) public { 12 | greeting = _greeting; 13 | } 14 | 15 | function greet() public constant returns (string) { 16 | return greeting; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /parent_chain/tests/test_greeter.py: -------------------------------------------------------------------------------- 1 | def test_greeter(chain): 2 | greeter, _ = chain.provider.get_or_deploy_contract('Greeter') 3 | 4 | greeting = greeter.call().greet() 5 | assert greeting == 'Hello' 6 | 7 | 8 | def test_custom_greeting(chain): 9 | greeter, _ = chain.provider.get_or_deploy_contract('Greeter') 10 | 11 | set_txn_hash = greeter.transact().setGreeting('Guten Tag') 12 | chain.wait.for_receipt(set_txn_hash) 13 | 14 | greeting = greeter.call().greet() 15 | assert greeting == 'Guten Tag' 16 | -------------------------------------------------------------------------------- /game/src/table/dealer.rs: -------------------------------------------------------------------------------- 1 | use game_types::GameTypes; 2 | use table::{Table}; 3 | 4 | pub trait Deal { 5 | fn deal(&mut self); 6 | fn show_flop(&mut self); 7 | } 8 | 9 | 10 | impl<'a, 'b> Deal for Table<'a, 'b> { 11 | fn deal(&mut self) { 12 | unimplemented!() 13 | } 14 | 15 | fn show_flop(&mut self) { 16 | println!("{:?}", self.deck); 17 | let card = self.deck.remove(1); 18 | self.board.push(card); 19 | let game_type = &self.game; 20 | self.round = self.round + 1; 21 | println!("{:?}", game_type); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /game/src/card/suit.rs: -------------------------------------------------------------------------------- 1 | use std::slice::Iter; 2 | 3 | #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)] 4 | pub enum Suit { 5 | Spades, 6 | Diamonds, 7 | Clubs, 8 | Hearts, 9 | } 10 | 11 | pub static SUITS: [Suit; 4] = [Suit::Spades, Suit::Diamonds, Suit::Clubs, Suit::Hearts]; 12 | 13 | impl Suit { 14 | pub fn iter() -> Iter<'static, Suit> { 15 | SUITS.into_iter() 16 | } 17 | 18 | pub fn get_suit(item: Suit) -> Suit { 19 | match item { 20 | Suit::Spades => Suit::Spades, 21 | Suit::Diamonds => Suit::Diamonds, 22 | Suit::Hearts => Suit::Hearts, 23 | Suit::Clubs => Suit::Clubs, 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /game/src/main.rs: -------------------------------------------------------------------------------- 1 | extern crate dotenv; 2 | 3 | use dotenv::dotenv; 4 | use std::env; 5 | 6 | 7 | extern crate rand; 8 | 9 | mod card; 10 | mod player; 11 | mod deck; 12 | mod table; 13 | mod hand; 14 | mod rankings; 15 | mod game_types; 16 | 17 | use card::{Card, create as create_cards, allocate}; 18 | use deck::{Deck}; 19 | use card::{suit::Suit}; 20 | use rand::{thread_rng, Rng}; 21 | use std::{thread, time}; 22 | 23 | pub fn main() { 24 | let cards: Vec = create_cards(); 25 | let deck = allocate(&cards); 26 | thread::spawn(|| { 27 | for i in 1..10 { 28 | let deck: Vec = Deck::new(); 29 | } 30 | }); 31 | 32 | let ten_millis = time::Duration::from_millis(10); 33 | let now = time::Instant::now(); 34 | 35 | thread::sleep(ten_millis); 36 | } 37 | 38 | #[cfg(test)] 39 | mod tests { 40 | #[test] 41 | fn it_works() { 42 | assert_eq!(2 + 2, 4); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /research/tournament_issues.md: -------------------------------------------------------------------------------- 1 | ## Problems with Decentralized Tournaments 2 | 3 | 1. [Sybil Attack](#sybil-attack) 4 | 2. [Table Reorganization](#table-reorg) 5 | 3. [Table Shards](#shards) 6 | 7 | ## Sybil Attack 8 | 9 | Any user is able to have unlimited entries in tournaments due to ability to create inifite addresses, and participate in tournaments. Which could give unfair advantage as one person has more chances to win than someone else. 10 | 11 | Proof-of-Identity could be useful but would come at its own costs 12 | 13 | ## Table Re-organizations 14 | - [] How do members reach consensus that a table needs to be broken up and merge with other tables? 15 | - [] Who controls the randomness of choosing who goes to which table 16 | - [] Does tournament need a central entity 17 | 18 | ## Table Shars 19 | Tables need to be ran in unison but seperately, probably similar to current sharding implementations on ethereum mainchain 20 | 21 | Only these need to eventually merge to one shard. 22 | -------------------------------------------------------------------------------- /game/src/player/mod.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code, unused_imports)] 2 | 3 | use card::{Card}; 4 | use table::{Table}; 5 | use hand::{Hand}; 6 | use deck::{Deck}; 7 | 8 | #[derive(Debug)] 9 | pub struct Player<'a> { 10 | pub hand: Hand<'a>, 11 | pub chips: u64, 12 | pub active: bool, 13 | pub sitting_out: bool, 14 | } 15 | 16 | impl<'a> Player<'a> { 17 | pub fn new(hand: Hand<'a>) -> Player<'a> { 18 | Player{hand: hand, chips: 0, active: false, sitting_out: false} 19 | } 20 | 21 | // TODO: Only for CashGames, Capped at 100BB's 22 | pub fn add_chips(&mut self, chips: u64) { 23 | self.chips += chips 24 | } 25 | } 26 | 27 | #[cfg(test)] 28 | mod tests { 29 | use super::*; 30 | #[test] 31 | fn should_be_able_to_add_chips() { 32 | let mut deck: Vec = Deck::new(); 33 | let cards = vec![]; 34 | let hand = Hand::new(cards); 35 | let mut player = Player::new(hand); 36 | player.add_chips(1000); 37 | assert_eq!(player.chips, 1000); 38 | player.add_chips(1000); 39 | assert_eq!(player.chips, 2000); 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Decentralized Poker Dapp 2 | Trustless Decentralized Poker Application 3 | 4 | This systems is comprised of four parts: 5 | 1. Game - Contains poker logic 6 | 2. Main Chain - Contains Contract to Verify Plasma Child Chain 7 | 3. Child Chain - Contains Plasma Contracts, State Channel Multisig, and Contracts to verify state channels 8 | 4. State Channels - State channel contracts 9 | 10 | #### Current Implementation Being Worked in (Subject to Change) 11 | - Each Casino is its own plasma chain that users are free to join 12 | - Each Plasma Chain hosts a network of state channels (tables). When a new user joins a new channel must be started and users must move funds over to new channel (possibly?) 13 | 14 | #### Tournament Play 15 | [ ] Each tournament must have a determistic psuedo-random way to verify and determine player positions throughout tournament. 16 | 17 | 18 | #### NFT Tournament Tickets 19 | [ ] Easily Trade/Sell Tournament Tokens 20 | 21 | #### Staking 22 | Offer a trustless way to stake players 23 | 24 | [ ] Cash Game Staking 25 | - Stake a player and receives your share instantaneously 26 | 27 | [ ] Tournament Staking 28 | 29 | -------------------------------------------------------------------------------- /parent_chain/requirements-dev.txt: -------------------------------------------------------------------------------- 1 | anyconfig==0.9.4 2 | argh==0.26.2 3 | atomicwrites==1.1.5 4 | attrdict==2.0.0 5 | attrs==18.1.0 6 | bitcoin==1.1.42 7 | certifi==2018.4.16 8 | cffi==1.11.5 9 | chardet==3.0.4 10 | click==6.7 11 | contextlib2==0.5.5 12 | cytoolz==0.9.0.1 13 | eth-abi==1.1.1 14 | eth-account==0.2.3 15 | eth-hash==0.1.4 16 | eth-keyfile==0.5.1 17 | eth-keys==0.2.0b3 18 | eth-rlp==0.1.2 19 | eth-testrpc==1.3.5 20 | eth-utils==1.0.3 21 | ethereum==1.6.1 22 | hexbytes==0.1.0 23 | idna==2.7 24 | json-rpc==1.11.0 25 | jsonschema==2.6.0 26 | lru-dict==1.1.6 27 | more-itertools==4.2.0 28 | parsimonious==0.8.0 29 | pathtools==0.1.2 30 | pbkdf2==1.3 31 | pluggy==0.6.0 32 | populus==2.2.0 33 | py==1.5.3 34 | py-geth==2.0.1 35 | py-solc==3.1.0 36 | pycparser==2.18 37 | pycryptodome==3.6.1 38 | pyethash==0.1.27 39 | pylru==1.1.0 40 | pysha3==1.0.2 41 | pytest==3.6.1 42 | PyYAML==3.12 43 | repoze.lru==0.7 44 | requests==2.19.1 45 | rlp==0.6.0 46 | scrypt==0.8.6 47 | secp256k1==0.13.2 48 | semantic-version==2.6.0 49 | six==1.11.0 50 | toolz==0.9.0 51 | toposort==1.5 52 | urllib3==1.23 53 | watchdog==0.8.3 54 | web3==4.3.0 55 | websockets==4.0.1 56 | Werkzeug==0.15.3 57 | -------------------------------------------------------------------------------- /game/src/hand/mod.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code, unused_imports)] 2 | mod test; 3 | 4 | use card::{Card, Suit}; 5 | use rankings::{get_rank, Ranks, Rank}; 6 | use std::collections::HashMap; 7 | 8 | #[derive(Debug, Eq, PartialEq)] 9 | pub struct Hand<'a> { 10 | pub cards: Vec<&'a Card>, 11 | value: Option> 12 | } 13 | 14 | impl<'a> Hand<'a> { 15 | pub fn new(cards: Vec<&'a Card>) -> Hand<'a> { 16 | Hand{cards, value: None} 17 | } 18 | 19 | pub fn get_value(&mut self) { 20 | if let Some(rank) = get_rank(&self) { 21 | self.value = Some(Rank{cards: vec![], rank}); 22 | } 23 | } 24 | 25 | pub fn ranks(&mut self) -> Vec { 26 | self.cards.sort(); 27 | let mut ranks: Vec = Vec::new(); 28 | for card in self.cards.iter() { 29 | ranks.push(card.rank().first().unwrap().0); 30 | } 31 | ranks 32 | } 33 | 34 | pub fn suits(&self) -> HashMap { 35 | let mut suits: HashMap = HashMap::new(); 36 | for card in self.cards.iter() { 37 | let number = suits.entry(card.suit).or_insert(0); 38 | *number += 1; 39 | } 40 | suits 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /parent_chain/contracts/Cashier.v.py: -------------------------------------------------------------------------------- 1 | owner: public(address) 2 | balances: uint256(wei)[address] 3 | verified_roots: bytes32[bool] 4 | 5 | @public 6 | def __init__(): 7 | self.owner = msg.sender 8 | 9 | @public 10 | def withdraw(amount: uint256(wei)): 11 | assert self.balances[msg.sender] >= amount 12 | self.balances[msg.sender] = self.balances[msg.sender] - amount 13 | 14 | @public 15 | @constant 16 | def balanceOf(user: address) -> uint256(wei): 17 | return self.balances[user] 18 | 19 | @public 20 | @payable 21 | def __default__(): 22 | self.balances[msg.sender] = self.balances[msg.sender] + msg.value 23 | 24 | 25 | ## Vyper port of https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/MerkleProof.sol 26 | @constant 27 | @public 28 | def verify(proofs: bytes32[100], root: bytes32, leaf: bytes32) -> bool: 29 | computed_hash: bytes32 = leaf 30 | for proof in proofs: 31 | if convert(leaf, 'uint256') < convert(proof, 'uint256'): 32 | computed_hash = sha3(concat(computed_hash, proof)) 33 | else: 34 | computed_hash = sha3(concat(proof, computed_hash)) 35 | 36 | return computed_hash == root 37 | 38 | 39 | -------------------------------------------------------------------------------- /research/encryption.md: -------------------------------------------------------------------------------- 1 | ## Encryption Problems 2 | 3 | 1. [Card Revealing](#card-reveal) 4 | 5 | 6 | ## Card Reveal 7 | Scenario: Three players in Hand, Player A, B collude with eachother, Player C has no idea and is playing normally. 8 | 9 | 10 | If Player B and C have money in the pot while hand is still being played, but realizes he will ultimately lose the hand. He may tell Player A not to reveal secret to decrypt the cards left in the deck. Leading to a deadlock due to not being able to confirm who won the hand 11 | 12 | This also works is Player A and B are not colluding but Player A randomly disconnects and is unable to release secret. 13 | 14 | 15 | Possible Resolutions: 16 | - When Player A folds he must release his decyption secret 17 | - In event Player A disconnects and is unable to fold, either Player A is punished. (Would be hard to make sure Player C is deserving of the pot, so when Player A is punished - does Player B also get kickbacks from punishment?) 18 | - Each player may (optionally) select their own third-party overseer, that has access to decryption keys. In event Player A is unable to release secret, that third party may release decryption on Player A's behalf. 19 | -------------------------------------------------------------------------------- /game/src/hand/test.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg(test)] 3 | mod tests { 4 | use hand::Hand; 5 | use card::{Card, suit:: Suit}; 6 | use rankings::Ranks; 7 | 8 | #[test] 9 | fn should_create_a_hand() { 10 | let mut cards = vec![&Card{suit:Suit::Hearts, rank:2}]; 11 | let hand: Hand = Hand::new(cards.to_vec()); 12 | assert_eq!(hand, hand) 13 | } 14 | 15 | #[test] 16 | fn should_give_ranks() { 17 | let mut cards = vec![ 18 | &Card{suit:Suit::Hearts, rank:14}, 19 | &Card{suit:Suit::Diamonds, rank:2}, 20 | &Card{suit:Suit::Hearts, rank:3}, 21 | &Card{suit:Suit::Hearts, rank:7}, 22 | &Card{suit:Suit::Hearts, rank:10} 23 | ]; 24 | let mut hand: Hand = Hand::new(cards.to_vec()); 25 | assert_eq!(hand.ranks(), vec![14, 10, 7, 3, 2]) 26 | } 27 | 28 | #[test] 29 | fn should_create_a_pair() { 30 | let mut cards = vec![ 31 | &Card{suit:Suit::Hearts, rank:2}, 32 | &Card{suit:Suit::Diamonds, rank:2}, 33 | &Card{suit:Suit::Hearts, rank:4}, 34 | &Card{suit:Suit::Hearts, rank:5}, 35 | &Card{suit:Suit::Hearts, rank:8} 36 | ]; 37 | let mut hand: Hand = Hand::new(cards.to_vec()); 38 | hand.get_value(); 39 | assert_eq!(hand.value.unwrap().rank, Ranks::OnePair) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /game/src/table/mod.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code, unused_imports)] 2 | mod dealer; 3 | mod test; 4 | 5 | use std::collections::HashMap; 6 | 7 | use std::sync::{Arc, Mutex}; 8 | use card::{Card, suit}; 9 | use game_types::{GameTypes}; 10 | use deck::{Deck}; 11 | use player::{Player}; 12 | use self::dealer::Deal; 13 | 14 | #[derive(Debug)] 15 | pub struct Table<'a, 'b> { 16 | pub game: GameTypes, 17 | deck: &'a mut Vec, 18 | round: u8, 19 | board: Vec, 20 | seats: Arc>>>, 21 | } 22 | 23 | 24 | impl<'a, 'b> Table<'a, 'b> { 25 | pub fn new( 26 | game: GameTypes, 27 | deck: &'a mut Vec, 28 | _seats: usize, 29 | ) -> Table<'a, 'b> { 30 | let mut board = vec![]; 31 | let seats = Arc::new(Mutex::new(HashMap::new())); 32 | Table{game, seats, round: 0, board, deck} 33 | } 34 | 35 | pub fn assign_player(&mut self, player: Player<'b>, seat: i8) { 36 | let mut seats = self.seats.lock().unwrap(); 37 | seats.entry(seat).or_insert(player); 38 | } 39 | 40 | pub fn start_hand(&mut self) { 41 | let mut seats = self.seats.lock().unwrap(); 42 | for (_, player) in seats.iter_mut() { 43 | if player.chips > 0 && !player.sitting_out { 44 | player.active = true; 45 | } 46 | } 47 | } 48 | } 49 | 50 | -------------------------------------------------------------------------------- /game/src/table/test.rs: -------------------------------------------------------------------------------- 1 | use card::{Card, suit}; 2 | use game_types::{GameTypes}; 3 | use deck::{Deck}; 4 | use hand::Hand; 5 | use player::{Player}; 6 | use table::{Table, dealer::Deal}; 7 | 8 | #[cfg(test)] 9 | mod tests { 10 | use super::*; 11 | #[test] 12 | fn should_be_texas_holdem() { 13 | let mut deck = Deck::new(); 14 | const SEATS: usize = 2; 15 | let mut table = Table::new(GameTypes::TexasHoldem, &mut deck, SEATS); 16 | assert_eq!(table.game, GameTypes::TexasHoldem); 17 | } 18 | 19 | #[test] 20 | fn player_should_be_able_to_sit() { 21 | let mut deck: Vec = Deck::new(); 22 | let mut table = Table::new(GameTypes::TexasHoldem, &mut deck, 6); 23 | let cards = vec![]; 24 | let hand = Hand::new(cards); 25 | let mut player = Player{hand: hand, chips: 1000, active: false, sitting_out: false}; 26 | table.assign_player(player, 1); 27 | assert_eq!(table.seats.lock().unwrap().get(&1).unwrap().chips, 1000); 28 | } 29 | 30 | #[test] 31 | #[ignore] 32 | fn should_be_able_to_deal_to_players() { 33 | let mut deck: Vec = Deck::new(); 34 | let mut table = Table::new(GameTypes::TexasHoldem, &mut deck, 6); 35 | let cards = vec![]; 36 | let hand = Hand::new(cards); 37 | let mut player = Player::new(hand); 38 | table.assign_player(player, 1); 39 | // player.add_chips(1000); 40 | table.start_hand(); 41 | println!("{:?}", table); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /game/src/deck/mod.rs: -------------------------------------------------------------------------------- 1 | use card::{Card, Suit, Cards}; 2 | use rand::{thread_rng, Rng}; 3 | 4 | mod test; 5 | 6 | pub trait Deck<'a, T> { 7 | fn new() -> Self; 8 | fn allocate(&'a [&'a Card]) -> Self; 9 | fn populate(&mut self); 10 | fn shuffle(&mut self); 11 | } 12 | 13 | impl<'a> Deck<'a, &'a[&'a Card]> for &'a mut [&'a Card] { 14 | fn new() -> Self { 15 | unimplemented!() 16 | } 17 | 18 | fn populate(&mut self) { 19 | unimplemented!() 20 | } 21 | 22 | fn allocate(cards: &'a[&'a Card]) -> Self { 23 | unimplemented!() 24 | } 25 | 26 | fn shuffle(mut self: &mut Self) { 27 | let mut rng = thread_rng(); 28 | rng.shuffle(&mut self); 29 | rng.shuffle(&mut self); 30 | rng.shuffle(&mut self); 31 | } 32 | } 33 | 34 | impl<'a> Deck<'a, Vec> for Vec { 35 | fn new() -> Self { 36 | let mut deck: Vec = Vec::new(); 37 | deck.populate(); 38 | deck 39 | } 40 | 41 | fn allocate(cards: &'a [&'a Card]) -> Self { 42 | unimplemented!() 43 | } 44 | 45 | fn populate(&mut self) { 46 | for suit in Suit::iter() { 47 | for rank in 2..14+1 { 48 | self.push(Card::new(rank, Suit::get_suit(*suit))); 49 | } 50 | } 51 | } 52 | 53 | fn shuffle(mut self: &mut Self) { 54 | let mut rng = thread_rng(); 55 | rng.shuffle(&mut self); 56 | rng.shuffle(&mut self); 57 | rng.shuffle(&mut self); 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /parent_chain/.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | -------------------------------------------------------------------------------- /game/src/card/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod suit; 2 | mod test; 3 | 4 | use std::fmt::{Display, Formatter, Result}; 5 | use std::cmp::Ordering; 6 | use std::collections::HashMap; 7 | pub use self::suit::Suit; 8 | use game_types::GameTypes; 9 | 10 | 11 | #[derive(Debug, Eq, Clone)] 12 | pub struct Card { 13 | pub rank: u8, 14 | pub suit: Suit, 15 | } 16 | 17 | pub trait Cards<'a, T> { 18 | fn ranks(self) -> Vec; 19 | fn suits(&self) -> HashMap; 20 | fn values(self) -> Vec; 21 | fn lowest_number(&self) -> u8; 22 | } 23 | 24 | pub fn create() -> Vec { 25 | let mut cards: Vec = Vec::new(); 26 | for suit in Suit::iter() { 27 | for rank in 2..14+1 { 28 | cards.push(Card::new(rank, Suit::get_suit(*suit))); 29 | } 30 | } 31 | cards 32 | } 33 | 34 | pub fn allocate<'a>(cards: &'a Vec) -> Vec<&'a Card> { 35 | let mut card_ref: Vec<&'a Card> = Vec::new(); 36 | for i in 0..cards.len() { 37 | card_ref.push(&cards[i] as &'a Card); 38 | } 39 | card_ref 40 | } 41 | 42 | impl<'a> Cards<'a, Vec<&'a Card>> for Vec<&'a Card> { 43 | fn ranks(self) -> Vec { 44 | let mut cards: Vec = vec![]; 45 | for card in (&self).iter() { 46 | cards.push(card.rank) 47 | } 48 | cards.sort(); 49 | cards.reverse(); // highest cards first 50 | cards 51 | } 52 | 53 | fn lowest_number(&self) -> u8 { 54 | let cards = self.clone(); 55 | let ranks = cards.ranks(); 56 | // Only need this for straights, so check for a 2 57 | // TODO: this way won't work for Omaha Hi/Lo or Razz 58 | if ranks.contains(&14) && ranks.contains(&2) { 59 | return 1; 60 | } 61 | self.last().unwrap().rank 62 | } 63 | 64 | // Values have Ace = 1 and 14 65 | fn values(self) -> Vec { 66 | let mut cards: Vec = vec![]; 67 | for card in (&self).iter() { 68 | cards.append(&mut card.rank().iter().map(|c| c.0).collect()) 69 | } 70 | cards 71 | } 72 | 73 | fn suits(&self) -> HashMap { 74 | let mut suits: HashMap = HashMap::new(); 75 | for card in (&self).iter() { 76 | let number = suits.entry(card.suit).or_insert(0); 77 | *number += 1; 78 | } 79 | suits 80 | } 81 | } 82 | 83 | 84 | impl Ord for Card { 85 | fn cmp(&self, other: &Card) -> Ordering { 86 | self.rank.cmp(&other.rank) 87 | } 88 | } 89 | 90 | impl PartialOrd for Card { 91 | fn partial_cmp(&self, other: &Card) -> Option { 92 | Some(self.cmp(other).reverse()) 93 | } 94 | } 95 | 96 | impl PartialEq for Card { 97 | fn eq(&self, other: &Card) -> bool { 98 | if self.rank == 14 { 99 | return 14 == other.rank || 1 == other.rank 100 | } 101 | self.rank == other.rank 102 | } 103 | } 104 | 105 | impl Display for Card { 106 | fn fmt(self: &Card, f: &mut Formatter) -> Result { 107 | let rank = match self.rank { 108 | 2 => "Deuce", 109 | 3 => "3", 110 | 4 => "4", 111 | 5 => "5", 112 | 6 => "6", 113 | 7 => "7", 114 | 8 => "8", 115 | 9 => "9", 116 | 10 => "10", 117 | 11 => "Jack", 118 | 12 => "Queen", 119 | 13 => "King", 120 | 14 => "Ace", 121 | _ => panic!("Rank does not exist") 122 | }; 123 | write!(f, "{} of {:?}", rank, self.suit) 124 | } 125 | } 126 | 127 | impl Card { 128 | pub fn new(rank: u8, suit: Suit) -> Card { 129 | Card{rank, suit} 130 | } 131 | 132 | pub fn rank(self: &Card) -> Vec<(u8, &Card)> { 133 | if self.rank != 14 { 134 | vec![(self.rank, self)] 135 | } else { 136 | vec![(14, self), (1, self)] 137 | } 138 | } 139 | } 140 | 141 | 142 | -------------------------------------------------------------------------------- /game/src/card/test.rs: -------------------------------------------------------------------------------- 1 | 2 | #[cfg(test)] 3 | mod tests { 4 | use card::{Card, suit::Suit, Cards}; 5 | 6 | #[test] 7 | #[ignore] 8 | fn should_put_cards_on_heap() { 9 | } 10 | 11 | #[test] 12 | fn should_sort_correctly() { 13 | let mut cards: Vec<&Card> = vec![ 14 | &Card{suit:Suit::Spades, rank: 13}, 15 | &Card{suit:Suit::Diamonds, rank: 12}, 16 | &Card{suit:Suit::Spades, rank: 14}, 17 | ]; 18 | let correct_order = vec![ 19 | &Card{suit:Suit::Spades, rank: 14}, 20 | &Card{suit:Suit::Diamonds, rank: 13}, 21 | &Card{suit:Suit::Spades, rank: 12}, 22 | ]; 23 | cards.sort(); 24 | assert_eq!(cards, correct_order); 25 | } 26 | 27 | #[test] 28 | fn should_sort_correctly_1() { 29 | let mut cards = vec![ 30 | &Card{suit:Suit::Spades, rank: 13}, 31 | &Card{suit:Suit::Diamonds, rank: 12}, 32 | &Card{suit:Suit::Spades, rank: 14}, 33 | ]; 34 | let correct_order = vec![ 35 | &Card{suit:Suit::Spades, rank: 14}, 36 | &Card{suit:Suit::Diamonds, rank: 13}, 37 | &Card{suit:Suit::Spades, rank: 12}, 38 | ]; 39 | cards.sort(); 40 | assert_eq!(cards, correct_order); 41 | } 42 | 43 | #[test] 44 | fn should_sort_correctly_2() { 45 | let mut cards = vec![ 46 | &Card{suit:Suit::Spades, rank: 14}, 47 | &Card{suit:Suit::Diamonds, rank: 14}, 48 | &Card{suit:Suit::Spades, rank: 14}, 49 | &Card{suit:Suit::Spades, rank: 2}, 50 | ]; 51 | let correct_order = vec![ 52 | &Card{suit:Suit::Spades, rank: 14}, 53 | &Card{suit:Suit::Spades, rank: 14}, 54 | &Card{suit:Suit::Diamonds, rank: 14}, 55 | &Card{suit:Suit::Spades, rank: 2}, 56 | ]; 57 | cards.sort(); 58 | assert_eq!(cards, correct_order); 59 | } 60 | 61 | #[test] 62 | fn should_sort_correctly_3() { 63 | let mut cards = vec![ 64 | &Card{suit:Suit::Spades, rank: 14}, 65 | &Card{suit:Suit::Spades, rank: 3}, 66 | &Card{suit:Suit::Diamonds, rank: 2}, 67 | &Card{suit:Suit::Spades, rank: 14}, 68 | ]; 69 | let correct_order = vec![ 70 | &Card{suit:Suit::Spades, rank: 14}, 71 | &Card{suit:Suit::Spades, rank: 14}, 72 | &Card{suit:Suit::Diamonds, rank: 3}, 73 | &Card{suit:Suit::Spades, rank: 2}, 74 | ]; 75 | cards.sort(); 76 | assert_eq!(cards, correct_order); 77 | } 78 | 79 | #[test] 80 | fn should_format_correctly() { 81 | let card = Card{suit:Suit::Spades, rank:14}; 82 | let formatted_card = format!("{}", card); 83 | assert_eq!(formatted_card, "Ace of Spades"); 84 | } 85 | 86 | 87 | #[test] 88 | fn should_format_correctly2() { 89 | let card = Card{suit:Suit::Clubs, rank:2}; 90 | let formatted_card = format!("{}", card); 91 | assert_eq!(formatted_card, "Deuce of Clubs"); 92 | } 93 | 94 | #[test] 95 | fn should_format_correctly3() { 96 | let card = Card{suit:Suit::Diamonds, rank:5}; 97 | let formatted_card = format!("{}", card); 98 | assert_eq!(formatted_card, "5 of Diamonds"); 99 | } 100 | 101 | 102 | #[test] 103 | fn should_format_correctly4() { 104 | let card = Card{suit:Suit::Hearts, rank:13}; 105 | let formatted_card = format!("{}", card); 106 | assert_eq!(formatted_card, "King of Hearts"); 107 | } 108 | 109 | #[test] 110 | fn deuce_should_have_rank_of_2() { 111 | let card = Card{suit:Suit::Hearts, rank:2}; 112 | assert_eq!(card.rank(), vec![(2, &card)]); 113 | } 114 | 115 | #[test] 116 | fn ace_should_have_rank_if_1_or_14() { 117 | let card = Card{suit:Suit::Hearts, rank:14}; 118 | assert_eq!(card.rank(), vec![(14, &card), (1, &card)]); 119 | } 120 | 121 | #[test] 122 | fn king_should_have_rank_if_13() { 123 | let card = Card{suit:Suit::Hearts, rank:13}; 124 | assert_eq!(card.rank(), vec![(13, &card)]); 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /game/Cargo.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | name = "aho-corasick" 3 | version = "0.6.6" 4 | source = "registry+https://github.com/rust-lang/crates.io-index" 5 | dependencies = [ 6 | "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 7 | ] 8 | 9 | [[package]] 10 | name = "backtrace" 11 | version = "0.3.9" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | dependencies = [ 14 | "backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", 15 | "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 16 | "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", 17 | "rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", 18 | "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 19 | ] 20 | 21 | [[package]] 22 | name = "backtrace-sys" 23 | version = "0.1.23" 24 | source = "registry+https://github.com/rust-lang/crates.io-index" 25 | dependencies = [ 26 | "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", 27 | "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", 28 | ] 29 | 30 | [[package]] 31 | name = "bitflags" 32 | version = "0.7.0" 33 | source = "registry+https://github.com/rust-lang/crates.io-index" 34 | 35 | [[package]] 36 | name = "cc" 37 | version = "1.0.18" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | 40 | [[package]] 41 | name = "cfg-if" 42 | version = "0.1.4" 43 | source = "registry+https://github.com/rust-lang/crates.io-index" 44 | 45 | [[package]] 46 | name = "dotenv" 47 | version = "0.13.0" 48 | source = "registry+https://github.com/rust-lang/crates.io-index" 49 | dependencies = [ 50 | "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 51 | "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 52 | "regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 53 | ] 54 | 55 | [[package]] 56 | name = "failure" 57 | version = "0.1.1" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | dependencies = [ 60 | "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 61 | "failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 62 | ] 63 | 64 | [[package]] 65 | name = "failure_derive" 66 | version = "0.1.1" 67 | source = "registry+https://github.com/rust-lang/crates.io-index" 68 | dependencies = [ 69 | "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", 70 | "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", 71 | "synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", 72 | ] 73 | 74 | [[package]] 75 | name = "fuchsia-zircon" 76 | version = "0.2.1" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | dependencies = [ 79 | "fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 80 | ] 81 | 82 | [[package]] 83 | name = "fuchsia-zircon-sys" 84 | version = "0.2.0" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | dependencies = [ 87 | "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 88 | ] 89 | 90 | [[package]] 91 | name = "lazy_static" 92 | version = "1.0.2" 93 | source = "registry+https://github.com/rust-lang/crates.io-index" 94 | 95 | [[package]] 96 | name = "libc" 97 | version = "0.2.34" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | 100 | [[package]] 101 | name = "memchr" 102 | version = "2.0.1" 103 | source = "registry+https://github.com/rust-lang/crates.io-index" 104 | dependencies = [ 105 | "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", 106 | ] 107 | 108 | [[package]] 109 | name = "poker" 110 | version = "0.1.0" 111 | dependencies = [ 112 | "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", 113 | "rand 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", 114 | ] 115 | 116 | [[package]] 117 | name = "quote" 118 | version = "0.3.15" 119 | source = "registry+https://github.com/rust-lang/crates.io-index" 120 | 121 | [[package]] 122 | name = "rand" 123 | version = "0.3.18" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | dependencies = [ 126 | "fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 127 | "libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", 128 | ] 129 | 130 | [[package]] 131 | name = "regex" 132 | version = "1.0.2" 133 | source = "registry+https://github.com/rust-lang/crates.io-index" 134 | dependencies = [ 135 | "aho-corasick 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", 136 | "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 137 | "regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", 138 | "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 139 | "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 140 | ] 141 | 142 | [[package]] 143 | name = "regex-syntax" 144 | version = "0.6.2" 145 | source = "registry+https://github.com/rust-lang/crates.io-index" 146 | dependencies = [ 147 | "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 148 | ] 149 | 150 | [[package]] 151 | name = "rustc-demangle" 152 | version = "0.1.9" 153 | source = "registry+https://github.com/rust-lang/crates.io-index" 154 | 155 | [[package]] 156 | name = "syn" 157 | version = "0.11.11" 158 | source = "registry+https://github.com/rust-lang/crates.io-index" 159 | dependencies = [ 160 | "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", 161 | "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", 162 | "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 163 | ] 164 | 165 | [[package]] 166 | name = "synom" 167 | version = "0.11.3" 168 | source = "registry+https://github.com/rust-lang/crates.io-index" 169 | dependencies = [ 170 | "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 171 | ] 172 | 173 | [[package]] 174 | name = "synstructure" 175 | version = "0.6.1" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | dependencies = [ 178 | "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", 179 | "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", 180 | ] 181 | 182 | [[package]] 183 | name = "thread_local" 184 | version = "0.3.5" 185 | source = "registry+https://github.com/rust-lang/crates.io-index" 186 | dependencies = [ 187 | "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 188 | "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 189 | ] 190 | 191 | [[package]] 192 | name = "ucd-util" 193 | version = "0.1.1" 194 | source = "registry+https://github.com/rust-lang/crates.io-index" 195 | 196 | [[package]] 197 | name = "unicode-xid" 198 | version = "0.0.4" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | 201 | [[package]] 202 | name = "unreachable" 203 | version = "1.0.0" 204 | source = "registry+https://github.com/rust-lang/crates.io-index" 205 | dependencies = [ 206 | "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 207 | ] 208 | 209 | [[package]] 210 | name = "utf8-ranges" 211 | version = "1.0.0" 212 | source = "registry+https://github.com/rust-lang/crates.io-index" 213 | 214 | [[package]] 215 | name = "void" 216 | version = "1.0.2" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | 219 | [[package]] 220 | name = "winapi" 221 | version = "0.3.5" 222 | source = "registry+https://github.com/rust-lang/crates.io-index" 223 | dependencies = [ 224 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 225 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 226 | ] 227 | 228 | [[package]] 229 | name = "winapi-i686-pc-windows-gnu" 230 | version = "0.4.0" 231 | source = "registry+https://github.com/rust-lang/crates.io-index" 232 | 233 | [[package]] 234 | name = "winapi-x86_64-pc-windows-gnu" 235 | version = "0.4.0" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | 238 | [metadata] 239 | "checksum aho-corasick 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c1c6d463cbe7ed28720b5b489e7c083eeb8f90d08be2a0d6bb9e1ffea9ce1afa" 240 | "checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a" 241 | "checksum backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "bff67d0c06556c0b8e6b5f090f0eac52d950d9dfd1d35ba04e4ca3543eaf6a7e" 242 | "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" 243 | "checksum cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "2119ea4867bd2b8ed3aecab467709720b2d55b1bcfe09f772fd68066eaf15275" 244 | "checksum cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efe5c877e17a9c717a0bf3613b2709f723202c4e4675cc8f12926ded29bcb17e" 245 | "checksum dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d0a1279c96732bc6800ce6337b6a614697b0e74ae058dc03c62ebeb78b4d86" 246 | "checksum failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "934799b6c1de475a012a02dab0ace1ace43789ee4b99bcfbf1a2e3e8ced5de82" 247 | "checksum failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c7cdda555bb90c9bb67a3b670a0f42de8e73f5981524123ad8578aafec8ddb8b" 248 | "checksum fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f6c0581a4e363262e52b87f59ee2afe3415361c6ec35e665924eb08afe8ff159" 249 | "checksum fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "43f3795b4bae048dc6123a6b972cadde2e676f9ded08aef6bb77f5f157684a82" 250 | "checksum lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fb497c35d362b6a331cfd94956a07fc2c78a4604cdbee844a81170386b996dd3" 251 | "checksum libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)" = "36fbc8a8929c632868295d0178dd8f63fc423fd7537ad0738372bd010b3ac9b0" 252 | "checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d" 253 | "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" 254 | "checksum rand 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6475140dfd8655aeb72e1fd4b7a1cc1c202be65d71669476e392fe62532b9edd" 255 | "checksum regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5bbbea44c5490a1e84357ff28b7d518b4619a159fed5d25f6c1de2d19cc42814" 256 | "checksum regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "747ba3b235651f6e2f67dfa8bcdcd073ddb7c243cb21c442fc12395dfcac212d" 257 | "checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395" 258 | "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" 259 | "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" 260 | "checksum synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a761d12e6d8dcb4dcf952a7a89b475e3a9d69e4a69307e01a470977642914bd" 261 | "checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963" 262 | "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" 263 | "checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" 264 | "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" 265 | "checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" 266 | "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 267 | "checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd" 268 | "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 269 | "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 270 | -------------------------------------------------------------------------------- /game/src/rankings/mod.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | 3 | use card::{Card, Suit, Cards}; 4 | use hand::{Hand}; 5 | 6 | #[derive(PartialEq, Eq, Debug, Clone)] 7 | pub struct Rank<'a> { 8 | pub rank: Ranks, 9 | pub cards: Vec<&'a Card> 10 | } 11 | 12 | #[derive(PartialEq, Eq, Debug, Clone)] 13 | pub enum Ranks { 14 | HighCard, 15 | OnePair, 16 | TwoPair, 17 | ThreeOfAKind, 18 | Straight, 19 | Flush, 20 | FullHouse, 21 | FourOfAKind, 22 | StraightFlush, // Royal Flush Included 23 | } 24 | 25 | pub fn get_rank(_card: &Hand) -> Option { 26 | if let Some(_x) = is_pair(_card.cards.to_vec()) { 27 | return Some(Ranks::OnePair) 28 | } 29 | None 30 | } 31 | 32 | // Should return flush 33 | fn is_flush<'a>(cards: Vec<&'a Card>) -> Option> { 34 | let c = cards.clone(); 35 | let suits = c.suits(); 36 | if let Some(count_hearts) = suits.get(&Suit::Hearts) { 37 | if *count_hearts >= 5 { 38 | return Some(Rank{rank: Ranks::Flush, cards: get_flush_hand(cards, Suit::Hearts)}) 39 | } 40 | } 41 | if let Some(count_diamonds) = suits.get(&Suit::Diamonds) { 42 | if *count_diamonds >= 5 { 43 | return Some(Rank{rank: Ranks::Flush, cards: get_flush_hand(cards, Suit::Diamonds)}) 44 | } 45 | } 46 | if let Some(count_spades) = suits.get(&Suit::Spades) { 47 | if *count_spades >= 5 { 48 | return Some(Rank{rank: Ranks::Flush, cards: get_flush_hand(cards, Suit::Spades)}) 49 | } 50 | } 51 | if let Some(count_clubs) = suits.get(&Suit::Clubs) { 52 | if *count_clubs >= 5 { 53 | return Some(Rank{rank: Ranks::Flush, cards: get_flush_hand(cards, Suit::Clubs)}) 54 | } 55 | } 56 | None 57 | } 58 | 59 | 60 | #[allow(unknown_lints, needless_pass_by_value)] 61 | fn get_flush_cards(cards: Vec<&Card>, suit: Suit) -> Vec<&Card> { 62 | cards.iter().filter(|card| card.suit == suit).map(|card| *card).collect() 63 | } 64 | 65 | fn get_flush_hand(mut cards: Vec<&Card>, suit: Suit) -> Vec<&Card> { 66 | cards.sort(); 67 | cards.iter().filter(|card| card.suit == suit).take(5).map(|card| *card).collect() 68 | } 69 | 70 | 71 | fn is_straight_flush(c: Vec<&Card>) -> Option { 72 | let cards = c.clone(); 73 | let suits = cards.suits(); 74 | if let Some(count_hearts) = suits.get(&Suit::Hearts) { 75 | if *count_hearts >= 5 { 76 | let result = get_flush_cards(c, Suit::Hearts); 77 | return is_straight(result) 78 | } 79 | } 80 | if let Some(count_diamonds) = suits.get(&Suit::Diamonds) { 81 | if *count_diamonds >= 5 { 82 | return is_straight(get_flush_cards(c, Suit::Diamonds)) 83 | } 84 | } 85 | if let Some(count_spades) = suits.get(&Suit::Spades) { 86 | if *count_spades >= 5 { 87 | return is_straight(get_flush_cards(c, Suit::Spades)) 88 | } 89 | } 90 | if let Some(count_clubs) = suits.get(&Suit::Clubs) { 91 | if *count_clubs >= 5 { 92 | return is_straight(get_flush_cards(c, Suit::Clubs)) 93 | } 94 | } 95 | None 96 | } 97 | 98 | fn is_straight(mut c: Vec<&Card>) -> Option { 99 | c.sort(); 100 | for window in c.windows(5) { 101 | let mut cards = window.to_vec(); 102 | let low_card = cards.lowest_number(); 103 | let ranks = cards.values(); 104 | if ranks.contains(&(low_card as u8)) 105 | && ranks.contains(&(low_card + 1 as u8)) 106 | && ranks.contains(&(low_card + 2 as u8)) 107 | && ranks.contains(&(low_card + 3 as u8)) 108 | && ranks.contains(&(low_card + 4 as u8)) { 109 | return Some(low_card + 4) 110 | } 111 | } 112 | None 113 | } 114 | 115 | fn is_pair(mut cards: Vec<&Card>) -> Option { 116 | cards.sort(); 117 | let ranks = cards.ranks(); 118 | for rank in ranks.windows(2) { 119 | println!("{:?}", rank); 120 | if rank[0] == rank[1] { 121 | return Some(rank[0]); 122 | } 123 | } 124 | None 125 | } 126 | 127 | fn is_two_pair(mut cards: Vec<&Card>) -> Option<[u8; 2]> { 128 | cards.sort(); 129 | let mut leftover_cards = cards.clone(); 130 | if let Some(x) = is_pair(cards) { 131 | leftover_cards = leftover_cards.iter().filter(|r| r.rank != x).cloned().collect(); 132 | if let Some(y) = is_pair(leftover_cards) { 133 | return Some([x, y]) 134 | } 135 | } 136 | None 137 | } 138 | 139 | fn is_full_house(cards: Vec<&Card>) -> Option<[u8; 2]> { 140 | let mut leftover_cards = cards.clone(); 141 | if let Some(x) = is_three_of_a_kind(cards) { 142 | leftover_cards = leftover_cards.iter().filter(|r| r.rank != x).cloned().collect(); 143 | if let Some(y) = is_pair(leftover_cards.to_vec()) { 144 | return Some([x, y]) 145 | } 146 | } 147 | None 148 | } 149 | 150 | fn is_three_of_a_kind(cards: Vec<&Card>) -> Option { 151 | let ranks = cards.ranks(); 152 | for rank in ranks.windows(3) { 153 | println!("{:?}", rank); 154 | if rank[0] == rank[1] && rank[0] == rank[2] { 155 | return Some(rank[0]); 156 | } 157 | } 158 | None 159 | } 160 | 161 | fn is_four_of_a_kind(cards: Vec<&Card>) -> Option { 162 | let ranks = cards.ranks(); 163 | for rank in ranks.windows(4) {; 164 | if rank[0] == rank[1] && rank[0] == rank[2] && rank[0] == rank[3] { 165 | return Some(rank[0]); 166 | } 167 | } 168 | None 169 | } 170 | 171 | fn high_card(cards: &[u8]) -> Option { 172 | Some(*cards.first().unwrap()) 173 | } 174 | 175 | #[cfg(test)] 176 | mod tests { 177 | use super::*; 178 | 179 | #[test] 180 | fn should_be_a_pair_of_deuces() { 181 | let cards = vec![ 182 | &Card{suit:Suit::Hearts, rank:2}, 183 | &Card{suit:Suit::Hearts, rank:2}, 184 | &Card{suit:Suit::Hearts, rank:3}, 185 | &Card{suit:Suit::Hearts, rank:5}, 186 | &Card{suit:Suit::Hearts, rank:7}, 187 | &Card{suit:Suit::Hearts, rank:6} 188 | ]; 189 | assert_eq!(is_pair(cards), Some(2)); 190 | } 191 | 192 | #[test] 193 | fn should_not_be_a_fullhouse() { 194 | let cards = vec![ 195 | &Card{suit:Suit::Hearts, rank:14}, 196 | &Card{suit:Suit::Hearts, rank:14}, 197 | &Card{suit:Suit::Hearts, rank:14}, 198 | &Card{suit:Suit::Hearts, rank:5}, 199 | &Card{suit:Suit::Hearts, rank:3} 200 | ]; 201 | assert_eq!(is_full_house(cards), None); 202 | } 203 | 204 | #[test] 205 | fn should_be_two_pair_5_and_10() { 206 | let cards = vec![ 207 | &Card{suit:Suit::Hearts, rank:5}, 208 | &Card{suit:Suit::Hearts, rank:9}, 209 | &Card{suit:Suit::Hearts, rank:10}, 210 | &Card{suit:Suit::Hearts, rank:5}, 211 | &Card{suit:Suit::Hearts, rank:10} 212 | ]; 213 | assert_eq!(is_two_pair(cards), Some([10, 5])); 214 | } 215 | 216 | #[test] 217 | fn should_be_a_fullhouse_3_over_2() { 218 | let cards = vec![ 219 | &Card{suit:Suit::Hearts, rank:3}, 220 | &Card{suit:Suit::Hearts, rank:3}, 221 | &Card{suit:Suit::Hearts, rank:2}, 222 | &Card{suit:Suit::Hearts, rank:2}, 223 | &Card{suit:Suit::Hearts, rank:3} 224 | ]; 225 | assert_eq!(is_full_house(cards), Some([3, 2])); 226 | } 227 | 228 | #[test] 229 | fn should_be_a_three_of_a_kind_queens() { 230 | let cards = vec![ 231 | &Card{suit:Suit::Hearts, rank:12}, 232 | &Card{suit:Suit::Hearts, rank:4}, 233 | &Card{suit:Suit::Hearts, rank:6}, 234 | &Card{suit:Suit::Hearts, rank:12}, 235 | &Card{suit:Suit::Hearts, rank:7}, 236 | &Card{suit:Suit::Hearts, rank:12} 237 | ]; 238 | assert_eq!(is_three_of_a_kind(cards), Some(12)); 239 | } 240 | 241 | #[test] 242 | fn should_be_a_four_of_a_kind_9() { 243 | let cards = vec![ 244 | &Card{suit:Suit::Hearts, rank:9}, 245 | &Card{suit:Suit::Hearts, rank:9}, 246 | &Card{suit:Suit::Hearts, rank:9}, 247 | &Card{suit:Suit::Hearts, rank:9}, 248 | &Card{suit:Suit::Hearts, rank:2} 249 | ]; 250 | assert_eq!(is_four_of_a_kind(cards), Some(9)); 251 | } 252 | 253 | #[test] 254 | fn should_be_a_straight_7_high() { 255 | let mut cards = [ 256 | &Card{suit:Suit::Hearts, rank:2}, 257 | &Card{suit:Suit::Hearts, rank:7}, 258 | &Card{suit:Suit::Hearts, rank:3}, 259 | &Card{suit:Suit::Hearts, rank:4}, 260 | &Card{suit:Suit::Hearts, rank:5}, 261 | &Card{suit:Suit::Hearts, rank:9}, 262 | &Card{suit:Suit::Hearts, rank:6} 263 | ]; 264 | let hand = Hand::new(cards.to_vec()); 265 | assert_eq!(is_straight(hand.cards.to_vec()), Some(7)); 266 | } 267 | 268 | #[test] 269 | fn should_be_a_straight_ace_high() { 270 | let mut cards = [ 271 | &Card{suit:Suit::Hearts, rank:14}, 272 | &Card{suit:Suit::Hearts, rank:13}, 273 | &Card{suit:Suit::Hearts, rank:12}, 274 | &Card{suit:Suit::Hearts, rank:11}, 275 | &Card{suit:Suit::Hearts, rank:10} 276 | ]; 277 | let hand = Hand::new(cards.to_vec()); 278 | assert_eq!(is_straight(hand.cards.to_vec()), Some(14)); 279 | } 280 | 281 | #[test] 282 | fn should_be_a_straight_five_high() { 283 | let mut cards = [ 284 | &Card{suit:Suit::Hearts, rank:14}, 285 | &Card{suit:Suit::Hearts, rank:2}, 286 | &Card{suit:Suit::Hearts, rank:3}, 287 | &Card{suit:Suit::Hearts, rank:4}, 288 | &Card{suit:Suit::Hearts, rank:5} 289 | ]; 290 | let hand = Hand::new(cards.to_vec()); 291 | assert_eq!(is_straight(hand.cards.to_vec()), Some(5)); 292 | } 293 | 294 | #[test] 295 | fn should_be_a_hearts_flush() { 296 | let cards = vec![ 297 | &Card{suit:Suit::Hearts, rank:14}, 298 | &Card{suit:Suit::Hearts, rank:10}, 299 | &Card{suit:Suit::Hearts, rank:2}, 300 | &Card{suit:Suit::Hearts, rank:4}, 301 | &Card{suit:Suit::Hearts, rank:6} 302 | ]; 303 | let c = cards.clone(); 304 | let flush_result = is_flush(c).unwrap(); 305 | assert_eq!(flush_result.rank, Ranks::Flush); 306 | let mut iter = flush_result.cards.iter(); 307 | assert_eq!(&cards[0], iter.next().unwrap()); 308 | assert_eq!(&cards[1], iter.next().unwrap()); 309 | assert_eq!(&cards[4], iter.next().unwrap()); 310 | assert_eq!(&cards[3], iter.next().unwrap()); 311 | assert_eq!(&cards[2], iter.next().unwrap()); 312 | } 313 | 314 | #[test] 315 | fn should_return_highest_five_flush() { 316 | let cards = [ 317 | &Card{suit:Suit::Hearts, rank:14}, 318 | &Card{suit:Suit::Hearts, rank:10}, 319 | &Card{suit:Suit::Hearts, rank:2}, 320 | &Card{suit:Suit::Hearts, rank:4}, 321 | &Card{suit:Suit::Hearts, rank:8}, 322 | &Card{suit:Suit::Hearts, rank:6} 323 | ]; 324 | let c = cards.clone(); 325 | let mut flush = get_flush_cards(c.to_vec(), Suit::Hearts); 326 | let high_flush_cards = [ 327 | &Card{suit:Suit::Hearts, rank:14}, 328 | &Card{suit:Suit::Hearts, rank:10}, 329 | &Card{suit:Suit::Hearts, rank:8}, 330 | &Card{suit:Suit::Hearts, rank:6}, 331 | &Card{suit:Suit::Hearts, rank:4}, 332 | ]; 333 | flush.sort(); 334 | assert_eq!(flush[0..5], high_flush_cards); 335 | } 336 | 337 | #[test] 338 | fn should_be_a_straight_flush_five_high() { 339 | let cards = [ 340 | &Card{suit:Suit::Hearts, rank:5}, 341 | &Card{suit:Suit::Hearts, rank:2}, 342 | &Card{suit:Suit::Hearts, rank:3}, 343 | &Card{suit:Suit::Hearts, rank:14}, 344 | &Card{suit:Suit::Hearts, rank:4} 345 | ]; 346 | let c = cards.clone(); 347 | let flush_result = is_straight_flush(c.to_vec()); 348 | assert_eq!(flush_result, Some(5)); 349 | } 350 | 351 | #[test] 352 | fn should_be_a_straight_flush_ace_high() { 353 | let cards = [ 354 | &Card{suit:Suit::Hearts, rank:14}, 355 | &Card{suit:Suit::Hearts, rank:13}, 356 | &Card{suit:Suit::Hearts, rank:12}, 357 | &Card{suit:Suit::Hearts, rank:10}, 358 | &Card{suit:Suit::Hearts, rank:11} 359 | ]; 360 | assert_eq!(is_straight_flush(cards.to_vec()), Some(14)); 361 | } 362 | 363 | #[test] 364 | fn should_be_a_straight_flush_jack_high() { 365 | let cards = [ 366 | &Card{suit:Suit::Hearts, rank:7}, 367 | &Card{suit:Suit::Hearts, rank:8}, 368 | &Card{suit:Suit::Hearts, rank:9}, 369 | &Card{suit:Suit::Hearts, rank:10}, 370 | &Card{suit:Suit::Hearts, rank:11} 371 | ]; 372 | assert_eq!(is_straight_flush(cards.to_vec()), Some(11)); 373 | } 374 | 375 | #[test] 376 | fn should_not_be_a_straight_flush() { 377 | let cards = [ 378 | &Card{suit:Suit::Hearts, rank:2}, 379 | &Card{suit:Suit::Hearts, rank:3}, 380 | &Card{suit:Suit::Hearts, rank:4}, 381 | &Card{suit:Suit::Hearts, rank:5}, 382 | &Card{suit:Suit::Diamonds, rank:6}, 383 | &Card{suit:Suit::Hearts, rank:7} 384 | ]; 385 | assert_eq!(is_straight_flush(cards.to_vec()), None); 386 | } 387 | 388 | #[test] 389 | fn should_be_a_diamonds_flush() { 390 | let cards = vec![ 391 | &Card{suit:Suit::Diamonds, rank:14}, 392 | &Card{suit:Suit::Diamonds, rank:10}, 393 | &Card{suit:Suit::Diamonds, rank:2}, 394 | &Card{suit:Suit::Diamonds, rank:4}, 395 | &Card{suit:Suit::Diamonds, rank:6} 396 | ]; 397 | let flush_result = is_flush(cards).unwrap(); 398 | assert_eq!(flush_result.rank, Ranks::Flush); 399 | } 400 | 401 | #[test] 402 | fn should_be_a_clubs_flush() { 403 | let cards = vec![ 404 | &Card{suit:Suit::Clubs, rank:14}, 405 | &Card{suit:Suit::Clubs, rank:10}, 406 | &Card{suit:Suit::Clubs, rank:2}, 407 | &Card{suit:Suit::Clubs, rank:4}, 408 | &Card{suit:Suit::Clubs, rank:6} 409 | ]; 410 | let flush_result = is_flush(cards).unwrap(); 411 | assert_eq!(flush_result.rank, Ranks::Flush); 412 | } 413 | 414 | #[test] 415 | fn should_be_a_spades_flush() { 416 | let cards = vec![ 417 | &Card{suit:Suit::Spades, rank:14}, 418 | &Card{suit:Suit::Spades, rank:10}, 419 | &Card{suit:Suit::Spades, rank:2}, 420 | &Card{suit:Suit::Spades, rank:4}, 421 | &Card{suit:Suit::Spades, rank:6} 422 | ]; 423 | let flush_result = is_flush(cards).unwrap(); 424 | assert_eq!(flush_result.rank, Ranks::Flush); 425 | } 426 | 427 | #[test] 428 | fn should_not_be_a_flush_1() { 429 | let cards = vec![ 430 | &Card{suit:Suit::Spades, rank:14}, 431 | &Card{suit:Suit::Hearts, rank:10}, 432 | &Card{suit:Suit::Spades, rank:2}, 433 | &Card{suit:Suit::Spades, rank:4}, 434 | &Card{suit:Suit::Spades, rank:6} 435 | ]; 436 | let flush_result = is_flush(cards); 437 | assert_eq!(flush_result, None); 438 | } 439 | 440 | #[test] 441 | fn should_not_be_a_flush_2() { 442 | let cards = vec![ 443 | &Card{suit:Suit::Hearts, rank:5}, 444 | &Card{suit:Suit::Hearts, rank:2}, 445 | &Card{suit:Suit::Clubs, rank:5}, 446 | &Card{suit:Suit::Clubs, rank:2}, 447 | &Card{suit:Suit::Diamonds, rank:5} 448 | ]; 449 | let flush_result = is_flush(cards); 450 | assert_eq!(flush_result, None); 451 | } 452 | 453 | 454 | } 455 | -------------------------------------------------------------------------------- /p2p/Cargo.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | name = "adler32" 3 | version = "1.0.3" 4 | source = "registry+https://github.com/rust-lang/crates.io-index" 5 | 6 | [[package]] 7 | name = "aho-corasick" 8 | version = "0.6.6" 9 | source = "registry+https://github.com/rust-lang/crates.io-index" 10 | dependencies = [ 11 | "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 12 | ] 13 | 14 | [[package]] 15 | name = "antidote" 16 | version = "1.0.0" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | 19 | [[package]] 20 | name = "base64" 21 | version = "0.6.0" 22 | source = "registry+https://github.com/rust-lang/crates.io-index" 23 | dependencies = [ 24 | "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 25 | "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 26 | ] 27 | 28 | [[package]] 29 | name = "bincode" 30 | version = "0.8.0" 31 | source = "registry+https://github.com/rust-lang/crates.io-index" 32 | dependencies = [ 33 | "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 34 | "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", 35 | "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", 36 | ] 37 | 38 | [[package]] 39 | name = "bitflags" 40 | version = "0.7.0" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | 43 | [[package]] 44 | name = "bitflags" 45 | version = "1.0.3" 46 | source = "registry+https://github.com/rust-lang/crates.io-index" 47 | 48 | [[package]] 49 | name = "build_const" 50 | version = "0.2.1" 51 | source = "registry+https://github.com/rust-lang/crates.io-index" 52 | 53 | [[package]] 54 | name = "byteorder" 55 | version = "1.1.0" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | 58 | [[package]] 59 | name = "bytes" 60 | version = "0.4.9" 61 | source = "registry+https://github.com/rust-lang/crates.io-index" 62 | dependencies = [ 63 | "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 64 | "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 65 | ] 66 | 67 | [[package]] 68 | name = "bzip2" 69 | version = "0.3.3" 70 | source = "registry+https://github.com/rust-lang/crates.io-index" 71 | dependencies = [ 72 | "bzip2-sys 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 73 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 74 | ] 75 | 76 | [[package]] 77 | name = "bzip2-sys" 78 | version = "0.1.6" 79 | source = "registry+https://github.com/rust-lang/crates.io-index" 80 | dependencies = [ 81 | "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", 82 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 83 | ] 84 | 85 | [[package]] 86 | name = "c_linked_list" 87 | version = "1.1.1" 88 | source = "registry+https://github.com/rust-lang/crates.io-index" 89 | 90 | [[package]] 91 | name = "cc" 92 | version = "1.0.18" 93 | source = "registry+https://github.com/rust-lang/crates.io-index" 94 | 95 | [[package]] 96 | name = "cfg-if" 97 | version = "0.1.4" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | 100 | [[package]] 101 | name = "chrono" 102 | version = "0.3.0" 103 | source = "registry+https://github.com/rust-lang/crates.io-index" 104 | dependencies = [ 105 | "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", 106 | "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", 107 | ] 108 | 109 | [[package]] 110 | name = "config_file_handler" 111 | version = "0.9.0" 112 | source = "registry+https://github.com/rust-lang/crates.io-index" 113 | dependencies = [ 114 | "fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", 115 | "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 116 | "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 117 | "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", 118 | "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", 119 | "unwrap 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 120 | ] 121 | 122 | [[package]] 123 | name = "crc" 124 | version = "1.8.1" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | dependencies = [ 127 | "build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 128 | ] 129 | 130 | [[package]] 131 | name = "crossbeam" 132 | version = "0.2.12" 133 | source = "registry+https://github.com/rust-lang/crates.io-index" 134 | 135 | [[package]] 136 | name = "crust" 137 | version = "0.30.1" 138 | source = "registry+https://github.com/rust-lang/crates.io-index" 139 | dependencies = [ 140 | "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 141 | "config_file_handler 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", 142 | "crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", 143 | "get_if_addrs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 144 | "igd 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 145 | "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 146 | "maidsafe_utilities 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", 147 | "mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)", 148 | "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", 149 | "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 150 | "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", 151 | "rust_sodium 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 152 | "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", 153 | "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", 154 | "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", 155 | "tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 156 | "unwrap 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 157 | ] 158 | 159 | [[package]] 160 | name = "dtoa" 161 | version = "0.4.3" 162 | source = "registry+https://github.com/rust-lang/crates.io-index" 163 | 164 | [[package]] 165 | name = "filetime" 166 | version = "0.2.1" 167 | source = "registry+https://github.com/rust-lang/crates.io-index" 168 | dependencies = [ 169 | "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 170 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 171 | "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", 172 | ] 173 | 174 | [[package]] 175 | name = "flate2" 176 | version = "0.2.20" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | dependencies = [ 179 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 180 | "miniz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 181 | ] 182 | 183 | [[package]] 184 | name = "flate2" 185 | version = "1.0.2" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | dependencies = [ 188 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 189 | "miniz_oxide_c_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 190 | ] 191 | 192 | [[package]] 193 | name = "fnv" 194 | version = "1.0.6" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | 197 | [[package]] 198 | name = "fs2" 199 | version = "0.4.3" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | dependencies = [ 202 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 203 | "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 204 | ] 205 | 206 | [[package]] 207 | name = "fuchsia-zircon" 208 | version = "0.3.3" 209 | source = "registry+https://github.com/rust-lang/crates.io-index" 210 | dependencies = [ 211 | "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 212 | "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 213 | ] 214 | 215 | [[package]] 216 | name = "fuchsia-zircon-sys" 217 | version = "0.3.3" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | 220 | [[package]] 221 | name = "gcc" 222 | version = "0.3.54" 223 | source = "registry+https://github.com/rust-lang/crates.io-index" 224 | 225 | [[package]] 226 | name = "get_if_addrs" 227 | version = "0.4.1" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | dependencies = [ 230 | "c_linked_list 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 231 | "get_if_addrs-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 232 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 233 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 234 | ] 235 | 236 | [[package]] 237 | name = "get_if_addrs-sys" 238 | version = "0.1.1" 239 | source = "registry+https://github.com/rust-lang/crates.io-index" 240 | dependencies = [ 241 | "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", 242 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 243 | ] 244 | 245 | [[package]] 246 | name = "httparse" 247 | version = "1.3.2" 248 | source = "registry+https://github.com/rust-lang/crates.io-index" 249 | 250 | [[package]] 251 | name = "humantime" 252 | version = "1.1.1" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | dependencies = [ 255 | "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 256 | ] 257 | 258 | [[package]] 259 | name = "hyper" 260 | version = "0.10.13" 261 | source = "registry+https://github.com/rust-lang/crates.io-index" 262 | dependencies = [ 263 | "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 264 | "httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 265 | "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 266 | "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 267 | "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 268 | "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", 269 | "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", 270 | "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 271 | "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 272 | "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 273 | "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 274 | ] 275 | 276 | [[package]] 277 | name = "idna" 278 | version = "0.1.5" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | dependencies = [ 281 | "matches 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 282 | "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 283 | "unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 284 | ] 285 | 286 | [[package]] 287 | name = "igd" 288 | version = "0.6.0" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | dependencies = [ 291 | "hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)", 292 | "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", 293 | "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 294 | "xml-rs 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 295 | "xmltree 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 296 | ] 297 | 298 | [[package]] 299 | name = "iovec" 300 | version = "0.1.2" 301 | source = "registry+https://github.com/rust-lang/crates.io-index" 302 | dependencies = [ 303 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 304 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 305 | ] 306 | 307 | [[package]] 308 | name = "itoa" 309 | version = "0.4.2" 310 | source = "registry+https://github.com/rust-lang/crates.io-index" 311 | 312 | [[package]] 313 | name = "kernel32-sys" 314 | version = "0.2.2" 315 | source = "registry+https://github.com/rust-lang/crates.io-index" 316 | dependencies = [ 317 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 318 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 319 | ] 320 | 321 | [[package]] 322 | name = "language-tags" 323 | version = "0.2.2" 324 | source = "registry+https://github.com/rust-lang/crates.io-index" 325 | 326 | [[package]] 327 | name = "lazy_static" 328 | version = "0.2.11" 329 | source = "registry+https://github.com/rust-lang/crates.io-index" 330 | 331 | [[package]] 332 | name = "lazy_static" 333 | version = "1.1.0" 334 | source = "registry+https://github.com/rust-lang/crates.io-index" 335 | dependencies = [ 336 | "version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 337 | ] 338 | 339 | [[package]] 340 | name = "lazycell" 341 | version = "0.6.0" 342 | source = "registry+https://github.com/rust-lang/crates.io-index" 343 | 344 | [[package]] 345 | name = "libc" 346 | version = "0.2.42" 347 | source = "registry+https://github.com/rust-lang/crates.io-index" 348 | 349 | [[package]] 350 | name = "linked-hash-map" 351 | version = "0.5.1" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | 354 | [[package]] 355 | name = "log" 356 | version = "0.3.9" 357 | source = "registry+https://github.com/rust-lang/crates.io-index" 358 | dependencies = [ 359 | "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", 360 | ] 361 | 362 | [[package]] 363 | name = "log" 364 | version = "0.4.3" 365 | source = "registry+https://github.com/rust-lang/crates.io-index" 366 | dependencies = [ 367 | "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 368 | ] 369 | 370 | [[package]] 371 | name = "log-mdc" 372 | version = "0.1.0" 373 | source = "registry+https://github.com/rust-lang/crates.io-index" 374 | 375 | [[package]] 376 | name = "log4rs" 377 | version = "0.7.0" 378 | source = "registry+https://github.com/rust-lang/crates.io-index" 379 | dependencies = [ 380 | "antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 381 | "chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 382 | "crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", 383 | "flate2 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 384 | "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 385 | "humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 386 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 387 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 388 | "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 389 | "log-mdc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 390 | "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", 391 | "serde-value 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", 392 | "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", 393 | "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", 394 | "serde_yaml 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", 395 | "toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 396 | "typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 397 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 398 | ] 399 | 400 | [[package]] 401 | name = "maidsafe_utilities" 402 | version = "0.15.0" 403 | source = "registry+https://github.com/rust-lang/crates.io-index" 404 | dependencies = [ 405 | "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", 406 | "config_file_handler 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", 407 | "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 408 | "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 409 | "log4rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 410 | "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 411 | "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", 412 | "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 413 | "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", 414 | "serde-value 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", 415 | "unwrap 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 416 | "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 417 | "ws 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", 418 | ] 419 | 420 | [[package]] 421 | name = "matches" 422 | version = "0.1.7" 423 | source = "registry+https://github.com/rust-lang/crates.io-index" 424 | 425 | [[package]] 426 | name = "memchr" 427 | version = "2.0.1" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | dependencies = [ 430 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 431 | ] 432 | 433 | [[package]] 434 | name = "mime" 435 | version = "0.2.6" 436 | source = "registry+https://github.com/rust-lang/crates.io-index" 437 | dependencies = [ 438 | "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 439 | ] 440 | 441 | [[package]] 442 | name = "miniz-sys" 443 | version = "0.1.10" 444 | source = "registry+https://github.com/rust-lang/crates.io-index" 445 | dependencies = [ 446 | "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", 447 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 448 | ] 449 | 450 | [[package]] 451 | name = "miniz_oxide" 452 | version = "0.1.3" 453 | source = "registry+https://github.com/rust-lang/crates.io-index" 454 | dependencies = [ 455 | "adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 456 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 457 | ] 458 | 459 | [[package]] 460 | name = "miniz_oxide_c_api" 461 | version = "0.1.3" 462 | source = "registry+https://github.com/rust-lang/crates.io-index" 463 | dependencies = [ 464 | "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", 465 | "crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)", 466 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 467 | "miniz_oxide 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 468 | ] 469 | 470 | [[package]] 471 | name = "mio" 472 | version = "0.6.15" 473 | source = "registry+https://github.com/rust-lang/crates.io-index" 474 | dependencies = [ 475 | "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 476 | "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 477 | "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 478 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 479 | "lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 480 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 481 | "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", 482 | "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 483 | "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", 484 | "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 485 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 486 | ] 487 | 488 | [[package]] 489 | name = "miow" 490 | version = "0.2.1" 491 | source = "registry+https://github.com/rust-lang/crates.io-index" 492 | dependencies = [ 493 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 494 | "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", 495 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 496 | "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 497 | ] 498 | 499 | [[package]] 500 | name = "msdos_time" 501 | version = "0.1.6" 502 | source = "registry+https://github.com/rust-lang/crates.io-index" 503 | dependencies = [ 504 | "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", 505 | "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 506 | ] 507 | 508 | [[package]] 509 | name = "net2" 510 | version = "0.2.33" 511 | source = "registry+https://github.com/rust-lang/crates.io-index" 512 | dependencies = [ 513 | "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 514 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 515 | "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 516 | ] 517 | 518 | [[package]] 519 | name = "num" 520 | version = "0.1.42" 521 | source = "registry+https://github.com/rust-lang/crates.io-index" 522 | dependencies = [ 523 | "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", 524 | "num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", 525 | "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", 526 | ] 527 | 528 | [[package]] 529 | name = "num-integer" 530 | version = "0.1.39" 531 | source = "registry+https://github.com/rust-lang/crates.io-index" 532 | dependencies = [ 533 | "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", 534 | ] 535 | 536 | [[package]] 537 | name = "num-iter" 538 | version = "0.1.37" 539 | source = "registry+https://github.com/rust-lang/crates.io-index" 540 | dependencies = [ 541 | "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", 542 | "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", 543 | ] 544 | 545 | [[package]] 546 | name = "num-traits" 547 | version = "0.1.43" 548 | source = "registry+https://github.com/rust-lang/crates.io-index" 549 | dependencies = [ 550 | "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", 551 | ] 552 | 553 | [[package]] 554 | name = "num-traits" 555 | version = "0.2.5" 556 | source = "registry+https://github.com/rust-lang/crates.io-index" 557 | 558 | [[package]] 559 | name = "num_cpus" 560 | version = "1.8.0" 561 | source = "registry+https://github.com/rust-lang/crates.io-index" 562 | dependencies = [ 563 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 564 | ] 565 | 566 | [[package]] 567 | name = "ordered-float" 568 | version = "0.5.0" 569 | source = "registry+https://github.com/rust-lang/crates.io-index" 570 | dependencies = [ 571 | "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", 572 | "unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 573 | ] 574 | 575 | [[package]] 576 | name = "p2p" 577 | version = "0.1.0" 578 | dependencies = [ 579 | "crust 0.30.1 (registry+https://github.com/rust-lang/crates.io-index)", 580 | ] 581 | 582 | [[package]] 583 | name = "percent-encoding" 584 | version = "1.0.1" 585 | source = "registry+https://github.com/rust-lang/crates.io-index" 586 | 587 | [[package]] 588 | name = "podio" 589 | version = "0.1.6" 590 | source = "registry+https://github.com/rust-lang/crates.io-index" 591 | 592 | [[package]] 593 | name = "proc-macro2" 594 | version = "0.4.9" 595 | source = "registry+https://github.com/rust-lang/crates.io-index" 596 | dependencies = [ 597 | "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 598 | ] 599 | 600 | [[package]] 601 | name = "quick-error" 602 | version = "1.2.2" 603 | source = "registry+https://github.com/rust-lang/crates.io-index" 604 | 605 | [[package]] 606 | name = "quote" 607 | version = "0.6.5" 608 | source = "registry+https://github.com/rust-lang/crates.io-index" 609 | dependencies = [ 610 | "proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", 611 | ] 612 | 613 | [[package]] 614 | name = "rand" 615 | version = "0.3.22" 616 | source = "registry+https://github.com/rust-lang/crates.io-index" 617 | dependencies = [ 618 | "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 619 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 620 | "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 621 | ] 622 | 623 | [[package]] 624 | name = "rand" 625 | version = "0.4.2" 626 | source = "registry+https://github.com/rust-lang/crates.io-index" 627 | dependencies = [ 628 | "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 629 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 630 | "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 631 | ] 632 | 633 | [[package]] 634 | name = "redox_syscall" 635 | version = "0.1.40" 636 | source = "registry+https://github.com/rust-lang/crates.io-index" 637 | 638 | [[package]] 639 | name = "regex" 640 | version = "0.2.11" 641 | source = "registry+https://github.com/rust-lang/crates.io-index" 642 | dependencies = [ 643 | "aho-corasick 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", 644 | "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 645 | "regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", 646 | "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 647 | "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 648 | ] 649 | 650 | [[package]] 651 | name = "regex-syntax" 652 | version = "0.5.6" 653 | source = "registry+https://github.com/rust-lang/crates.io-index" 654 | dependencies = [ 655 | "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 656 | ] 657 | 658 | [[package]] 659 | name = "rust_sodium" 660 | version = "0.7.0" 661 | source = "registry+https://github.com/rust-lang/crates.io-index" 662 | dependencies = [ 663 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 664 | "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", 665 | "rust_sodium-sys 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", 666 | "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", 667 | "unwrap 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 668 | ] 669 | 670 | [[package]] 671 | name = "rust_sodium-sys" 672 | version = "0.7.2" 673 | source = "registry+https://github.com/rust-lang/crates.io-index" 674 | dependencies = [ 675 | "flate2 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 676 | "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", 677 | "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 678 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 679 | "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", 680 | "tar 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)", 681 | "unwrap 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 682 | "zip 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 683 | ] 684 | 685 | [[package]] 686 | name = "safemem" 687 | version = "0.2.0" 688 | source = "registry+https://github.com/rust-lang/crates.io-index" 689 | 690 | [[package]] 691 | name = "serde" 692 | version = "1.0.70" 693 | source = "registry+https://github.com/rust-lang/crates.io-index" 694 | 695 | [[package]] 696 | name = "serde-value" 697 | version = "0.5.2" 698 | source = "registry+https://github.com/rust-lang/crates.io-index" 699 | dependencies = [ 700 | "ordered-float 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", 701 | "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", 702 | ] 703 | 704 | [[package]] 705 | name = "serde_derive" 706 | version = "1.0.70" 707 | source = "registry+https://github.com/rust-lang/crates.io-index" 708 | dependencies = [ 709 | "proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", 710 | "quote 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", 711 | "syn 0.14.7 (registry+https://github.com/rust-lang/crates.io-index)", 712 | ] 713 | 714 | [[package]] 715 | name = "serde_json" 716 | version = "1.0.24" 717 | source = "registry+https://github.com/rust-lang/crates.io-index" 718 | dependencies = [ 719 | "dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", 720 | "itoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 721 | "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", 722 | ] 723 | 724 | [[package]] 725 | name = "serde_yaml" 726 | version = "0.7.5" 727 | source = "registry+https://github.com/rust-lang/crates.io-index" 728 | dependencies = [ 729 | "dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", 730 | "linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 731 | "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", 732 | "yaml-rust 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 733 | ] 734 | 735 | [[package]] 736 | name = "sha1" 737 | version = "0.2.0" 738 | source = "registry+https://github.com/rust-lang/crates.io-index" 739 | 740 | [[package]] 741 | name = "slab" 742 | version = "0.3.0" 743 | source = "registry+https://github.com/rust-lang/crates.io-index" 744 | 745 | [[package]] 746 | name = "slab" 747 | version = "0.4.1" 748 | source = "registry+https://github.com/rust-lang/crates.io-index" 749 | 750 | [[package]] 751 | name = "syn" 752 | version = "0.14.7" 753 | source = "registry+https://github.com/rust-lang/crates.io-index" 754 | dependencies = [ 755 | "proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", 756 | "quote 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", 757 | "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 758 | ] 759 | 760 | [[package]] 761 | name = "tar" 762 | version = "0.4.16" 763 | source = "registry+https://github.com/rust-lang/crates.io-index" 764 | dependencies = [ 765 | "filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 766 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 767 | "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", 768 | "xattr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 769 | ] 770 | 771 | [[package]] 772 | name = "thread_local" 773 | version = "0.3.5" 774 | source = "registry+https://github.com/rust-lang/crates.io-index" 775 | dependencies = [ 776 | "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 777 | "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 778 | ] 779 | 780 | [[package]] 781 | name = "time" 782 | version = "0.1.40" 783 | source = "registry+https://github.com/rust-lang/crates.io-index" 784 | dependencies = [ 785 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 786 | "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", 787 | "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 788 | ] 789 | 790 | [[package]] 791 | name = "tiny-keccak" 792 | version = "1.3.1" 793 | source = "registry+https://github.com/rust-lang/crates.io-index" 794 | 795 | [[package]] 796 | name = "toml" 797 | version = "0.4.6" 798 | source = "registry+https://github.com/rust-lang/crates.io-index" 799 | dependencies = [ 800 | "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", 801 | ] 802 | 803 | [[package]] 804 | name = "traitobject" 805 | version = "0.1.0" 806 | source = "registry+https://github.com/rust-lang/crates.io-index" 807 | 808 | [[package]] 809 | name = "typeable" 810 | version = "0.1.2" 811 | source = "registry+https://github.com/rust-lang/crates.io-index" 812 | 813 | [[package]] 814 | name = "typemap" 815 | version = "0.3.3" 816 | source = "registry+https://github.com/rust-lang/crates.io-index" 817 | dependencies = [ 818 | "unsafe-any 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 819 | ] 820 | 821 | [[package]] 822 | name = "ucd-util" 823 | version = "0.1.1" 824 | source = "registry+https://github.com/rust-lang/crates.io-index" 825 | 826 | [[package]] 827 | name = "unicase" 828 | version = "1.4.2" 829 | source = "registry+https://github.com/rust-lang/crates.io-index" 830 | dependencies = [ 831 | "version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 832 | ] 833 | 834 | [[package]] 835 | name = "unicode-bidi" 836 | version = "0.3.4" 837 | source = "registry+https://github.com/rust-lang/crates.io-index" 838 | dependencies = [ 839 | "matches 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 840 | ] 841 | 842 | [[package]] 843 | name = "unicode-normalization" 844 | version = "0.1.7" 845 | source = "registry+https://github.com/rust-lang/crates.io-index" 846 | 847 | [[package]] 848 | name = "unicode-xid" 849 | version = "0.1.0" 850 | source = "registry+https://github.com/rust-lang/crates.io-index" 851 | 852 | [[package]] 853 | name = "unreachable" 854 | version = "0.1.1" 855 | source = "registry+https://github.com/rust-lang/crates.io-index" 856 | dependencies = [ 857 | "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 858 | ] 859 | 860 | [[package]] 861 | name = "unreachable" 862 | version = "1.0.0" 863 | source = "registry+https://github.com/rust-lang/crates.io-index" 864 | dependencies = [ 865 | "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 866 | ] 867 | 868 | [[package]] 869 | name = "unsafe-any" 870 | version = "0.4.2" 871 | source = "registry+https://github.com/rust-lang/crates.io-index" 872 | dependencies = [ 873 | "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 874 | ] 875 | 876 | [[package]] 877 | name = "unwrap" 878 | version = "1.1.0" 879 | source = "registry+https://github.com/rust-lang/crates.io-index" 880 | 881 | [[package]] 882 | name = "url" 883 | version = "1.5.1" 884 | source = "registry+https://github.com/rust-lang/crates.io-index" 885 | dependencies = [ 886 | "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 887 | "matches 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 888 | "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 889 | ] 890 | 891 | [[package]] 892 | name = "utf8-ranges" 893 | version = "1.0.0" 894 | source = "registry+https://github.com/rust-lang/crates.io-index" 895 | 896 | [[package]] 897 | name = "version_check" 898 | version = "0.1.4" 899 | source = "registry+https://github.com/rust-lang/crates.io-index" 900 | 901 | [[package]] 902 | name = "void" 903 | version = "1.0.2" 904 | source = "registry+https://github.com/rust-lang/crates.io-index" 905 | 906 | [[package]] 907 | name = "winapi" 908 | version = "0.2.8" 909 | source = "registry+https://github.com/rust-lang/crates.io-index" 910 | 911 | [[package]] 912 | name = "winapi" 913 | version = "0.3.5" 914 | source = "registry+https://github.com/rust-lang/crates.io-index" 915 | dependencies = [ 916 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 917 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 918 | ] 919 | 920 | [[package]] 921 | name = "winapi-build" 922 | version = "0.1.1" 923 | source = "registry+https://github.com/rust-lang/crates.io-index" 924 | 925 | [[package]] 926 | name = "winapi-i686-pc-windows-gnu" 927 | version = "0.4.0" 928 | source = "registry+https://github.com/rust-lang/crates.io-index" 929 | 930 | [[package]] 931 | name = "winapi-x86_64-pc-windows-gnu" 932 | version = "0.4.0" 933 | source = "registry+https://github.com/rust-lang/crates.io-index" 934 | 935 | [[package]] 936 | name = "ws" 937 | version = "0.7.3" 938 | source = "registry+https://github.com/rust-lang/crates.io-index" 939 | dependencies = [ 940 | "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 941 | "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", 942 | "httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 943 | "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 944 | "mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)", 945 | "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", 946 | "sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 947 | "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 948 | "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 949 | ] 950 | 951 | [[package]] 952 | name = "ws2_32-sys" 953 | version = "0.2.1" 954 | source = "registry+https://github.com/rust-lang/crates.io-index" 955 | dependencies = [ 956 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 957 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 958 | ] 959 | 960 | [[package]] 961 | name = "xattr" 962 | version = "0.2.2" 963 | source = "registry+https://github.com/rust-lang/crates.io-index" 964 | dependencies = [ 965 | "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", 966 | ] 967 | 968 | [[package]] 969 | name = "xml-rs" 970 | version = "0.3.6" 971 | source = "registry+https://github.com/rust-lang/crates.io-index" 972 | dependencies = [ 973 | "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 974 | ] 975 | 976 | [[package]] 977 | name = "xmltree" 978 | version = "0.3.2" 979 | source = "registry+https://github.com/rust-lang/crates.io-index" 980 | dependencies = [ 981 | "xml-rs 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 982 | ] 983 | 984 | [[package]] 985 | name = "yaml-rust" 986 | version = "0.4.0" 987 | source = "registry+https://github.com/rust-lang/crates.io-index" 988 | dependencies = [ 989 | "linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 990 | ] 991 | 992 | [[package]] 993 | name = "zip" 994 | version = "0.2.8" 995 | source = "registry+https://github.com/rust-lang/crates.io-index" 996 | dependencies = [ 997 | "bzip2 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 998 | "flate2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 999 | "msdos_time 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 1000 | "podio 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 1001 | "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", 1002 | ] 1003 | 1004 | [metadata] 1005 | "checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c" 1006 | "checksum aho-corasick 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c1c6d463cbe7ed28720b5b489e7c083eeb8f90d08be2a0d6bb9e1ffea9ce1afa" 1007 | "checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" 1008 | "checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" 1009 | "checksum bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e103c8b299b28a9c6990458b7013dc4a8356a9b854c51b9883241f5866fac36e" 1010 | "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" 1011 | "checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789" 1012 | "checksum build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39" 1013 | "checksum byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff81738b726f5d099632ceaffe7fb65b90212e8dce59d518729e7e8634032d3d" 1014 | "checksum bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e178b8e0e239e844b083d5a0d4a156b2654e67f9f80144d48398fcd736a24fb8" 1015 | "checksum bzip2 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "42b7c3cbf0fa9c1b82308d57191728ca0256cb821220f4e2fd410a72ade26e3b" 1016 | "checksum bzip2-sys 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2c5162604199bbb17690ede847eaa6120a3f33d5ab4dcc8e7c25b16d849ae79b" 1017 | "checksum c_linked_list 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b" 1018 | "checksum cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "2119ea4867bd2b8ed3aecab467709720b2d55b1bcfe09f772fd68066eaf15275" 1019 | "checksum cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efe5c877e17a9c717a0bf3613b2709f723202c4e4675cc8f12926ded29bcb17e" 1020 | "checksum chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "158b0bd7d75cbb6bf9c25967a48a2e9f77da95876b858eadfabaa99cd069de6e" 1021 | "checksum config_file_handler 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "188bcbe62ddef12bd9241a866b4348e76a3162b080cc36d905e51b2fced78afa" 1022 | "checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb" 1023 | "checksum crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "bd66663db5a988098a89599d4857919b3acf7f61402e61365acfd3919857b9be" 1024 | "checksum crust 0.30.1 (registry+https://github.com/rust-lang/crates.io-index)" = "893d9f72b082c86426941394d6e03a87f69ab0c7cda0e06e24c0097f2d428875" 1025 | "checksum dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6d301140eb411af13d3115f9a562c85cc6b541ade9dfa314132244aaee7489dd" 1026 | "checksum filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "da4b9849e77b13195302c174324b5ba73eec9b236b24c221a61000daefb95c5f" 1027 | "checksum flate2 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)" = "e6234dd4468ae5d1e2dbb06fe2b058696fdc50a339c68a393aefbf00bc81e423" 1028 | "checksum flate2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "37847f133aae7acf82bb9577ccd8bda241df836787642654286e79679826a54b" 1029 | "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" 1030 | "checksum fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" 1031 | "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 1032 | "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 1033 | "checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" 1034 | "checksum get_if_addrs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "da2383c2f4e45082129ad20f4a309aaa1f26c9ed4045082902bc2951ec9c6a3c" 1035 | "checksum get_if_addrs-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0d04f9fb746cf36b191c00f3ede8bde9c8e64f9f4b05ae2694a9ccf5e3f5ab48" 1036 | "checksum httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7b6288d7db100340ca12873fd4d08ad1b8f206a9457798dfb17c018a33fee540" 1037 | "checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e" 1038 | "checksum hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)" = "368cb56b2740ebf4230520e2b90ebb0461e69034d85d1945febd9b3971426db2" 1039 | "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" 1040 | "checksum igd 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "356a0dc23a4fa0f8ce4777258085d00a01ea4923b2efd93538fc44bf5e1bda76" 1041 | "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" 1042 | "checksum itoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5adb58558dcd1d786b5f0bd15f3226ee23486e24b7b58304b60f64dc68e62606" 1043 | "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 1044 | "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" 1045 | "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" 1046 | "checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7" 1047 | "checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef" 1048 | "checksum libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" = "b685088df2b950fccadf07a7187c8ef846a959c142338a48f9dc0b94517eb5f1" 1049 | "checksum linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "70fb39025bc7cdd76305867c4eccf2f2dcf6e9a57f5b21a93e1c2d86cd03ec9e" 1050 | "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" 1051 | "checksum log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "61bd98ae7f7b754bc53dca7d44b604f733c6bba044ea6f41bc8d89272d8161d2" 1052 | "checksum log-mdc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a94d21414c1f4a51209ad204c1776a3d0765002c76c6abcb602a6f09f1e881c7" 1053 | "checksum log4rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e9beb5748c7d304a7c07e74ff2f0e642146a1191f8e9d9fb398e46ccb128364d" 1054 | "checksum maidsafe_utilities 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ceb3a658ae69e9ee8856350c4b89228795d91b435edc543591596f2af2eb2e20" 1055 | "checksum matches 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "835511bab37c34c47da5cb44844bea2cfde0236db0b506f90ea4224482c9774a" 1056 | "checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d" 1057 | "checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" 1058 | "checksum miniz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "609ce024854aeb19a0ef7567d348aaa5a746b32fb72e336df7fcc16869d7e2b4" 1059 | "checksum miniz_oxide 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9ba430291c9d6cedae28bcd2d49d1c32fc57d60cd49086646c5dd5673a870eb5" 1060 | "checksum miniz_oxide_c_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5a5b8234d6103ebfba71e29786da4608540f862de5ce980a1c94f86a40ca0d51" 1061 | "checksum mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)" = "4fcfcb32d63961fb6f367bfd5d21e4600b92cd310f71f9dca25acae196eb1560" 1062 | "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 1063 | "checksum msdos_time 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aad9dfe950c057b1bfe9c1f2aa51583a8468ef2a5baba2ebbe06d775efeb7729" 1064 | "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" 1065 | "checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" 1066 | "checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" 1067 | "checksum num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "af3fdbbc3291a5464dc57b03860ec37ca6bf915ed6ee385e7c6c052c422b2124" 1068 | "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" 1069 | "checksum num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "630de1ef5cc79d0cdd78b7e33b81f083cbfe90de0f4b2b2f07f905867c70e9fe" 1070 | "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" 1071 | "checksum ordered-float 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "58d25b6c0e47b20d05226d288ff434940296e7e2f8b877975da32f862152241f" 1072 | "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" 1073 | "checksum podio 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "780fb4b6698bbf9cf2444ea5d22411cef2953f0824b98f33cf454ec5615645bd" 1074 | "checksum proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "cccdc7557a98fe98453030f077df7f3a042052fae465bb61d2c2c41435cfd9b6" 1075 | "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" 1076 | "checksum quote 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3372dc35766b36a99ce2352bd1b6ea0137c38d215cc0c8780bf6de6df7842ba9" 1077 | "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" 1078 | "checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" 1079 | "checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" 1080 | "checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" 1081 | "checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" 1082 | "checksum rust_sodium 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "145c50afac9d9a031179ad1fd9ba1fb27220398cba0e13530189ae8ce4dd654b" 1083 | "checksum rust_sodium-sys 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c58cb4685d283e56bc6c654dd212056786518f83fab7ad435dbd00301a4fd756" 1084 | "checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" 1085 | "checksum serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)" = "0c3adf19c07af6d186d91dae8927b83b0553d07ca56cbf7f2f32560455c91920" 1086 | "checksum serde-value 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "52903ade2290cbd61a0937a66a268f26cebf246e3ddd7964a8babb297111fb0d" 1087 | "checksum serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)" = "3525a779832b08693031b8ecfb0de81cd71cfd3812088fafe9a7496789572124" 1088 | "checksum serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c6908c7b925cd6c590358a4034de93dbddb20c45e1d021931459fd419bf0e2" 1089 | "checksum serde_yaml 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ef8099d3df28273c99a1728190c7a9f19d444c941044f64adf986bee7ec53051" 1090 | "checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c" 1091 | "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" 1092 | "checksum slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d" 1093 | "checksum syn 0.14.7 (registry+https://github.com/rust-lang/crates.io-index)" = "e2e13df71f29f9440b50261a5882c86eac334f1badb3134ec26f0de2f1418e44" 1094 | "checksum tar 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)" = "e8f41ca4a5689f06998f0247fcb60da6c760f1950cc9df2a10d71575ad0b062a" 1095 | "checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963" 1096 | "checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" 1097 | "checksum tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d52d12ad79e4063e0cb0ca5efa202ed7244b6ce4d25f4d3abe410b2a66128292" 1098 | "checksum toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a0263c6c02c4db6c8f7681f9fd35e90de799ebd4cfdeab77a38f4ff6b3d8c0d9" 1099 | "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" 1100 | "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" 1101 | "checksum typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6" 1102 | "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" 1103 | "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" 1104 | "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 1105 | "checksum unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6a0180bc61fc5a987082bfa111f4cc95c4caff7f9799f3e46df09163a937aa25" 1106 | "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" 1107 | "checksum unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91" 1108 | "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" 1109 | "checksum unsafe-any 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f30360d7979f5e9c6e6cea48af192ea8fab4afb3cf72597154b8f08935bc9c7f" 1110 | "checksum unwrap 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "999361f54269ac2f0832a39b238ffe077ffa15ff7f6f696968a51164eaffa472" 1111 | "checksum url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb819346883532a271eb626deb43c4a1bb4c4dd47c519bd78137c3e72a4fe27" 1112 | "checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" 1113 | "checksum version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7716c242968ee87e5542f8021178248f267f295a5c4803beae8b8b7fd9bc6051" 1114 | "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 1115 | "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 1116 | "checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd" 1117 | "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 1118 | "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1119 | "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1120 | "checksum ws 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "89c48c53bf9dee34411a08993c10b879c36e105d609b46e25673befe3a5c1320" 1121 | "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 1122 | "checksum xattr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c" 1123 | "checksum xml-rs 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7ec6c39eaa68382c8e31e35239402c0a9489d4141a8ceb0c716099a0b515b562" 1124 | "checksum xmltree 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "472a9d37c7c53ab2391161df5b89b1f3bf76dab6ab150d7941ecbdd832282082" 1125 | "checksum yaml-rust 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57ab38ee1a4a266ed033496cf9af1828d8d6e6c1cfa5f643a2809effcae4d628" 1126 | "checksum zip 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "e7341988e4535c60882d5e5f0b7ad0a9a56b080ade8bdb5527cb512f7b2180e0" 1127 | --------------------------------------------------------------------------------