<commit_before>pragma solidity ^0.4.2;

import "./priced.sol";
import "./stateMachine.sol";
import "./accessRestricted.sol";

/// @title Brehon Contract
contract BrehonContract is
    priced,
    stateMachine,
    accessRestricted {
  struct Party {
    address addr;
    bool primaryBrehonApproval;
    bool secondaryBrehonApproval;
    bool tertiaryBrehonApproval;
  }

  struct Brehon {
    address addr;
    uint fixedFee;
    uint disputeFee;
  }

  Party partyA;
  Party partyB;
  address primaryBrehon;
  address secondaryBrehon;
  address tertiaryBrehon;
  mapping (address => uint) balances;

  function BrehonContract(address _partyA, address _partyB) {
    stage = Stages.Negotiation;
    partyA.addr = _partyA;
    partyB.addr = _partyB;
  }

  function assignPartyA(address _partyA)
    atStage(Stages.Negotiation) 
  {
    partyA.addr = _partyA;
  }

  function assignPartyB(address _partyB)
    atStage(Stages.Negotiation)
  {
    partyB.addr = _partyB;
  }

  function nominatePrimaryBrehon(address _primaryBrehon)
    atStage(Stages.Negotiation)
    eitherBy(partyA.addr, partyB.addr)
  {
    if(msg.sender == partyA.addr &&
      !partyA.primaryBrehonApproval) {
      partyA.primaryBrehonApproval = true;
    }
    if(msg.sender == partyB.addr &&
      !partyB.primaryBrehonApproval) {
      partyB.primaryBrehonApproval = true;
    }
    primaryBrehon = _primaryBrehon;
  }

  function assignSecondaryBrehon(address _secondaryBrehon)
    atStage(Stages.Negotiation)
  {
    secondaryBrehon = _secondaryBrehon;
  }

  function assignTertiaryBrehon(address _tertiaryBrehon)
    atStage(Stages.Negotiation)
  {
    tertiaryBrehon = _tertiaryBrehon;
  }

  function deposit() {
  }

  function startContract() {
  }

  function raiseDispute() {
  }

  function getActiveBrehon() {
  }

  function arbitrate() {
  }

  function claimFunds() {
  }

  function raiseAppeal() {
  }

  function raise2ndAppeal() {
  }
}<commit_msg>Fixed the nomination and assigning methods<commit_after>pragma solidity ^0.4.2;

import "./priced.sol";
import "./stateMachine.sol";
import "./accessRestricted.sol";

/// @title Brehon Contract
contract BrehonContract is
    priced,
    stateMachine,
    accessRestricted {
  struct Party {
    address addr;
    bool primaryBrehonApproval;
    bool secondaryBrehonApproval;
    bool tertiaryBrehonApproval;
  }

  struct Brehon {
    address addr;
    uint fixedFee;
    uint disputeFee;
  }

  Party partyA;
  Party partyB;
  Brehon primaryBrehon;
  Brehon secondaryBrehon;
  Brehon tertiaryBrehon;
  mapping (address => uint) balances;

  function BrehonContract(address _partyA, address _partyB) {
    stage = Stages.Negotiation;
    partyA.addr = _partyA;
    partyB.addr = _partyB;
  }

  function assignPartyA(address _partyA)
    atStage(Stages.Negotiation) 
  {
    partyA.addr = _partyA;
  }

  function assignPartyB(address _partyB)
    atStage(Stages.Negotiation)
  {
    partyB.addr = _partyB;
  }

  function nominatePrimaryBrehon(address _primaryBrehon, uint _fixedFee, uint _disputeFee)
    atStage(Stages.Negotiation)
    eitherBy(partyA.addr, partyB.addr)
  {
    if(msg.sender == partyA.addr &&
      !partyA.primaryBrehonApproval) {
      partyA.primaryBrehonApproval = true;
    }
    if(msg.sender == partyB.addr &&
      !partyB.primaryBrehonApproval) {
      partyB.primaryBrehonApproval = true;
    }
    primaryBrehon.addr = _primaryBrehon;
    primaryBrehon.fixedFee = _fixedFee;
    primaryBrehon.disputeFee = _disputeFee;
  }

  function assignSecondaryBrehon(address _secondaryBrehon, uint _fixedFee, uint _disputeFee)
    atStage(Stages.Negotiation)
  {
    secondaryBrehon.addr = _secondaryBrehon;
    secondaryBrehon.fixedFee = _fixedFee;
    secondaryBrehon.disputeFee = _disputeFee;
  }

  function assignTertiaryBrehon(address _tertiaryBrehon, uint _fixedFee, uint _disputeFee)
    atStage(Stages.Negotiation)
  {
    tertiaryBrehon.addr = _tertiaryBrehon;
    tertiaryBrehon.fixedFee = _fixedFee;
    tertiaryBrehon.disputeFee = _disputeFee;
  }

  function deposit() {
  }

  function startContract() {
  }

  function raiseDispute() {
  }

  function getActiveBrehon() {
  }

  function arbitrate() {
  }

  function claimFunds() {
  }

  function raiseAppeal() {
  }

  function raise2ndAppeal() {
  }
}
{'fraction_non_alphanumeric': 0.0912485414235706, 'fraction_numerical': 0.0018669778296382731, 'mean_word_length': 3.45067497403946, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4711106', 'n_tokens_mistral': 1570, 'n_tokens_neox': 1438, 'n_words': 267}