From 8a21cde18892334bf5f2819f75a57edf29a9e0c4 Mon Sep 17 00:00:00 2001 From: Nicolas Gotchac Date: Tue, 19 Sep 2017 11:58:04 +0200 Subject: [PATCH] Required validators >= num owners (#6551) --- js/src/modals/CreateWallet/createWalletStore.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/src/modals/CreateWallet/createWalletStore.js b/js/src/modals/CreateWallet/createWalletStore.js index 26ed5816c..c155ad1c1 100644 --- a/js/src/modals/CreateWallet/createWalletStore.js +++ b/js/src/modals/CreateWallet/createWalletStore.js @@ -281,6 +281,12 @@ export default class CreateWalletStore { const daylimitValidation = validateUint(_wallet.daylimit); const nameValidation = validateName(_wallet.name); + const owners = _wallet.owners.filter((owner) => !/^(0x)?0*$/.test(owner)); + + if (_wallet.required > owners.length) { + requiredValidation.valueError = 'the number of required validators should be lower or equal the number of owners'; + } + const errors = { address: addressValidation.addressError, account: accountValidation.addressError,