Skip to content

Commit

Permalink
patch for pypi to include standardrpcmethods file
Browse files Browse the repository at this point in the history
  • Loading branch information
AustEcon committed Nov 24, 2019
1 parent afd425f commit 4d0a8c1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
5 changes: 3 additions & 2 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ Release History

Unreleased (see `master <https://github.com/AustEcon/bitsv>`_)
--------------------------------------------------------------
- No new changes since 0.10.0 yet.
- No new changes since 0.10.1 yet.

0.10.0 (2019-11-23)
0.10.1 (2019-11-24)
-------------------

- Added new Fullnode class for connecting to local bitcoin node via JSON-RPC (thanks goes to https://github.com/xloem for the initial legwork).
- Fullnode class works for Mainnet, Testnet, Scaling-testnet and RegTest (local mock blockchain).
- Reordered outputs to always have 'false return' metadata included in the **first** output instead of the last. This will fix a new issue that arose with rendering of images etc. on bico.media.
- Prepend OP_FALSE to OP_RETURN in preparation for Genesis upgrade coming in February.
- Add 'sweep' function to PrivateKey class for sending all coins to a given address.
- 0.10.1 includes a patch for rpc methods list

0.9.0 (2019-08-11)
------------------
Expand Down
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ Forked from Ofek's awesome Bit library: https://github.com/ofek/bit
Noticeboard:
------------

Latest Release - 0.10.0_ (2019-11-23)
Latest Release - 0.10.1_ (2019-11-24)

.. _0.10.0: https://github.com/AustEcon/bitsv/blob/master/HISTORY.rst
.. _0.10.1: https://github.com/AustEcon/bitsv/blob/master/HISTORY.rst

- Added new Fullnode class for connecting to local bitcoin node via JSON-RPC (thanks goes to https://github.com/xloem for the initial legwork).
- Fullnode class works for Mainnet, Testnet, Scaling-testnet and RegTest (local mock blockchain).
- Reordered outputs to always have 'false return' metadata included in the **first** output instead of the last. This will fix a new issue that arose with rendering of images etc. on bico.media.
- Prepend OP_FALSE to OP_RETURN in preparation for Genesis upgrade coming in February.
- Add 'sweep' function to PrivateKey class for sending all coins to a given address.
- 0.10.1 includes a patch for rpc methods list

Previous Release - 0.9.0_ (2019-08-11)

Expand Down
2 changes: 1 addition & 1 deletion bitsv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from bitsv.network.services import set_service_timeout, FullNode
from bitsv.wallet import Key, PrivateKey, wif_to_key

__version__ = '0.10.0'
__version__ = '0.10.1'
13 changes: 3 additions & 10 deletions bitsv/network/services/fullnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
from .insight import BSV_TO_SAT_MULTIPLIER
from bitsv.network.meta import Unspent
from bitsv.network.transaction import Transaction, TxInput, TxOutput
from pathlib import Path

from .standardrpcmethods import standard_methods

bitsv_methods = [
'get_balance',
Expand All @@ -16,12 +15,6 @@
'rpc_reconnect'
]

BASE_DIR = Path(__file__).resolve().parent
path_to_standardrpcmethods = Path.joinpath(BASE_DIR, "standardrpcmethods").with_suffix('.txt')

with open(path_to_standardrpcmethods.as_posix(), 'r') as f:
standardmethods = [lines.strip() for lines in f]


class FullNode:

Expand Down Expand Up @@ -72,7 +65,7 @@ def __getattr__(self, rpc_method):
def __dir__(self):
fulllist = []
fulllist.extend(bitsv_methods)
fulllist.extend(standardmethods)
fulllist.extend(standard_methods)
fulllist.extend(self.__dict__.keys())
return fulllist

Expand Down Expand Up @@ -161,7 +154,7 @@ def __init__(self, rpc_method, host):
self._host = host

def __getattr__(self, rpc_method):
if rpc_method in standardmethods:
if rpc_method in standard_methods:
return RPCMethod(rpc_method, self._host)
else:
raise AttributeError("No such method: {} exists".format(rpc_method))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
standardmethods = """
getbestblockhash
getblock
getblockchaininfo
Expand Down Expand Up @@ -102,3 +103,5 @@
setaccount
settxfee
signmessage
"""
standard_methods = standardmethods.splitlines()[1::]

0 comments on commit 4d0a8c1

Please sign in to comment.