'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _lodash = require('lodash');

var _lodash2 = _interopRequireDefault(_lodash);

var _isRequired = require('../utils/isRequired');

var _isRequired2 = _interopRequireDefault(_isRequired);

var _delegateCalls = require('../utils/delegateCalls');

var _delegateCalls2 = _interopRequireDefault(_delegateCalls);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Abstract Contract holds a contract implementation to make calls to the blockchain but
 * also includes methods that interact with the off chain store. NOTE all methods that
 * the underlying contract implementation expose can be called directly from an Abstract contract.
 */
var AbstractContract =
/**
 * AbstractContract wraps an implementation instance to provide access to higher level
 * services such as an off chain store, as well as the functionality of the underlying
 * implementation.
 * @param {object} implementationInstance - Contract Implementation object to extend
 * @param {object} storeProviderInstance - StoreProvider wrapper object.
 */
function AbstractContract() {
  var implementationInstance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _isRequired2.default)('implementationInstance');
  var storeProviderInstance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _isRequired2.default)('storeProviderInstance');
  (0, _classCallCheck3.default)(this, AbstractContract);

  _initialiseProps.call(this);

  this._StoreProvider = storeProviderInstance;
  this._contractImplementation = implementationInstance;
  (0, _delegateCalls2.default)(this, implementationInstance);
}

/**
 * Set store provider instance.
 * @param {object} storeProviderInstance - instance of store provider wrapper.
 */
;

var _initialiseProps = function _initialiseProps() {
  var _this = this;

  this.setStoreProviderInstance = function (storeProviderInstance) {
    _this._StoreProvider = storeProviderInstance;
  };
};

exports.default = AbstractContract;
//# sourceMappingURL=AbstractContract.js.map