From 91df90ac9565bedb4cb13352a2f317c0bc4d60c2 Mon Sep 17 00:00:00 2001
From: Patricio Kumagae <pkumagae@boletinoficial.gob.ar>
Date: Wed, 18 Sep 2019 11:58:57 -0300
Subject: [PATCH] Tarea #21071 - [BFA-registro] No se pueden agregar cuentas

---
 Poppins/local_settings_dev.py     | 2 ++
 Poppins/local_settings_preprod.py | 3 ++-
 Poppins/local_settings_prod.py    | 4 +++-
 Poppins/local_settings_tst.py     | 4 +++-
 dapp/gateway.py                   | 2 ++
 5 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/Poppins/local_settings_dev.py b/Poppins/local_settings_dev.py
index 9830555..88e84fb 100644
--- a/Poppins/local_settings_dev.py
+++ b/Poppins/local_settings_dev.py
@@ -26,6 +26,8 @@ NODE_URL = 'http://10.23.10.72:8501'  # salberchain
 DISTILLERY_ADDRESS = '0xBCE634B5cd8ba22A66A5CDedFb1bC56EFFb8a525'  # distillery
 
 DISTRIBUTOR_ACCOUNT = '0x25c185DcaeD065BAC30a0a1cd0688A7aA02896d7'  # cuenta con mucho ether, vive en el 72
+DISTRIBUTOR_PASSPHRASE = ''
+UNLOCK_TIMEOUT = 0
 
 DISTILLERY_ABI = '[ { "anonymous": false, "inputs": [ { "indexed": false, "name": "amount", "type": "uint256" } ], ' \
                  '"name": "proofOfControlWeiAmountChanged", "type": "event" }, { "constant": false, "inputs": [ { ' \
diff --git a/Poppins/local_settings_preprod.py b/Poppins/local_settings_preprod.py
index 74908c5..69f28a1 100644
--- a/Poppins/local_settings_preprod.py
+++ b/Poppins/local_settings_preprod.py
@@ -31,7 +31,8 @@ DISTILLERY_ADDRESS = '0x9Da2aC818d39f4342f67eC94F86865A34b642342'  # distillery
 
 DISTRIBUTOR_ACCOUNT = '0xc9cec0B3fbb502B2eF4d03eBf6a1A612CBdE53E3'  # cuenta con mucho ether, vive en el 72
 # 0x21ea59FC5cE54a827E20BC9b736FeeD8F9C880Ff
-
+DISTRIBUTOR_PASSPHRASE = ''
+UNLOCK_TIMEOUT = 0
 
 # cuentas para pruebas: 0xd57c1f52ff4513c721bd22ccbee55b7cef440b5c y 0x6664e892a36e74e1e618b9bfb25caa0f18b311a4
 # passphrase prueba para ambas cuentas
diff --git a/Poppins/local_settings_prod.py b/Poppins/local_settings_prod.py
index 58488d5..f467626 100644
--- a/Poppins/local_settings_prod.py
+++ b/Poppins/local_settings_prod.py
@@ -44,6 +44,8 @@ NODE_URL = 'http://10.24.10.14:8545'  # mainnet (bootnode)
 #CFG BLOCKCHANGE
 DISTILLERY_ADDRESS = '0xc3cF96aF51d3c41DfBE428dE75a8E5597d4D7A7B'  # distillery
 DISTRIBUTOR_ACCOUNT = '0xBF1ce9Cca7dedea3FDB22d169B49643664602eE1'  # cuenta con mucho ether
+DISTRIBUTOR_PASSPHRASE = ''
+UNLOCK_TIMEOUT = 0
 DISTILLERY_ABI = '[ { "anonymous": false, "inputs": [ { "indexed": false, "name": "amount", "type": "uint256" } ], ' \
                  '"name": "proofOfControlWeiAmountChanged", "type": "event" }, { "constant": false, "inputs": [ { ' \
                  '"name": "acc", "type": "address" }, { "name": "limit", "type": "uint256" } ], ' \
@@ -115,4 +117,4 @@ DATA_SITEKEY = '6LdIsXoUAAAAAFQfkzQWPpJ5ERGdxmY8YT4bFLmt'
 
 RAVEN_CONFIG = {
     'dsn': 'http://0f6b7e857c31436badd6f5a33b6795e4:21003d12f52b4e2cb4efba1f27fd1780@10.1.100.118:9000/81',
-}
\ No newline at end of file
+}
diff --git a/Poppins/local_settings_tst.py b/Poppins/local_settings_tst.py
index 946fb50..1ec537e 100644
--- a/Poppins/local_settings_tst.py
+++ b/Poppins/local_settings_tst.py
@@ -33,6 +33,8 @@ NODE_URL = 'http://10.23.10.71:54450'  # salberchain
 DISTILLERY_ADDRESS = '0x822c2b518dCfEE69d435E0C5F2e6d196FcC8320E'  # distillery
 DISTRIBUTOR_ACCOUNT = '0xA9cAc6C2EF4909A05eF24A12Ecadf9E541B5995F'  # cuenta con mucho ether con su clave privada en
 # el 10.23.10.73
+DISTRIBUTOR_PASSPHRASE = ''
+UNLOCK_TIMEOUT = 0
 
 # cuentas para pruebas: 0xd57c1f52ff4513c721bd22ccbee55b7cef440b5c y 0x6664e892a36e74e1e618b9bfb25caa0f18b311a4
 # passphrase prueba para ambas cuentas
@@ -107,4 +109,4 @@ RAVEN_CONFIG = {
     'dsn': 'http://af8a61a068af431eb80d8ee277f84364:887b38e0b1594fabb844b75309bdaab7@10.1.100.118:9000/79',
 }
 
-BLOCK_NUMBER_TO_START = 834942  # numero de bloque para empezar a buscar en el filter
\ No newline at end of file
+BLOCK_NUMBER_TO_START = 834942  # numero de bloque para empezar a buscar en el filter
diff --git a/dapp/gateway.py b/dapp/gateway.py
index 8bc37c8..55e9902 100644
--- a/dapp/gateway.py
+++ b/dapp/gateway.py
@@ -66,6 +66,8 @@ class Distillery:
     def execute_transaction(self, contract, transaction_data, exception_message=""):
         es_valido = contract.call(transaction_data)
 
+        self.gateway.w3.personal.unlockAccount(settings.DISTRIBUTOR_ACCOUNT, settings.DISTRIBUTOR_PASSPHRASE, settings.UNLOCK_TIMEOUT)
+
         if es_valido:
             # transaction_data['gasLimit'] = 1000000000000
             tx_hash = contract.transact(transaction_data)
-- 
GitLab