| catapult::validators::DEFINE_STATEFUL_VALIDATOR (ModifyMultisigInvalidSettings, [](const auto ¬ification, const ValidatorContext &context) { const auto &multisigCache=context.Cache.sub< cache::MultisigCache >();if(!multisigCache.contains(notification.Signer)) { if(-1 !=notification.MinRemovalDelta||-1 !=notification.MinApprovalDelta) return Failure_Multisig_Modify_Min_Setting_Out_Of_Range;return ValidationResult::Success;} auto multisigIter=multisigCache.find(notification.Signer);const auto &multisigEntry=multisigIter.get();int newMinRemoval=multisigEntry.minRemoval()+notification.MinRemovalDelta;int newMinApproval=multisigEntry.minApproval()+notification.MinApprovalDelta;if(1 > newMinRemoval||1 > newMinApproval) return Failure_Multisig_Modify_Min_Setting_Out_Of_Range;int maxValue=static_cast< int >(multisigEntry.cosignatories().size());if(newMinRemoval > maxValue||newMinApproval > maxValue) return Failure_Multisig_Modify_Min_Setting_Larger_Than_Num_Cosignatories;return ValidationResult::Success;}) |