From e11a2e6f8521b923baf8509c40e288ebd1d3681b Mon Sep 17 00:00:00 2001
From: Lex Berezhny <lex@damoti.com>
Date: Sat, 9 Jun 2018 17:38:33 -0400
Subject: [PATCH 1/3] publish accepts decimal string for the bid value

---
 lbrynet/daemon/Daemon.py | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py
index 6fa9fb148..1ab3f7587 100644
--- a/lbrynet/daemon/Daemon.py
+++ b/lbrynet/daemon/Daemon.py
@@ -8,7 +8,9 @@ import urllib
 import json
 import textwrap
 import signal
+import six
 from copy import deepcopy
+from decimal import Decimal, InvalidOperation
 from twisted.web import server
 from twisted.internet import defer, threads, error, reactor
 from twisted.internet.task import LoopingCall
@@ -457,7 +459,7 @@ class Daemon(AuthJSONRPCServer):
                 if isinstance(settings[key], setting_type):
                     conf.settings.update({key: settings[key]},
                                          data_types=(conf.TYPE_RUNTIME, conf.TYPE_PERSISTED))
-                elif setting_type is dict and isinstance(settings[key], (unicode, str)):
+                elif setting_type is dict and isinstance(settings[key], six.string_types):
                     decoded = json.loads(str(settings[key]))
                     conf.settings.update({key: decoded},
                                          data_types=(conf.TYPE_RUNTIME, conf.TYPE_PERSISTED))
@@ -1986,7 +1988,7 @@ class Daemon(AuthJSONRPCServer):
 
         Options:
             --name=<name>                  : (str) name of the content
-            --bid=<bid>                    : (float) amount to back the claim
+            --bid=<bid>                    : (decimal) amount to back the claim
             --metadata=<metadata>          : (dict) ClaimDict to associate with the claim.
             --file_path=<file_path>        : (str) path to file to be associated with name. If provided,
                                              a lbry stream of this file will be used in 'sources'.
@@ -1996,7 +1998,7 @@ class Daemon(AuthJSONRPCServer):
             --fee=<fee>                    : (dict) Dictionary representing key fee to download content:
                                               {
                                                 'currency': currency_symbol,
-                                                'amount': float,
+                                                'amount': decimal,
                                                 'address': str, optional
                                               }
                                               supported currencies: LBC, USD, BTC
@@ -2026,7 +2028,7 @@ class Daemon(AuthJSONRPCServer):
                 'tx' : (str) hex encoded transaction
                 'txid' : (str) txid of resulting claim
                 'nout' : (int) nout of the resulting claim
-                'fee' : (float) fee paid for the claim transaction
+                'fee' : (decimal) fee paid for the claim transaction
                 'claim_id' : (str) claim ID of the resulting claim
             }
         """
@@ -2036,8 +2038,15 @@ class Daemon(AuthJSONRPCServer):
         except (TypeError, URIParseError):
             raise Exception("Invalid name given to publish")
 
-        if not isinstance(bid, (float, int)):
-            raise TypeError("Bid must be a float or an integer.")
+        if isinstance(bid, (float, int)):
+            bid = Decimal(bid)
+        elif isinstance(bid, six.string_types):
+            try:
+                bid = Decimal(bid)
+            except InvalidOperation:
+                raise TypeError("Bid does not represent a valid decimal.")
+        else:
+            raise TypeError("Bid must be a decimal number represented by a string.")
 
         if bid <= 0.0:
             raise ValueError("Bid value must be greater than 0.0")
@@ -2083,7 +2092,7 @@ class Daemon(AuthJSONRPCServer):
         # add address, version to fee if unspecified
         if 'fee' in metadata:
             if len(metadata['fee'].keys()) == 1 and isinstance(metadata['fee'].values()[0], dict):
-                raise Exception('Old format for fee no longer supported. ' \
+                raise Exception('Old format for fee no longer supported. '
                                 'Fee must be specified as {"currency":,"address":,"amount":}')
 
             if 'amount' in metadata['fee'] and 'currency' in metadata['fee']:

From 37bccdad9f7e6720ce81daebc187e48e31bfed54 Mon Sep 17 00:00:00 2001
From: Lex Berezhny <lex@damoti.com>
Date: Sat, 9 Jun 2018 17:39:36 -0400
Subject: [PATCH 2/3] added dependency: six

---
 setup.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 08bea2635..6fb56035d 100644
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,8 @@ requires = [
     'txJSON-RPC',
     'zope.interface',
     'treq',
-    'docopt'
+    'docopt',
+    'six'
 ]
 
 console_scripts = [

From dfd8e7212f51f931b792c90418ab50ad9f7cc08d Mon Sep 17 00:00:00 2001
From: Lex Berezhny <lex@damoti.com>
Date: Sat, 9 Jun 2018 18:16:32 -0400
Subject: [PATCH 3/3] updated changelog

---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c35269613..12ce54b85 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,7 +21,7 @@ at anytime.
   *
 
 ### Changed
-  *
+  * `publish` to accept bid as a decimal string
   *
 
 ### Added