diff --git a/community/community.abi b/community/community.abi index 512ba4c..b8ab306 100644 --- a/community/community.abi +++ b/community/community.abi @@ -553,6 +553,20 @@ } ] }, + { + "name": "revokebadge", + "base": "", + "fields": [ + { + "name": "community_account", + "type": "name" + }, + { + "name": "revoke_badge_propose_name", + "type": "name" + } + ] + }, { "name": "setaccess", "base": "", @@ -1319,6 +1333,11 @@ "type": "proposecode", "ricardian_contract": "" }, + { + "name": "revokebadge", + "type": "revokebadge", + "ricardian_contract": "" + }, { "name": "setaccess", "type": "setaccess", @@ -1429,7 +1448,7 @@ "key_types": [] }, { - "name": "v1.cert", + "name": "v1.certs", "type": "v1_cert", "index_type": "i64", "key_names": [], diff --git a/community/community.wasm b/community/community.wasm index 45183be..db52f4b 100755 Binary files a/community/community.wasm and b/community/community.wasm differ diff --git a/community/include/community.hpp b/community/include/community.hpp index 51c5897..ba49a85 100644 --- a/community/include/community.hpp +++ b/community/include/community.hpp @@ -61,6 +61,7 @@ CONTRACT community : public contract POSITION_DISMISS, BADGE_CONFIG, BADGE_ISSUE, + BADGE_REVOKE, }; enum BadgeIssueType { @@ -247,6 +248,8 @@ CONTRACT community : public contract ACTION issuebadge(name community_account, name badge_propose_name); + ACTION revokebadge(name community_account, name revoke_badge_propose_name); + ACTION setconfig( name community_creator_name, name cryptobadge_contract_name, @@ -260,6 +263,25 @@ CONTRACT community : public contract ); private: + void create_issue_badge_code( + name community_account, + uint64_t badge_id, + uint8_t issue_type, + uint8_t issue_exec_type, + RightHolder right_issue_sole_executor, + RightHolder right_issue_proposer, + uint8_t issue_approval_type, + RightHolder right_issue_approver, + RightHolder right_issue_voter, + double issue_pass_rule, + uint64_t issue_vote_duration, + name ram_payer + ); + + void create_config_badge_code_for_admin(name community_account, uint64_t badge_id, name ram_payer); + + void create_revoke_badge_code_for_admin(name community_account, uint64_t badge_id, name ram_payer); + bool verify_approver(name community_account, name voter, uint64_t code_id, bool is_ammnend_code); bool verify_voter(name community_account, name voter, uint64_t code_id, bool is_amend_code); @@ -552,7 +574,7 @@ CONTRACT community : public contract } }; - typedef eosio::multi_index<"v1.cert"_n, v1_cert, + typedef eosio::multi_index<"v1.certs"_n, v1_cert, eosio::indexed_by<"badgeid"_n, eosio::const_mem_fun>, eosio::indexed_by<"owner"_n, eosio::const_mem_fun>> v1_cert_table; @@ -577,6 +599,7 @@ CONTRACT community : public contract ((v1.amenexec)(v1_sole_decision)(v1_amend_sole_decision_table)) ((v1.filling)(v1_election_rule)(v1_election_table)) ((v1.pproposal)(v1_pos_proposal)(v1_posproposal_table)) + ((v1.cproposal)(v1_code_proposal)(v1_code_proposals_table)) ((v1.candidate)(v1_pos_candidate)(v1_poscandidate_table)) ) #endif diff --git a/community/src/community.cpp b/community/src/community.cpp index 491c78c..13b6b42 100644 --- a/community/src/community.cpp +++ b/community/src/community.cpp @@ -32,12 +32,14 @@ const name BA_Create = "ba.create"_n; const name BA_Issue = "ba.issue"_n; const name BA_Claim = "ba.claim"_n; const name BA_Config = "ba.config"_n; +const name BA_Revoke = "ba.revoke"_n; const name BA_Adopt = "ba.adopt"_n; const name BA_Discard = "ba.discard"_n; const name badge_update_action = "updatebadge"_n; const name badge_create_action = "createbadge"_n; const name badge_issue_action = "issuebadge"_n; +const name cert_revoke_action = "revokecert"_n; struct createbadge_params { @@ -73,6 +75,14 @@ struct issuebadge_params bool require_claim; }; +struct revokecert_params +{ + name issuer; + uint64_t cert_id; + name owner; + string reason; +}; + void community::transfer(name from, name to, asset quantity, string memo) { if (from == _self) @@ -504,7 +514,7 @@ ACTION community::execcode(name community_account, name exec_account, uint64_t c packed_params_datastream >> packed_refer_id; check(code_itr->code_type.refer_id == packed_refer_id, "ERR:INVALID_BADGE_POSITION_CODE::Please use correct code to execute badge/position action"); } - else if (execution_data.code_action == "issuebadge"_n) + else if (execution_data.code_action == "issuebadge"_n || execution_data.code_action == "revokebadge"_n) { name packed_proposal_name; packed_params_datastream >> packed_proposal_name; @@ -522,6 +532,18 @@ ACTION community::execcode(name community_account, name exec_account, uint64_t c check(cb_data.issuer == community_account, "ERR::ISSUE_BADGE_PROPOSAL_INVALID::Issuer in issue badge proposal not the same with community account"); check(cb_data.badge_id == code_itr->code_type.refer_id, "ERR:INVALID_BADGE_POSITION_CODE::Please use correct code to execute badge/position action"); } + + if (action.account == _config.cryptobadge_contract_name && action.name == cert_revoke_action) + { + auto cb_data = unpack(&action.data[0], action.data.size()); + + check(cb_data.issuer == community_account, "ERR::REVOKE_BADGE_PROPOSAL_INVALID::Issuer in issue badge proposal not the same with community account"); + + v1_cert_table _badges(_config.cryptobadge_contract_name, cb_data.owner.value); + auto owner_badge_itr = _badges.find(cb_data.cert_id); + check(owner_badge_itr != _badges.end(), "ERR::REVOKE_BADGE_PROPOSAL_INVALID::Certification does not exist"); + check(owner_badge_itr->badge_id == code_itr->code_type.refer_id, "ERR:INVALID_BADGE_POSITION_CODE::Please use correct code to execute badge/position action"); + } } } } @@ -1951,8 +1973,8 @@ ACTION community::createbadge( RightHolder right_issue_approver, RightHolder right_issue_voter, double issue_pass_rule, - uint64_t issue_vote_duration) -{ + uint64_t issue_vote_duration +){ require_auth(community_account); v1_global_table config(_self, _self.value); @@ -1999,6 +2021,80 @@ ACTION community::createbadge( std::make_tuple(cryptobadge_contract, badge_propose_name, ram_payer)) .send(); + create_issue_badge_code( + community_account, + badge_id, + issue_type, + issue_exec_type, + right_issue_sole_executor, + right_issue_proposer, + issue_approval_type, + right_issue_approver, + right_issue_voter, + issue_pass_rule, + issue_vote_duration, + ram_payer + ); + + create_config_badge_code_for_admin(community_account, badge_id, ram_payer); + + create_revoke_badge_code_for_admin(community_account, badge_id, ram_payer); +} + +ACTION community::configbadge( + name community_account, + uint64_t badge_id, + uint8_t issue_type, + name update_badge_proposal_name) +{ + require_auth(community_account); + + v1_global_table config(_self, _self.value); + _config = config.exists() ? config.get() : v1_global{}; + const name ram_payer_system = _config.ram_payer_name; + const name cryptobadge_contract = _config.cryptobadge_contract_name; + + auto ram_payer = community_account; + if (has_auth(ram_payer_system)) + ram_payer = ram_payer_system; + + if (update_badge_proposal_name != name("")) + { + multisig_proposals proptable("eosio.msig"_n, cryptobadge_contract.value); + auto &prop = proptable.get(update_badge_proposal_name.value, "proposal not found"); + transaction trx; + datastream ds(prop.packed_transaction.data(), prop.packed_transaction.size()); + ds >> trx; + for (auto action : trx.actions) + { + if (action.account == cryptobadge_contract && action.name == badge_update_action) + { + auto cb_data = unpack(&action.data[0], action.data.size()); + + check(cb_data.issuer == community_account, "ERR::CREATE_BADGE_PROPOSAL_INVALID::Issuer in update badge proposal not the same with community account"); + check(cb_data.badge_id == badge_id, "ERR::CREATE_BADGE_PROPOSAL_INVALID::Issuer in update badge proposal not the same with config badge id"); + } + } + + action( + permission_level{community_account, "active"_n}, + "eosio.msig"_n, + "approve"_n, + std::make_tuple(cryptobadge_contract, update_badge_proposal_name, permission_level{community_account, "active"_n})) + .send(); + + vector action_permission = {{community_account, "active"_n}}; + if (ram_payer == ram_payer_system) + action_permission.push_back({ram_payer_system, "active"_n}); + + action( + action_permission, + "eosio.msig"_n, + "exec"_n, + std::make_tuple(cryptobadge_contract, update_badge_proposal_name, ram_payer)) + .send(); + } + v1_code_table _codes(_self, community_account.value); v1_code_sole_decision_table _code_execution_rule(_self, community_account.value); @@ -2009,11 +2105,167 @@ ACTION community::createbadge( v1_position_table _positions(_self, community_account.value); - auto getByCodeName = _codes.get_index<"by.code.name"_n>(); - auto ba_create_code = getByCodeName.find(BA_Create.value); + name issue_badge_code_name; + if (issue_type == BadgeIssueType::WITHOUT_CLAIM) + { + issue_badge_code_name = BA_Issue; + } + else if (issue_type == BadgeIssueType::CLAIM_APPROVE_BY_ISSUER) + { + issue_badge_code_name = BA_Claim; + } + else + { + check(false, "ERR::BADGE_ISSUE_TYPE_INVALID::Badge issue type is invalid"); + } - vector code_actions; - code_actions.push_back("issuebadge"_n); + auto getByCodeReferId = _codes.get_index<"by.refer.id"_n>(); + uint128_t issue_badge_reference_id = build_reference_id(badge_id, CodeTypeEnum::BADGE_ISSUE); + auto issue_badge_code_itr = getByCodeReferId.find(issue_badge_reference_id); + uint64_t issue_badge_code_id; + + // save new code to the table + if (issue_badge_code_itr == getByCodeReferId.end()) + { + vector code_actions; + code_actions.push_back("issuebadge"_n); + auto new_issue_badge_code = _codes.emplace(ram_payer, [&](auto &row) { + row.code_id = _codes.available_primary_key(); + row.code_name = issue_badge_code_name; + row.contract_name = get_self(); + row.code_actions = code_actions; + row.code_type = {CodeTypeEnum::BADGE_ISSUE, badge_id}; + }); + issue_badge_code_id = new_issue_badge_code->code_id; + } + else + { + getByCodeReferId.modify(issue_badge_code_itr, ram_payer, [&](auto &row) { + row.code_name = issue_badge_code_name; + row.code_type = {CodeTypeEnum::BADGE_ISSUE, badge_id}; + }); + issue_badge_code_id = issue_badge_code_itr->code_id; + } +} + +ACTION community::issuebadge(name community_account, name badge_propose_name) +{ + require_auth(community_account); + + v1_global_table config(_self, _self.value); + _config = config.exists() ? config.get() : v1_global{}; + const name ram_payer_system = _config.ram_payer_name; + const name cryptobadge_contract = _config.cryptobadge_contract_name; + + auto ram_payer = community_account; + if (has_auth(ram_payer_system)) + ram_payer = ram_payer_system; + + action( + permission_level{community_account, "active"_n}, + "eosio.msig"_n, + "approve"_n, + std::make_tuple(cryptobadge_contract, badge_propose_name, permission_level{community_account, "active"_n})) + .send(); + + vector action_permission = {{community_account, "active"_n}}; + if (ram_payer == ram_payer_system) + action_permission.push_back({ram_payer_system, "active"_n}); + + action( + action_permission, + "eosio.msig"_n, + "exec"_n, + std::make_tuple(cryptobadge_contract, badge_propose_name, ram_payer)) + .send(); +} + +ACTION community::revokebadge(name community_account, name revoke_badge_propose_name) +{ + require_auth(community_account); + + v1_global_table config(_self, _self.value); + _config = config.exists() ? config.get() : v1_global{}; + const name ram_payer_system = _config.ram_payer_name; + const name cryptobadge_contract = _config.cryptobadge_contract_name; + + auto ram_payer = community_account; + if (has_auth(ram_payer_system)) + ram_payer = ram_payer_system; + + action( + permission_level{community_account, "active"_n}, + "eosio.msig"_n, + "approve"_n, + std::make_tuple(cryptobadge_contract, revoke_badge_propose_name, permission_level{community_account, "active"_n})) + .send(); + + vector action_permission = {{community_account, "active"_n}}; + if (ram_payer == ram_payer_system) + action_permission.push_back({ram_payer_system, "active"_n}); + + action( + action_permission, + "eosio.msig"_n, + "exec"_n, + std::make_tuple(cryptobadge_contract, revoke_badge_propose_name, ram_payer)) + .send(); +} + +ACTION community::setconfig( + name community_creator_name, + name cryptobadge_contract_name, + name token_contract_name, + name ram_payer_name, + symbol core_symbol, + uint64_t init_ram_amount, + asset min_active_contract, + asset init_net, + asset init_cpu +){ + require_auth(_self); + + v1_global_table config(_self, _self.value); + _config = config.exists() ? config.get() : v1_global{}; + + _config.community_creator_name = community_creator_name; + _config.cryptobadge_contract_name = cryptobadge_contract_name; + _config.token_contract_name = token_contract_name; + _config.ram_payer_name = ram_payer_name; + _config.core_symbol = core_symbol; + _config.init_ram_amount = init_ram_amount; + _config.init_net = init_net; + _config.init_cpu = init_cpu; + _config.min_active_contract = min_active_contract; + + config.set(_config, _self); +} + +void community::create_issue_badge_code( + name community_account, + uint64_t badge_id, + uint8_t issue_type, + uint8_t issue_exec_type, + RightHolder right_issue_sole_executor, + RightHolder right_issue_proposer, + uint8_t issue_approval_type, + RightHolder right_issue_approver, + RightHolder right_issue_voter, + double issue_pass_rule, + uint64_t issue_vote_duration, + name ram_payer + ) { + v1_code_table _codes(_self, community_account.value); + + v1_code_sole_decision_table _code_execution_rule(_self, community_account.value); + v1_amend_sole_decision_table _amend_execution_rule(_self, community_account.value); + + v1_code_collective_decision_table _code_vote_rule(_self, community_account.value); + v1_ammend_collective_decision_table _amend_vote_rule(_self, community_account.value); + + v1_position_table _positions(_self, community_account.value); + + auto getByCodeName = _codes.get_index<"by.code.name"_n>(); name issue_badge_code_name; if (issue_type == BadgeIssueType::WITHOUT_CLAIM) @@ -2029,6 +2281,9 @@ ACTION community::createbadge( check(false, "ERR::BADGE_ISSUE_TYPE_INVALID::Badge issue type is invalid"); } + vector code_actions; + code_actions.push_back("issuebadge"_n); + auto getByCodeReferId = _codes.get_index<"by.refer.id"_n>(); uint128_t issue_badge_reference_id = build_reference_id(badge_id, CodeTypeEnum::BADGE_ISSUE); @@ -2124,8 +2379,23 @@ ACTION community::createbadge( }); } } +} - code_actions.clear(); +void community::create_config_badge_code_for_admin(name community_account, uint64_t badge_id, name ram_payer) { + v1_code_table _codes(_self, community_account.value); + + v1_code_sole_decision_table _code_execution_rule(_self, community_account.value); + v1_amend_sole_decision_table _amend_execution_rule(_self, community_account.value); + + v1_code_collective_decision_table _code_vote_rule(_self, community_account.value); + v1_ammend_collective_decision_table _amend_vote_rule(_self, community_account.value); + + v1_position_table _positions(_self, community_account.value); + + auto getByCodeName = _codes.get_index<"by.code.name"_n>(); + auto getByCodeReferId = _codes.get_index<"by.refer.id"_n>(); + + vector code_actions; code_actions.push_back("configbadge"_n); uint128_t config_badge_reference_id = build_reference_id(badge_id, CodeTypeEnum::BADGE_CONFIG); @@ -2148,7 +2418,7 @@ ACTION community::createbadge( else { getByCodeReferId.modify(config_badge_code_itr, ram_payer, [&](auto &row) { - row.code_name = issue_badge_code_name; + row.code_name = BA_Config; row.code_exec_type = ExecutionType::SOLE_DECISION; row.code_type = {CodeTypeEnum::BADGE_CONFIG, badge_id}; }); @@ -2181,60 +2451,7 @@ ACTION community::createbadge( } } -ACTION community::configbadge( - name community_account, - uint64_t badge_id, - uint8_t issue_type, - name update_badge_proposal_name) -{ - require_auth(community_account); - - v1_global_table config(_self, _self.value); - _config = config.exists() ? config.get() : v1_global{}; - const name ram_payer_system = _config.ram_payer_name; - const name cryptobadge_contract = _config.cryptobadge_contract_name; - - auto ram_payer = community_account; - if (has_auth(ram_payer_system)) - ram_payer = ram_payer_system; - - if (update_badge_proposal_name != name("")) - { - multisig_proposals proptable("eosio.msig"_n, cryptobadge_contract.value); - auto &prop = proptable.get(update_badge_proposal_name.value, "proposal not found"); - transaction trx; - datastream ds(prop.packed_transaction.data(), prop.packed_transaction.size()); - ds >> trx; - for (auto action : trx.actions) - { - if (action.account == cryptobadge_contract && action.name == badge_update_action) - { - auto cb_data = unpack(&action.data[0], action.data.size()); - - check(cb_data.issuer == community_account, "ERR::CREATE_BADGE_PROPOSAL_INVALID::Issuer in update badge proposal not the same with community account"); - check(cb_data.badge_id == badge_id, "ERR::CREATE_BADGE_PROPOSAL_INVALID::Issuer in update badge proposal not the same with config badge id"); - } - } - - action( - permission_level{community_account, "active"_n}, - "eosio.msig"_n, - "approve"_n, - std::make_tuple(cryptobadge_contract, update_badge_proposal_name, permission_level{community_account, "active"_n})) - .send(); - - vector action_permission = {{community_account, "active"_n}}; - if (ram_payer == ram_payer_system) - action_permission.push_back({ram_payer_system, "active"_n}); - - action( - action_permission, - "eosio.msig"_n, - "exec"_n, - std::make_tuple(cryptobadge_contract, update_badge_proposal_name, ram_payer)) - .send(); - } - +void community::create_revoke_badge_code_for_admin(name community_account, uint64_t badge_id, name ram_payer) { v1_code_table _codes(_self, community_account.value); v1_code_sole_decision_table _code_execution_rule(_self, community_account.value); @@ -2245,108 +2462,63 @@ ACTION community::configbadge( v1_position_table _positions(_self, community_account.value); - name issue_badge_code_name; - if (issue_type == BadgeIssueType::WITHOUT_CLAIM) - { - issue_badge_code_name = BA_Issue; - } - else if (issue_type == BadgeIssueType::CLAIM_APPROVE_BY_ISSUER) - { - issue_badge_code_name = BA_Claim; - } - else - { - check(false, "ERR::BADGE_ISSUE_TYPE_INVALID::Badge issue type is invalid"); - } - + auto getByCodeName = _codes.get_index<"by.code.name"_n>(); auto getByCodeReferId = _codes.get_index<"by.refer.id"_n>(); - uint128_t issue_badge_reference_id = build_reference_id(badge_id, CodeTypeEnum::BADGE_ISSUE); - auto issue_badge_code_itr = getByCodeReferId.find(issue_badge_reference_id); - uint64_t issue_badge_code_id; - // save new code to the table - if (issue_badge_code_itr == getByCodeReferId.end()) + vector code_actions; + code_actions.push_back("revokebadge"_n); + + uint128_t revoke_badge_reference_id = build_reference_id(badge_id, CodeTypeEnum::BADGE_REVOKE); + auto revoke_badge_code_itr = getByCodeReferId.find(revoke_badge_reference_id); + uint64_t revoke_badge_code_id; + + // save revoke badge code to the table + if (revoke_badge_code_itr == getByCodeReferId.end()) { - vector code_actions; - code_actions.push_back("issuebadge"_n); - auto new_issue_badge_code = _codes.emplace(ram_payer, [&](auto &row) { + auto new_revoke_badge_code = _codes.emplace(ram_payer, [&](auto &row) { row.code_id = _codes.available_primary_key(); - row.code_name = issue_badge_code_name; + row.code_name = BA_Revoke; row.contract_name = get_self(); row.code_actions = code_actions; - row.code_type = {CodeTypeEnum::BADGE_ISSUE, badge_id}; + row.amendment_exec_type = ExecutionType::SOLE_DECISION; + row.code_type = {CodeTypeEnum::BADGE_REVOKE, badge_id}; }); - issue_badge_code_id = new_issue_badge_code->code_id; + revoke_badge_code_id = new_revoke_badge_code->code_id; } else { - getByCodeReferId.modify(issue_badge_code_itr, ram_payer, [&](auto &row) { - row.code_name = issue_badge_code_name; - row.code_type = {CodeTypeEnum::BADGE_ISSUE, badge_id}; + getByCodeReferId.modify(revoke_badge_code_itr, ram_payer, [&](auto &row) { + row.code_name = BA_Revoke; + row.code_exec_type = ExecutionType::SOLE_DECISION; + row.code_type = {CodeTypeEnum::BADGE_REVOKE, badge_id}; }); - issue_badge_code_id = issue_badge_code_itr->code_id; + revoke_badge_code_id = revoke_badge_code_itr->code_id; } -} - -ACTION community::issuebadge(name community_account, name badge_propose_name) -{ - require_auth(community_account); - - v1_global_table config(_self, _self.value); - _config = config.exists() ? config.get() : v1_global{}; - const name ram_payer_system = _config.ram_payer_name; - const name cryptobadge_contract = _config.cryptobadge_contract_name; - auto ram_payer = community_account; - if (has_auth(ram_payer_system)) - ram_payer = ram_payer_system; - - action( - permission_level{community_account, "active"_n}, - "eosio.msig"_n, - "approve"_n, - std::make_tuple(cryptobadge_contract, badge_propose_name, permission_level{community_account, "active"_n})) - .send(); - - vector action_permission = {{community_account, "active"_n}}; - if (ram_payer == ram_payer_system) - action_permission.push_back({ram_payer_system, "active"_n}); - - action( - action_permission, - "eosio.msig"_n, - "exec"_n, - std::make_tuple(cryptobadge_contract, badge_propose_name, ram_payer)) - .send(); -} - -ACTION community::setconfig( - name community_creator_name, - name cryptobadge_contract_name, - name token_contract_name, - name ram_payer_name, - symbol core_symbol, - uint64_t init_ram_amount, - asset min_active_contract, - asset init_net, - asset init_cpu) -{ - require_auth(_self); - - v1_global_table config(_self, _self.value); - _config = config.exists() ? config.get() : v1_global{}; + auto revoke_badge_code_sole_decision = _code_execution_rule.find(revoke_badge_code_id); + auto revoke_badge_amend_code_sole_decision = _amend_execution_rule.find(revoke_badge_code_id); + if (revoke_badge_code_sole_decision == _code_execution_rule.end()) + { + _amend_execution_rule.emplace(ram_payer, [&](auto &row) { + row.code_id = revoke_badge_code_id; + row.right_executor = admin_right_holder(); + }); - _config.community_creator_name = community_creator_name; - _config.cryptobadge_contract_name = cryptobadge_contract_name; - _config.token_contract_name = token_contract_name; - _config.ram_payer_name = ram_payer_name; - _config.core_symbol = core_symbol; - _config.init_ram_amount = init_ram_amount; - _config.init_net = init_net; - _config.init_cpu = init_cpu; - _config.min_active_contract = min_active_contract; + _code_execution_rule.emplace(ram_payer, [&](auto &row) { + row.code_id = revoke_badge_code_id; + row.right_executor = admin_right_holder(); + }); + } + else + { + _amend_execution_rule.modify(revoke_badge_amend_code_sole_decision, ram_payer, [&](auto &row) { + row.right_executor = admin_right_holder(); + }); - config.set(_config, _self); + _code_execution_rule.modify(revoke_badge_code_sole_decision, ram_payer, [&](auto &row) { + row.right_executor = admin_right_holder(); + }); + } } bool community::verify_voter(name community_account, name voter, uint64_t code_id, bool is_amend_code) @@ -2432,8 +2604,9 @@ bool community::is_pos_candidate(name community_account, uint64_t pos_id, name o for (int i = 0; i < _required_badge_ids.size(); i++) { v1_cert_table _badges(cryptobadge_contract, owner.value); - auto owner_badge_itr = _badges.find(_required_badge_ids[i]); - if (owner_badge_itr != _badges.end()) + auto get_cert_by_badge_id = _badges.get_index<"badgeid"_n>(); + auto owner_badge_itr = get_cert_by_badge_id.find(_required_badge_ids[i]); + if (owner_badge_itr != get_cert_by_badge_id.end()) { return true; } @@ -2491,8 +2664,9 @@ bool community::is_pos_voter(name community_account, uint64_t pos_id, name owner for (int i = 0; i < _required_badge_ids.size(); i++) { v1_cert_table _badges(cryptobadge_contract, owner.value); - auto owner_badge_itr = _badges.find(_required_badge_ids[i]); - if (owner_badge_itr != _badges.end()) + auto get_cert_by_badge_id = _badges.get_index<"badgeid"_n>(); + auto owner_badge_itr = get_cert_by_badge_id.find(_required_badge_ids[i]); + if (owner_badge_itr != get_cert_by_badge_id.end()) { return true; } @@ -2548,8 +2722,9 @@ bool community::verify_account_right_holder(name community_account, RightHolder for (int i = 0; i < _required_badge_ids.size(); i++) { v1_cert_table _badges(cryptobadge_contract, owner.value); - auto owner_badge_itr = _badges.find(_required_badge_ids[i]); - if (owner_badge_itr != _badges.end()) + auto get_cert_by_badge_id = _badges.get_index<"badgeid"_n>(); + auto owner_badge_itr = get_cert_by_badge_id.find(_required_badge_ids[i]); + if (owner_badge_itr != get_cert_by_badge_id.end()) { return true; } @@ -2726,4 +2901,4 @@ community::RightHolder community::admin_right_holder() #endif EOSIO_ABI_CUSTOM(community, - (setapprotype)(setvoter)(setapprover)(setaccess)(transfer)(createacc)(create)(initcode)(inputmembers)(initadminpos)(execcode)(createcode)(setverify)(createpos)(configpos)(nominatepos)(approvepos)(voteforcode)(voteforpos)(dismisspos)(setexectype)(appointpos)(proposecode)(execproposal)(verifyholder)(createbadge)(issuebadge)(configbadge)(setsoleexec)(setproposer)(setvoterule)(setconfig)) + (setapprotype)(setvoter)(setapprover)(setaccess)(transfer)(createacc)(create)(initcode)(inputmembers)(initadminpos)(execcode)(createcode)(setverify)(createpos)(configpos)(nominatepos)(approvepos)(voteforcode)(voteforpos)(dismisspos)(setexectype)(appointpos)(proposecode)(execproposal)(verifyholder)(createbadge)(issuebadge)(configbadge)(revokebadge)(setsoleexec)(setproposer)(setvoterule)(setconfig)) diff --git a/package.json b/package.json index 8c697be..50802ff 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "test": "jest" }, "dependencies": { - "@klevoya/hydra": "1.2.0", + "@klevoya/hydra": "1.2.2", "jest": "^25.1.0" }, "devDependencies": { diff --git a/test/codeProposal.test.ts b/test/codeProposal.test.ts index ebb8ef5..f27a407 100644 --- a/test/codeProposal.test.ts +++ b/test/codeProposal.test.ts @@ -371,8 +371,8 @@ describe("test create/vote/execute proposal", () => { const executeProposalName = 'initproposal'; const serializeActionData = '8040f0d94d2d254500800819abac1245008042d3ccab36650200c2a42e2393b1ca00c4a42e2393b1ca'; + // console.log('--------- governance contract: ', JSON.stringify(governanceContract.abi)); await governanceContract.loadFixtures(`v1.cproposal`, { - // scope: [row1, row2, ...], 'community1.c': [{ proposal_name: executeProposalName, proposer: proposer.accountName, @@ -391,8 +391,8 @@ describe("test create/vote/execute proposal", () => { value: 1, }], proposal_status: 0, - propose_time: Date().toString(), - exec_at: Date().toString(), + propose_time: '2020-12-10T04:01:08', //new Date().toString(), + exec_at: '2020-12-10T04:01:08', //new Date().toString(), }], }); await expect(governanceContract.contract.execproposal({ diff --git a/test/community/community.abi b/test/community/community.abi index 512ba4c..085961a 100644 --- a/test/community/community.abi +++ b/test/community/community.abi @@ -403,6 +403,34 @@ } ] }, + { + "name": "hydraload", + "base": "", + "fields": [ + { + "name": "payload", + "type": "hydraload_payload[]" + } + ] + }, + { + "name": "hydraload_payload", + "base": "", + "fields": [ + { + "name": "table_name", + "type": "name" + }, + { + "name": "scope", + "type": "name" + }, + { + "name": "row_data", + "type": "bytes" + } + ] + }, { "name": "initadminpos", "base": "", @@ -553,6 +581,20 @@ } ] }, + { + "name": "revokebadge", + "base": "", + "fields": [ + { + "name": "community_account", + "type": "name" + }, + { + "name": "revoke_badge_propose_name", + "type": "name" + } + ] + }, { "name": "setaccess", "base": "", @@ -1289,6 +1331,11 @@ "type": "execproposal", "ricardian_contract": "" }, + { + "name": "hydraload", + "type": "hydraload", + "ricardian_contract": "" + }, { "name": "initadminpos", "type": "initadminpos", @@ -1319,6 +1366,11 @@ "type": "proposecode", "ricardian_contract": "" }, + { + "name": "revokebadge", + "type": "revokebadge", + "ricardian_contract": "" + }, { "name": "setaccess", "type": "setaccess", @@ -1429,7 +1481,7 @@ "key_types": [] }, { - "name": "v1.cert", + "name": "v1.certs", "type": "v1_cert", "index_type": "i64", "key_names": [], diff --git a/test/community/community.wasm b/test/community/community.wasm index 45183be..20cadde 100755 Binary files a/test/community/community.wasm and b/test/community/community.wasm differ diff --git a/yarn.lock b/yarn.lock index 44ba828..2e5c2fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -451,10 +451,10 @@ "@types/yargs" "^15.0.0" chalk "^3.0.0" -"@klevoya/hydra@1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@klevoya/hydra/-/hydra-1.2.0.tgz#c2b9f1add39b7eed28133d3795706a487c0f8634" - integrity sha512-mMYi98ElXRXsR5GGy2Q070MKcYNxLmp+edJ0Hi0KisbjSTzk9EVvxp2+aoK9ErJ83geURgt6qL1RJ7naFRS8Pg== +"@klevoya/hydra@1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@klevoya/hydra/-/hydra-1.2.2.tgz#bf119c24417121ab8bac09f9ab34f3c360bfeea8" + integrity sha512-OV2cBD9Nu6lfkdZXD5xaXuSHul6Hzm4de//Wo1TrcLuOsT7rK5bb++xT9+AlPcKfL+Xw5/T2iqjea8EGOfsNWQ== dependencies: "@altostra/cli-login-auth0" "github:MrToph/altostra-cli-login-auth0" "@oclif/command" "^1.5.19" @@ -462,7 +462,7 @@ "@oclif/plugin-help" "^2.2.2" axios "^0.19.0" ejs "^3.0.1" - eosjs "^21.0.1-rc2" + eosjs "21.0.1-rc2" fs-extra "^8.1.0" globby "^10.0.2" inquirer "^7.0.0" @@ -494,38 +494,40 @@ "@nodelib/fs.scandir" "2.1.3" fastq "^1.6.0" -"@oclif/command@^1.5.13", "@oclif/command@^1.5.19": - version "1.5.20" - resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.5.20.tgz#bb0693586d7d66a457c49b719e394c02ff0169a7" - integrity sha512-lzst5RU/STfoutJJv4TLE/cm1WtW3xy6Aqvqy3r1lPsGdNifgbEq4dCOYyc/ZEuhV/IStQLDFTnAlqTdolkz1Q== +"@oclif/command@^1.5.13", "@oclif/command@^1.5.19", "@oclif/command@^1.5.20": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.8.0.tgz#c1a499b10d26e9d1a611190a81005589accbb339" + integrity sha512-5vwpq6kbvwkQwKqAoOU3L72GZ3Ta8RRrewKj9OJRolx28KLJJ8Dg9Rf7obRwt5jQA9bkYd8gqzMTrI7H3xLfaw== dependencies: - "@oclif/config" "^1" - "@oclif/errors" "^1.2.2" + "@oclif/config" "^1.15.1" + "@oclif/errors" "^1.3.3" "@oclif/parser" "^3.8.3" - "@oclif/plugin-help" "^2" + "@oclif/plugin-help" "^3" debug "^4.1.1" - semver "^5.6.0" + semver "^7.3.2" -"@oclif/config@^1", "@oclif/config@^1.13.3": - version "1.15.1" - resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.15.1.tgz#39950c70811ab82d75bb3cdb33679ed0a4c21c57" - integrity sha512-GdyHpEZuWlfU8GSaZoiywtfVBsPcfYn1KuSLT1JTfvZGpPG6vShcGr24YZ3HG2jXUFlIuAqDcYlTzOrqOdTPNQ== +"@oclif/config@^1.13.3", "@oclif/config@^1.15.1": + version "1.17.0" + resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.17.0.tgz#ba8639118633102a7e481760c50054623d09fcab" + integrity sha512-Lmfuf6ubjQ4ifC/9bz1fSCHc6F6E653oyaRXxg+lgT4+bYf9bk+nqrUpAbrXyABkCqgIBiFr3J4zR/kiFdE1PA== dependencies: - "@oclif/errors" "^1.0.0" + "@oclif/errors" "^1.3.3" "@oclif/parser" "^3.8.0" debug "^4.1.1" - tslib "^1.9.3" + globby "^11.0.1" + is-wsl "^2.1.1" + tslib "^2.0.0" -"@oclif/errors@^1.0.0", "@oclif/errors@^1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@oclif/errors/-/errors-1.2.2.tgz#9d8f269b15f13d70aa93316fed7bebc24688edc2" - integrity sha512-Eq8BFuJUQcbAPVofDxwdE0bL14inIiwt5EaKRVY9ZDIG11jwdXZqiQEECJx0VfnLyUZdYfRd/znDI/MytdJoKg== +"@oclif/errors@^1.2.2", "@oclif/errors@^1.3.3": + version "1.3.4" + resolved "https://registry.yarnpkg.com/@oclif/errors/-/errors-1.3.4.tgz#a96f94536b4e25caa72eff47e8b3ed04f6995f55" + integrity sha512-pJKXyEqwdfRTUdM8n5FIHiQQHg5ETM0Wlso8bF9GodczO40mF5Z3HufnYWJE7z8sGKxOeJCdbAVZbS8Y+d5GCw== dependencies: - clean-stack "^1.3.0" - fs-extra "^7.0.0" - indent-string "^3.2.0" - strip-ansi "^5.0.0" - wrap-ansi "^4.0.0" + clean-stack "^3.0.0" + fs-extra "^8.1" + indent-string "^4.0.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" "@oclif/linewrap@^1.0.0": version "1.0.0" @@ -533,15 +535,16 @@ integrity sha512-Ups2dShK52xXa8w6iBWLgcjPJWjais6KPJQq3gQ/88AY6BXoTX+MIGFPrWQO1KLMiQfoTpcLnUwloN4brrVUHw== "@oclif/parser@^3.8.0", "@oclif/parser@^3.8.3": - version "3.8.4" - resolved "https://registry.yarnpkg.com/@oclif/parser/-/parser-3.8.4.tgz#1a90fc770a42792e574fb896325618aebbe8c9e4" - integrity sha512-cyP1at3l42kQHZtqDS3KfTeyMvxITGwXwH1qk9ktBYvqgMp5h4vHT+cOD74ld3RqJUOZY/+Zi9lb4Tbza3BtuA== + version "3.8.5" + resolved "https://registry.yarnpkg.com/@oclif/parser/-/parser-3.8.5.tgz#c5161766a1efca7343e1f25d769efbefe09f639b" + integrity sha512-yojzeEfmSxjjkAvMRj0KzspXlMjCfBzNRPkWw8ZwOSoNWoJn+OCS/m/S+yfV6BvAM4u2lTzX9Y5rCbrFIgkJLg== dependencies: + "@oclif/errors" "^1.2.2" "@oclif/linewrap" "^1.0.0" chalk "^2.4.2" tslib "^1.9.3" -"@oclif/plugin-help@^2", "@oclif/plugin-help@^2.2.2": +"@oclif/plugin-help@^2.2.2": version "2.2.3" resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-2.2.3.tgz#b993041e92047f0e1762668aab04d6738ac06767" integrity sha512-bGHUdo5e7DjPJ0vTeRBMIrfqTRDBfyR5w0MP41u0n3r7YG5p14lvMmiCXxi6WDaP2Hw5nqx3PnkAIntCKZZN7g== @@ -555,6 +558,21 @@ widest-line "^2.0.1" wrap-ansi "^4.0.0" +"@oclif/plugin-help@^3": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-3.2.0.tgz#b2c1112f49202ebce042f86b2e42e49908172ef1" + integrity sha512-7jxtpwVWAVbp1r46ZnTK/uF+FeZc6y4p1XcGaIUuPAp7wx6NJhIRN/iMT9UfNFX/Cz7mq+OyJz+E+i0zrik86g== + dependencies: + "@oclif/command" "^1.5.20" + "@oclif/config" "^1.15.1" + chalk "^2.4.1" + indent-string "^4.0.0" + lodash.template "^4.4.0" + string-width "^4.2.0" + strip-ansi "^6.0.0" + widest-line "^3.1.0" + wrap-ansi "^4.0.0" + "@sinonjs/commons@^1.7.0": version "1.7.2" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.7.2.tgz#505f55c74e0272b43f6c52d81946bed7058fc0e2" @@ -614,17 +632,11 @@ dependencies: "@types/bn.js" "*" -"@types/events@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" - integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== - "@types/glob@^7.1.1": - version "7.1.1" - resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" - integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w== + version "7.1.3" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183" + integrity sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w== dependencies: - "@types/events" "*" "@types/minimatch" "*" "@types/node" "*" @@ -662,9 +674,9 @@ integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== "@types/node@*": - version "13.13.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.4.tgz#1581d6c16e3d4803eb079c87d4ac893ee7501c2c" - integrity sha512-x26ur3dSXgv5AwKS0lNfbjpCakGIduWU1DU91Zz58ONRWrIKGunmZBNv4P7N+e27sJkiGDsw/3fT4AtsqQBrBA== + version "14.14.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.11.tgz#fc25a4248a5e8d0837019b1d170146d07334abe0" + integrity sha512-BJ97wAUuU3NUiUCp44xzUFquQEvnk1wu7q4CMEUYKJWjdkr0YWYDsm4RFtAvxYsNjLsKcrFt6RvK8r+mnzMbEQ== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -956,9 +968,9 @@ bcrypt-pbkdf@^1.0.0: tweetnacl "^0.14.3" bn.js@^4.4.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" - integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== + version "4.11.9" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828" + integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw== brace-expansion@^1.1.7: version "1.1.11" @@ -1081,6 +1093,14 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" + integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" @@ -1101,10 +1121,12 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -clean-stack@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-1.3.0.tgz#9e821501ae979986c46b1d66d2d432db2fd4ae31" - integrity sha1-noIVAa6XmYbEax1m0tQy2y/UrjE= +clean-stack@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-3.0.1.tgz#155bf0b2221bf5f4fba89528d24c5953f17fe3a8" + integrity sha512-lR9wNiMRcVQjSB3a7xXGLuz4cr4wJuuXlaAEbRutGowQTmlp7R72/DOgN21e8jdwblMWl9UOJMJXarX94pzKdg== + dependencies: + escape-string-regexp "4.0.0" cli-cursor@^3.1.0: version "3.1.0" @@ -1113,10 +1135,10 @@ cli-cursor@^3.1.0: dependencies: restore-cursor "^3.1.0" -cli-width@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" - integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== +cli-width@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" + integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== cliui@^6.0.0: version "6.0.0" @@ -1357,9 +1379,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" ejs@^3.0.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.2.tgz#a9986e6920a60f2a3229e87d4f0f3c073209874c" - integrity sha512-zFuywxrAWtX5Mk2KAuoJNkXXbfezpNA0v7i+YC971QORguPekpjpAgeOv99YWSdKXwj7JxI2QAWDeDkE8fWtXw== + version "3.1.5" + resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.5.tgz#aed723844dc20acb4b170cd9ab1017e476a0d93b" + integrity sha512-dldq3ZfFtgVTJMLjOe+/3sROTzALlL9E34V4/sDtUd/KlBSS0s6U1/+WPE1B4sj9CXHJpL1M6rhNJnc9Wbal9w== dependencies: jake "^10.6.1" @@ -1393,7 +1415,7 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" -eosjs@^21.0.1-rc2: +eosjs@21.0.1-rc2: version "21.0.1-rc2" resolved "https://registry.yarnpkg.com/eosjs/-/eosjs-21.0.1-rc2.tgz#9dba4b43f51e0645a6dd836440544a5ec004897f" integrity sha512-Jq+9By5h4C5jMoywFYhAJxveSD2MnyUOhd4gigUXqS4b/SzKSdFDxLuCxKaw3Nv4QgiAoH44UhFhp8TVPgu1MA== @@ -1409,6 +1431,11 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -1563,10 +1590,10 @@ fast-deep-equal@^3.1.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== -fast-glob@^3.0.3: - version "3.2.2" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.2.tgz#ade1a9d91148965d4bf7c51f72e1ca662d32e63d" - integrity sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A== +fast-glob@^3.0.3, fast-glob@^3.1.1: + version "3.2.4" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.4.tgz#d20aefbf99579383e7f3cc66529158c9b98554d3" + integrity sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" @@ -1586,9 +1613,9 @@ fast-levenshtein@~2.0.6: integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fastq@^1.6.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.7.0.tgz#fcd79a08c5bd7ec5b55cd3f5c4720db551929801" - integrity sha512-YOadQRnHd5q6PogvAR/x62BGituF2ufiEA6s8aavQANw5YKHERI4AREboX6KotzP8oX2klxYF2wcV/7bn1clfQ== + version "1.9.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.9.0.tgz#e16a72f338eaca48e91b5c23593bcc2ef66b7947" + integrity sha512-i7FVWL8HhVY+CTkwFxkN2mk3h+787ixS5S63eb78diVRc1MCssarHq3W5cj0av7YDSwmaV928RNag+U1etRQ7w== dependencies: reusify "^1.0.4" @@ -1671,16 +1698,7 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" -fs-extra@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" - integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs-extra@^8.1.0: +fs-extra@^8.1, fs-extra@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== @@ -1773,7 +1791,24 @@ globby@^10.0.2: merge2 "^1.2.3" slash "^3.0.0" -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.3: +globby@^11.0.1: + version "11.0.1" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.1.tgz#9a2bf107a068f3ffeabc49ad702c79ede8cfd357" + integrity sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.1.1" + ignore "^5.1.4" + merge2 "^1.3.0" + slash "^3.0.0" + +graceful-fs@^4.1.6, graceful-fs@^4.2.0: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + +graceful-fs@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== @@ -1892,10 +1927,10 @@ iconv-lite@0.4.24, iconv-lite@^0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -ignore@^5.1.1: - version "5.1.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.4.tgz#84b7b3dbe64552b6ef0eca99f6743dbec6d97adf" - integrity sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A== +ignore@^5.1.1, ignore@^5.1.4: + version "5.1.8" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" + integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== import-local@^3.0.2: version "3.0.2" @@ -1910,11 +1945,6 @@ imurmurhash@^0.1.4: resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= -indent-string@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" - integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= - indent-string@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" @@ -1934,20 +1964,20 @@ inherits@2, inherits@^2.0.1, inherits@^2.0.3: integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== inquirer@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.1.0.tgz#1298a01859883e17c7264b82870ae1034f92dd29" - integrity sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg== + version "7.3.3" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" + integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== dependencies: ansi-escapes "^4.2.1" - chalk "^3.0.0" + chalk "^4.1.0" cli-cursor "^3.1.0" - cli-width "^2.0.0" + cli-width "^3.0.0" external-editor "^3.0.3" figures "^3.0.0" - lodash "^4.17.15" + lodash "^4.17.19" mute-stream "0.0.8" run-async "^2.4.0" - rxjs "^6.5.3" + rxjs "^6.6.0" string-width "^4.1.0" strip-ansi "^6.0.0" through "^2.3.6" @@ -2180,9 +2210,9 @@ istanbul-reports@^3.0.2: istanbul-lib-report "^3.0.0" jake@^10.6.1: - version "10.6.1" - resolved "https://registry.yarnpkg.com/jake/-/jake-10.6.1.tgz#c9c476cfd6e726ef600ee9bb2b880d5425ff8c79" - integrity sha512-pHUK3+V0BjOb1XSi95rbBksrMdIqLVC9bJqDnshVyleYsET3H0XAq+3VB2E3notcYvv4wRdRHn13p7vobG+wfQ== + version "10.8.2" + resolved "https://registry.yarnpkg.com/jake/-/jake-10.8.2.tgz#ebc9de8558160a66d82d0eadc6a2e58fbc500a7b" + integrity sha512-eLpKyrfG3mzvGE2Du8VoPbeSkRry093+tyNjdYaBbJS9v17knImYGNXQCUV0gLxQtF82m3E8iRb/wdSQZLoq7A== dependencies: async "0.9.x" chalk "^2.4.2" @@ -2736,6 +2766,11 @@ lodash@^4.17.13, lodash@^4.17.15: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== +lodash@^4.17.19: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + lolex@^5.0.0: version "5.1.2" resolved "https://registry.yarnpkg.com/lolex/-/lolex-5.1.2.tgz#953694d098ce7c07bc5ed6d0e42bc6c0c6d5a367" @@ -2748,6 +2783,13 @@ long@^4.0.0: resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + make-dir@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" @@ -2785,9 +2827,9 @@ merge-stream@^2.0.0: integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== merge2@^1.2.3, merge2@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81" - integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw== + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== micromatch@4.x, micromatch@^4.0.2: version "4.0.2" @@ -3237,9 +3279,9 @@ realpath-native@^2.0.0: integrity sha512-v1SEYUOXXdbBZK8ZuNgO4TBjamPsiSgcFr0aP+tEKpQZK8vooEUqV6nm6Cv502mX4NF2EfsnVqtNAHG+/6Ur1Q== regenerator-runtime@^0.13.2: - version "0.13.5" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697" - integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA== + version "0.13.7" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" + integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" @@ -3381,14 +3423,14 @@ run-async@^2.4.0: integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== run-parallel@^1.1.9: - version "1.1.9" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.9.tgz#c9dd3a7cf9f4b2c4b6244e173a6ed866e61dd679" - integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== + version "1.1.10" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.10.tgz#60a51b2ae836636c81377df16cb107351bcd13ef" + integrity sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw== -rxjs@^6.5.3: - version "6.5.5" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.5.tgz#c5c884e3094c8cfee31bf27eb87e54ccfc87f9ec" - integrity sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ== +rxjs@^6.6.0: + version "6.6.3" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" + integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== dependencies: tslib "^1.9.0" @@ -3436,7 +3478,7 @@ saxes@^3.1.9: dependencies: xmlchars "^2.1.1" -"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -3446,6 +3488,13 @@ semver@6.x, semver@^6.0.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.3.2: + version "7.3.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" + integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== + dependencies: + lru-cache "^6.0.0" + set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -3670,7 +3719,7 @@ string-width@^3.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string-width@^4.1.0, string-width@^4.2.0: +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== @@ -3860,9 +3909,14 @@ ts-jest@^25.4.0: yargs-parser "18.x" tslib@^1.10.0, tslib@^1.9.0, tslib@^1.9.3: - version "1.11.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" - integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tslib@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c" + integrity sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ== tunnel-agent@^0.6.0: version "0.6.0" @@ -4061,6 +4115,13 @@ widest-line@^2.0.1: dependencies: string-width "^2.1.1" +widest-line@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" + integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== + dependencies: + string-width "^4.0.0" + word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" @@ -4084,6 +4145,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -4119,6 +4189,11 @@ y18n@^4.0.0: resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + yargs-parser@18.x, yargs-parser@^18.1.1: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0"