Skip to content

Commit 4d0a8c1

Browse files
committed
patch for pypi to include standardrpcmethods file
1 parent afd425f commit 4d0a8c1

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

HISTORY.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ Release History
33

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

8-
0.10.0 (2019-11-23)
8+
0.10.1 (2019-11-24)
99
-------------------
1010

1111
- Added new Fullnode class for connecting to local bitcoin node via JSON-RPC (thanks goes to https://github.com/xloem for the initial legwork).
1212
- Fullnode class works for Mainnet, Testnet, Scaling-testnet and RegTest (local mock blockchain).
1313
- 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.
1414
- Prepend OP_FALSE to OP_RETURN in preparation for Genesis upgrade coming in February.
1515
- Add 'sweep' function to PrivateKey class for sending all coins to a given address.
16+
- 0.10.1 includes a patch for rpc methods list
1617

1718
0.9.0 (2019-08-11)
1819
------------------

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@ Forked from Ofek's awesome Bit library: https://github.com/ofek/bit
2222
Noticeboard:
2323
------------
2424

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

27-
.. _0.10.0: https://github.com/AustEcon/bitsv/blob/master/HISTORY.rst
27+
.. _0.10.1: https://github.com/AustEcon/bitsv/blob/master/HISTORY.rst
2828

2929
- Added new Fullnode class for connecting to local bitcoin node via JSON-RPC (thanks goes to https://github.com/xloem for the initial legwork).
3030
- Fullnode class works for Mainnet, Testnet, Scaling-testnet and RegTest (local mock blockchain).
3131
- 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.
3232
- Prepend OP_FALSE to OP_RETURN in preparation for Genesis upgrade coming in February.
3333
- Add 'sweep' function to PrivateKey class for sending all coins to a given address.
34+
- 0.10.1 includes a patch for rpc methods list
3435

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

bitsv/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
from bitsv.network.services import set_service_timeout, FullNode
44
from bitsv.wallet import Key, PrivateKey, wif_to_key
55

6-
__version__ = '0.10.0'
6+
__version__ = '0.10.1'

bitsv/network/services/fullnode.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
from .insight import BSV_TO_SAT_MULTIPLIER
55
from bitsv.network.meta import Unspent
66
from bitsv.network.transaction import Transaction, TxInput, TxOutput
7-
from pathlib import Path
8-
7+
from .standardrpcmethods import standard_methods
98

109
bitsv_methods = [
1110
'get_balance',
@@ -16,12 +15,6 @@
1615
'rpc_reconnect'
1716
]
1817

19-
BASE_DIR = Path(__file__).resolve().parent
20-
path_to_standardrpcmethods = Path.joinpath(BASE_DIR, "standardrpcmethods").with_suffix('.txt')
21-
22-
with open(path_to_standardrpcmethods.as_posix(), 'r') as f:
23-
standardmethods = [lines.strip() for lines in f]
24-
2518

2619
class FullNode:
2720

@@ -72,7 +65,7 @@ def __getattr__(self, rpc_method):
7265
def __dir__(self):
7366
fulllist = []
7467
fulllist.extend(bitsv_methods)
75-
fulllist.extend(standardmethods)
68+
fulllist.extend(standard_methods)
7669
fulllist.extend(self.__dict__.keys())
7770
return fulllist
7871

@@ -161,7 +154,7 @@ def __init__(self, rpc_method, host):
161154
self._host = host
162155

163156
def __getattr__(self, rpc_method):
164-
if rpc_method in standardmethods:
157+
if rpc_method in standard_methods:
165158
return RPCMethod(rpc_method, self._host)
166159
else:
167160
raise AttributeError("No such method: {} exists".format(rpc_method))

bitsv/network/services/standardrpcmethods.txt renamed to bitsv/network/services/standardrpcmethods.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
standardmethods = """
12
getbestblockhash
23
getblock
34
getblockchaininfo
@@ -102,3 +103,5 @@
102103
setaccount
103104
settxfee
104105
signmessage
106+
"""
107+
standard_methods = standardmethods.splitlines()[1::]

0 commit comments

Comments
 (0)