Skip to content

Commit 72989a8

Browse files
committed
Merge branch 'develop' into feature/storage-models
2 parents 803f828 + dc0f7ab commit 72989a8

13 files changed

Lines changed: 108 additions & 33 deletions

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
dist: trusty
12
language: python
23
sudo: false
34
python:
@@ -14,5 +15,13 @@ install:
1415
- pip install tox-travis codecov
1516
script:
1617
- tox
18+
- sed -i 's/filename="/filename=".\//g' coverage.xml
19+
- ( which sonar-scanner && sonar-scanner || true )
1720
after_success:
1821
- codecov
22+
23+
addons:
24+
sonarcloud:
25+
organization: bitshares
26+
token:
27+
secure: "dSFPBeC5Gr9oiU0weJY3rJXfc68uo2zvfRMcYRSQdqruAtrNqqmJCew0rANDtJPLkKxfIzbJSkokKCvt3f1SXbIOnbuAv/MN2TKDZkqZyve3AdMgYifepHwzK14KWO79ga7gaBKa6CxayZbOkX0BWciOO+5QFlBtmYdov3JpxboymZH9jJKdRs2C3mrIfGQG48u1qaFNaFFRKCvlCY0pXM7MbxFf1C+EADJC1CeR5yHQ2Zd3K6dIh+JpiZ9b1DbxjwWeRC7fOQ9KFV6I8I+GPPjKsS50/96m7SPlnriogYKx4DXRD85by2HfRUUv2bsDXzz4kLo2KR3c358lyhhh3qZBmJS/fJEq+s9Tmqcxb4ssMmht6tpQKnc6NWN4Z/wK0+nyBqFZryZnzO863HRu6GM1d6Mp7q976z1u5UWgPi2D5Y2ulZNfan4T+NVZViTM/XD8Mj9tOpml1A1LbDt3lgHulV9vUD1Hd/TzWh546ydN3hCnGbeuSDY2N5GKNptOAG48sXWPgGc8y8X0yBY+0c3oo0JaMIP1e7IIXEcmq2LI/gF8C0feTKMbBFQSG8kAHHJhOLrV5o9aUFyWK1YT4AADRZrUKXlRaL6rnA0tXDxuGpwYkaB6zbA/c2l2pxsysO5REpbIgn1o6emo5XJ9flXMszwmDqvoio0XaB4JcJY="

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
include *.md
2+
include requirements*.txt

