From 2440e9d1cfc3bbfe5d6422003ba1a245608287f1 Mon Sep 17 00:00:00 2001
From: Robert Martin-Legene <robert@nic.ar>
Date: Mon, 10 Jun 2019 14:51:35 -0300
Subject: [PATCH] MasterDistiller necesita numeros muy grandes.

---
 bin/MasterDistiller.js | 5 +++--
 package-lock.json      | 5 +++++
 package.json           | 1 +
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/bin/MasterDistiller.js b/bin/MasterDistiller.js
index 85e381a..ff0f76f 100755
--- a/bin/MasterDistiller.js
+++ b/bin/MasterDistiller.js
@@ -2,6 +2,7 @@
 
 "use strict"
 
+const   BigInteger  =   require('big-integer');
 const   Libbfa      =   require( process.env.BFAHOME + '/bin/libbfa.js');
 const   rl          =   require('readline').createInterface(
         { input: process.stdin, output: process.stdout }
@@ -192,9 +193,9 @@ function    editAccount( entry, pallet )
         (answer) => {
             if ( bfa.isNumeric(answer) )
             {
-                answer      *=  notation[1];
+                var     bi  =   BigInteger( answer ).multiply( notation[1] );
                 console.log("Sending update to the SC...");
-                Distillery.methods.setEtherAllowance(acct,answer)
+                Distillery.methods.setEtherAllowance(acct,web3.utils.toHex(bi))
                 .send( {"from": bfa.account } )
                 .then(
                     function(a){
diff --git a/package-lock.json b/package-lock.json
index 0e2a51b..d8557b7 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -87,6 +87,11 @@
         "tweetnacl": "^0.14.3"
       }
     },
+    "big-integer": {
+      "version": "1.6.43",
+      "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.43.tgz",
+      "integrity": "sha512-9dULc9jsKmXl0Aeunug8wbF+58n+hQoFjqClN7WeZwGLh0XJUWyJJ9Ee+Ep+Ql/J9fRsTVaeThp8MhiCCrY0Jg=="
+    },
     "bindings": {
       "version": "1.5.0",
       "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
diff --git a/package.json b/package.json
index aacf29a..cf24738 100644
--- a/package.json
+++ b/package.json
@@ -3,6 +3,7 @@
   "version": "1.0.0",
   "description": "Blockchain Federal Argentina",
   "dependencies": {
+    "big-integer": "^1.6.43",
     "request": "^2.88.0",
     "require": "^2.4.20",
     "web3": "^1.0.0-beta.55"
-- 
GitLab