From 5e96380d7ba7dc319575e0eb110458d0b4a3fa04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sa=C5=82aban?= Date: Thu, 30 Nov 2017 04:25:42 +0100 Subject: [PATCH] Update info --- LICENSE | 4 ++-- README.md | 6 +++++- monero/address.py | 2 +- monero/backends/jsonrpc.py | 6 ++---- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/LICENSE b/LICENSE index 647c1b6..c4e84df 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ BSD 3-Clause License -Copyright (c) 2017 Michał Sałaban. -Copyright (c) 2016 The MoneroPy Developers. +Copyright (c) 2017 Michał Sałaban +Copyright (c) 2016 The MoneroPy Developers All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index 2bd87a0..f3b9e18 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@ Python Monero module ==================== +A comprehensive Python module for handling Monero cryptocurrency. + +THIS CODE IS UNDER INTENSIVE DEVELOPMENT. Do not rely on the API, it may change. + Copyrights ---------- Released under the BSD 3-Clause License. See [LICENSE](LICENSE). (c) 2017 Michał Sałaban -(c) 2016 The MoneroPy Developers +(c) 2016 The MoneroPy Developers (monero/base58.py taken from [MoneroPy](https://github.com/bigreddmachine/MoneroPy)) diff --git a/monero/address.py b/monero/address.py index 93016d9..68894d7 100644 --- a/monero/address.py +++ b/monero/address.py @@ -21,7 +21,7 @@ class Address(object): raise ValueError("Invalid checksum") if self._decoded[0] not in self._valid_netbytes: raise ValueError("Invalid address netbyte {nb}. Allowed values are: {allowed}".format( - nb=hexlify(bytes(self._decoded[0])), + nb=self._decoded[0], allowed=", ".join(map(lambda b: '%02x' % b, self._valid_netbytes)))) def is_testnet(self): diff --git a/monero/backends/jsonrpc.py b/monero/backends/jsonrpc.py index 80b0c50..f0c8f98 100644 --- a/monero/backends/jsonrpc.py +++ b/monero/backends/jsonrpc.py @@ -7,7 +7,7 @@ import requests from .. import exceptions from ..account import Account -from ..address import address +from ..address import address, Address from ..numbers import from_atomic, to_atomic _log = logging.getLogger(__name__) @@ -46,7 +46,7 @@ class JSONRPC(object): return [Address(_addresses['address'])] addresses = [None] * (max(map(operator.itemgetter('address_index'), _addresses['addresses'])) + 1) for _addr in _addresses['addresses']: - addresses[_addr['address_index']] = Address(_addr['address']) + addresses[_addr['address_index']] = address(_addr['address']) return addresses def get_balance(self, account=0): @@ -75,7 +75,6 @@ class JSONRPC(object): } def transfer(self, destinations, priority, mixin, unlock_time, account=0): - print(destinations) data = { 'account_index': account, 'destinations': list(map( @@ -130,7 +129,6 @@ class JSONRPC(object): if 'error' in result: err = result['error'] - # TODO: resolve code, raise exception _log.error(u"JSON RPC error:\n{result}".format(result=_ppresult)) if err['code'] in _err2exc: raise _err2exc[err['code']](err['message'])