README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,19 @@ Visit the [pybitshares website](http://docs.pybitshares.com/en/latest/) for in d
2828
## Installation
2929

3030
### Install with pip3:
31-
```
32-
$ sudo apt-get install libffi-dev libssl-dev python-dev python3-dev python3-pip
33-
$ pip3 install bitshares
34-
```
31+
32+
$ sudo apt-get install libffi-dev libssl-dev python-dev python3-dev python3-pip
33+
$ pip3 install bitshares
3534

3635
### Manual installation:
37-
```
38-
$ git clone https://github.com/bitshares/python-bitshares/
39-
$ cd python-bitshares
40-
$ python3 setup.py install --user
41-
```
36+
37+
$ git clone https://github.com/bitshares/python-bitshares/
38+
$ cd python-bitshares
39+
$ python3 setup.py install --user
4240

4341
### Upgrade
44-
```
45-
$ pip3 install --user --upgrade
46-
```
42+
43+
$ pip3 install --user --upgrade bitshares
4744

4845
## Contributing
4946

bitshares/market.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ def ticker(self):
114114
"""
115115
data = {}
116116
# Core Exchange rate
117-
cer = self["quote"]["options"]["core_exchange_rate"]
117+
if self["quote"]["id"] == '1.3.0':
118+
cer = self["base"]["options"]["core_exchange_rate"]
119+
else:
120+
cer = self["quote"]["options"]["core_exchange_rate"]
118121
data["core_exchange_rate"] = Price(
119122
cer,
120123
blockchain_instance=self.blockchain

bitshares/memo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Memo(object):
2626
2727
from bitshares.memo import Memo
2828
m = Memo("bitshareseu", "wallet.xeroc")
29-
m.bitshares.wallet.unlock("secret")
29+
m.blockchain.wallet.unlock("secret")
3030
enc = (m.encrypt("foobar"))
3131
print(enc)
3232
>> {'nonce': '17329630356955254641', 'message': '8563e2bb2976e0217806d642901a2855'}
@@ -39,7 +39,7 @@ class Memo(object):
3939
4040
from bitshares.memo import Memo
4141
m = Memo()
42-
m.bitshares.wallet.unlock("secret")
42+
m.blockchain.wallet.unlock("secret")
4343
print(memo.decrypt(op_data["memo"]))
4444
4545
if ``op_data`` being the payload of a transfer operation.

bitshares/transactionbuilder.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,15 @@ def fetchkeys(account, perm, level=0, required_treshold=1):
229229
# Try obtain the private key from wallet
230230
wif = self.blockchain.wallet.getPrivateKeyForPublicKey(
231231
authority[0])
232-
except Exception:
232+
except Exception as e:
233233
continue
234234

235235
if wif:
236236
r.append([wif, authority[1]])
237+
# If we found a key for account, we add it
238+
# to signing_accounts to be sure we do not resign
239+
# another operation with the same account/wif
240+
self.signing_accounts.append(account)
237241

238242
# Test if we reached threshold already
239243
if sum([x[1] for x in r]) >= required_treshold:
@@ -267,13 +271,13 @@ def fetchkeys(account, perm, level=0, required_treshold=1):
267271
)
268272
# ... or should we rather obtain the keys from an account name
269273
else:
270-
account = Account(account, blockchain_instance=self.blockchain)
271-
required_treshold = account[permission]["weight_threshold"]
272-
keys = fetchkeys(account, permission, required_treshold=required_treshold)
274+
accountObj = Account(account, blockchain_instance=self.blockchain)
275+
required_treshold = accountObj[permission]["weight_threshold"]
276+
keys = fetchkeys(accountObj, permission, required_treshold=required_treshold)
273277
# If we couldn't find an active key, let's try overwrite it
274278
# with an owner key
275279
if not keys and permission != "owner":
276-
keys.extend(fetchkeys(account, "owner", required_treshold=required_treshold))
280+
keys.extend(fetchkeys(accountObj, "owner", required_treshold=required_treshold))
277281
for x in keys:
278282
self.appendWif(x[0])
279283

bitsharesapi/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import re
2-
from grapheneapi.graphenewsrpc import RPCError
2+
from grapheneapi.exceptions import RPCError
33

44

55
def decodeRPCErrorMsg(e):

requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
graphenelib<=0.6.6
2+
websockets
3+
appdirs
4+
Events
5+
scrypt
6+
pycryptodome

setup.cfg

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ description-file = README.md
55
test=pytest
66

77
[coverage:run]
8-
#source=bitshares*
8+
source=bitsharesbase,bitsharesapi,bitshares
9+
branch=True
910
omit=
1011
tests/*
1112
.tox/*
@@ -15,6 +16,16 @@ omit=
1516
include=bitshares*
1617
ignore_errors=True
1718
show_missing=True
19+
exclude_lines =
20+
pragma: no cover
21+
def __repr__
22+
if self.debug:
23+
if settings.DEBUG
24+
raise AssertionError
25+
raise NotImplementedError
26+
if 0:
27+
if __name__ == .__main__.:
28+
if sys.version > '3':
1829

1930
[flake8]
2031
ignore = E501,F401
@@ -26,3 +37,12 @@ exclude =
2637
# The conf file is mostly autogenerated, ignore it
2738
docs/conf.py,
2839
max-complexity = 15
40+
41+
# [nosetests]
42+
# with-coverage=1
43+
# with-xunit=1
44+
# #cover-branches=1
45+
# cover-xml=1
46+
# cover-inclusive=1
47+
# detailed-errors=1
48+
# cover-package=graphenebase,grapheneapi,graphenestorage,graphene

setup.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
ascii = codecs.lookup('ascii')
1212
codecs.register(lambda name, enc=ascii: {True: enc}.get(name == 'mbcs'))
1313

14-
VERSION = '0.1.19'
14+
VERSION = '0.1.22'
1515

1616
setup(
1717
name='bitshares',
@@ -39,14 +39,7 @@
3939
'Intended Audience :: Financial and Insurance Industry',
4040
'Topic :: Office/Business :: Financial',
4141
],
42-
install_requires=[
43-
"graphenelib>=0.6.3",
44-
"websockets",
45-
"appdirs",
46-
"Events",
47-
"scrypt",
48-
"pycryptodome", # for AES, installed through graphenelib already
49-
],
42+
install_requires=open("requirements.txt").readlines(),
5043
setup_requires=['pytest-runner'],
5144
tests_require=['pytest'],
5245
include_package_data=True,

0 commit comments

Comments
 (0)