import _regeneratorRuntime from 'babel-runtime/regenerator';
import _asyncToGenerator from 'babel-runtime/helpers/asyncToGenerator';
import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
import ArbitrablePermissionListArtifact from 'kleros-interaction/build/contracts/ArbitrablePermissionList';

import * as ethConstants from '../../../constants/eth';
import Arbitrable from './Arbitrable';
import deployContractAsync from '../../../utils/deployContractAsync';

/**
 * Provides interaction with an Arbitrable Transaction contract deployed on the blockchain.
 */

var ArbitrablePermissionList = function (_Arbitrable) {
  _inherits(ArbitrablePermissionList, _Arbitrable);

  /**
   * Constructor ArbitrableTransaction.
   * @param {object} web3Provider instance
   * @param {string} contractAddress of the contract
   */
  function ArbitrablePermissionList(web3Provider, contractAddress) {
    var _this2 = this;

    _classCallCheck(this, ArbitrablePermissionList);

    var _this = _possibleConstructorReturn(this, (ArbitrablePermissionList.__proto__ || _Object$getPrototypeOf(ArbitrablePermissionList)).call(this, web3Provider, ArbitrablePermissionListArtifact, contractAddress));

    _this.getItemByDisputeId = function () {
      var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(disputeId) {
        return _regeneratorRuntime.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                _context.next = 2;
                return _this.loadContract();

              case 2:
                return _context.abrupt('return', _this.contractInstance.disputeIDToItem(disputeId));

              case 3:
              case 'end':
                return _context.stop();
            }
          }
        }, _callee, _this2);
      }));

      return function (_x) {
        return _ref.apply(this, arguments);
      };
    }();

    return _this;
  }

  /**
   * Deploy ArbitrablePermissionList. TODO
   * @param {object} account Ethereum account (default account[0])
   * @param {number} value funds to be placed in contract
   * @param {object} web3Provider web3 provider object
   * @returns {object} truffle-contract Object | err The deployed contract or an error
   */
  // static deploy = async (
  //   account,
  //   value = ethConstants.TRANSACTION.VALUE,
  //   web3Provider
  // ) => {
  //   // const contractDeployed = await deployContractAsync()
  //   //
  //   // return contractDeployed
  // }

  return ArbitrablePermissionList;
}(Arbitrable);

export default ArbitrablePermissionList;
//# sourceMappingURL=ArbitrablePermissionList.js.map