// Generated by IcedCoffeeScript 1.8.0-e
(function() {
  var Base, Revoke, constants, iced, __iced_k, __iced_k_noop,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  iced = require('iced-runtime');
  __iced_k = __iced_k_noop = function() {};

  Base = require('./base').Base;

  constants = require('./constants').constants;

  exports.Revoke = Revoke = (function(_super) {
    __extends(Revoke, _super);

    function Revoke() {
      return Revoke.__super__.constructor.apply(this, arguments);
    }

    Revoke.prototype._type = function() {
      return constants.sig_types.revoke;
    };

    Revoke.prototype._required_sections = function() {
      return Revoke.__super__._required_sections.call(this).concat(["revoke"]);
    };

    Revoke.prototype._optional_sections = function() {
      return Revoke.__super__._optional_sections.call(this).concat(["device"]);
    };

    Revoke.prototype._v_check = function(_arg, cb) {
      var err, json, r, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      json = _arg.json;
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/Users/robert/Desktop/proofs/src/revoke.iced",
            funcname: "Revoke._v_check"
          });
          Revoke.__super__._v_check.call(_this, {
            json: json
          }, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return err = arguments[0];
              };
            })(),
            lineno: 14
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          var _ref;
          err = err != null ? err : (r = (_ref = json.body) != null ? _ref.revoke : void 0) == null ? new Error("Need a 'revoke' section of the signature block") : !(r.sig_id != null) && !(r.sig_ids != null) && !(r.kid != null) && !(r.kids != null) ? new Error("Need one of sig_id/sig_ids/kid/kids in signature revoke block") : void 0;
          return cb(err);
        };
      })(this));
    };

    return Revoke;

  })(Base);

}).call(this);
