mirror of
https://git.wownero.com/lza_menace/wownero-python.git
synced 2024-08-15 03:25:25 +00:00
refactoring for wownero
This commit is contained in:
parent
324fb71587
commit
026992a812
11 changed files with 19 additions and 19 deletions
|
@ -10,8 +10,8 @@ from . import const
|
|||
from . import ed25519
|
||||
from . import numbers
|
||||
|
||||
_ADDR_REGEX = re.compile(r'^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{95}$')
|
||||
_IADDR_REGEX = re.compile(r'^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{106}$')
|
||||
_ADDR_REGEX = re.compile(r'^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{97}$')
|
||||
_IADDR_REGEX = re.compile(r'^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{108}$')
|
||||
|
||||
class BaseAddress(object):
|
||||
label = None
|
||||
|
|
|
@ -34,7 +34,7 @@ class JSONRPCDaemon(object):
|
|||
|
||||
_net = None
|
||||
|
||||
def __init__(self, protocol='http', host='127.0.0.1', port=18081, path='/json_rpc',
|
||||
def __init__(self, protocol='http', host='127.0.0.1', port=34568, path='/json_rpc',
|
||||
user='', password='', timeout=30, verify_ssl_certs=True, proxy_url=None):
|
||||
self.url = '{protocol}://{host}:{port}'.format(
|
||||
protocol=protocol,
|
||||
|
@ -209,7 +209,7 @@ class JSONRPCWallet(object):
|
|||
"""
|
||||
_master_address = None
|
||||
|
||||
def __init__(self, protocol='http', host='127.0.0.1', port=18088, path='/json_rpc',
|
||||
def __init__(self, protocol='http', host='127.0.0.1', port=8888, path='/json_rpc',
|
||||
user='', password='', timeout=30, verify_ssl_certs=True, proxy_url=None):
|
||||
self.url = '{protocol}://{host}:{port}/json_rpc'.format(
|
||||
protocol=protocol,
|
||||
|
|
|
@ -3,9 +3,9 @@ NET_STAGE = "stage"
|
|||
NET_TEST = "test"
|
||||
|
||||
NETS = (NET_MAIN, NET_TEST, NET_STAGE)
|
||||
MASTERADDR_NETBYTES = (18, 53, 24)
|
||||
SUBADDR_NETBYTES = (42, 63, 36)
|
||||
INTADDRR_NETBYTES = (19, 54, 25)
|
||||
MASTERADDR_NETBYTES = (4146, 53, 24)
|
||||
SUBADDR_NETBYTES = (12208, 63, 36)
|
||||
INTADDRR_NETBYTES = (6810, 54, 25)
|
||||
|
||||
PRIO_UNIMPORTANT = 1
|
||||
PRIO_NORMAL = 2
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from decimal import Decimal
|
||||
import six
|
||||
|
||||
PICONERO = Decimal('0.000000000001')
|
||||
PICONERO = Decimal('0.00000000001')
|
||||
EMPTY_KEY = '0' * 64
|
||||
|
||||
|
||||
|
|
|
@ -168,12 +168,12 @@ class Seed(object):
|
|||
if net not in const.NETS:
|
||||
raise ValueError(
|
||||
"Invalid net argument '{:s}'. Must be one of monero.const.NET_*".format(net))
|
||||
netbyte = (18, 53, 24)[const.NETS.index(net)]
|
||||
netbyte = const.MASTERADDR_NETBYTES[const.NETS.index(net)]
|
||||
data = "{:x}{:s}{:s}".format(netbyte, self.public_spend_key(), self.public_view_key())
|
||||
h = keccak_256()
|
||||
h.update(unhexlify(data))
|
||||
checksum = h.hexdigest()
|
||||
return address(base58.encode(data + checksum[0:8]))
|
||||
return address(base58.encode(data + checksum[0:10]))
|
||||
|
||||
|
||||
def generate_hex(n_bytes=32):
|
||||
|
|
|
@ -10,10 +10,10 @@ from monero.transaction import Transaction
|
|||
from .base import JSONTestCase
|
||||
|
||||
class JSONRPCDaemonTestCase(JSONTestCase):
|
||||
jsonrpc_url = 'http://127.0.0.1:18081/json_rpc'
|
||||
mempool_url = 'http://127.0.0.1:18081/get_transaction_pool'
|
||||
transactions_url = 'http://127.0.0.1:18081/get_transactions'
|
||||
sendrawtransaction_url = 'http://127.0.0.1:18081/sendrawtransaction'
|
||||
jsonrpc_url = 'http://127.0.0.1:34568/json_rpc'
|
||||
mempool_url = 'http://127.0.0.1:34568/get_transaction_pool'
|
||||
transactions_url = 'http://127.0.0.1:34568/get_transactions'
|
||||
sendrawtransaction_url = 'http://127.0.0.1:34568/sendrawtransaction'
|
||||
data_subdir = 'test_jsonrpcdaemon'
|
||||
|
||||
def setUp(self):
|
||||
|
|
|
@ -15,7 +15,7 @@ def url_data(url):
|
|||
|
||||
def get_daemon():
|
||||
argsparser = argparse.ArgumentParser(description="Display daemon info")
|
||||
argsparser.add_argument('daemon_rpc_url', nargs='?', type=url_data, default='127.0.0.1:18081',
|
||||
argsparser.add_argument('daemon_rpc_url', nargs='?', type=url_data, default='127.0.0.1:34568',
|
||||
help="Daemon RPC URL [host[:port]]")
|
||||
argsparser.add_argument('-p', dest='proxy_url', nargs='?', type=str, default=None, help="Proxy URL")
|
||||
argsparser.add_argument('-t', dest='timeout', type=int, default=30, help="Request timeout")
|
||||
|
|
|
@ -23,7 +23,7 @@ argsparser.add_argument(
|
|||
"-d",
|
||||
dest="daemon_rpc_url",
|
||||
type=url_data,
|
||||
default="127.0.0.1:18081",
|
||||
default="127.0.0.1:34568",
|
||||
help="Daemon RPC URL [host[:port]]",
|
||||
)
|
||||
argsparser.add_argument(
|
||||
|
|
|
@ -18,7 +18,7 @@ def url_data(url):
|
|||
return dict(filter(operator.itemgetter(1), gs.items()))
|
||||
|
||||
argsparser = argparse.ArgumentParser(description="Push transaction to network")
|
||||
argsparser.add_argument('daemon_rpc_url', nargs='?', type=url_data, default='127.0.0.1:18081',
|
||||
argsparser.add_argument('daemon_rpc_url', nargs='?', type=url_data, default='127.0.0.1:34568',
|
||||
help="Daemon RPC URL [host[:port]]")
|
||||
argsparser.add_argument('-v', dest='verbosity', action='count', default=0,
|
||||
help="Verbosity (repeat to increase; -v for INFO, -vv for DEBUG")
|
||||
|
|
|
@ -26,7 +26,7 @@ def destpair(s):
|
|||
argsparser = argparse.ArgumentParser(description="Transfer Monero")
|
||||
argsparser.add_argument('-v', dest='verbosity', action='count', default=0,
|
||||
help="Verbosity (repeat to increase; -v for INFO, -vv for DEBUG")
|
||||
argsparser.add_argument('wallet_rpc_url', nargs='?', type=url_data, default='127.0.0.1:18082',
|
||||
argsparser.add_argument('wallet_rpc_url', nargs='?', type=url_data, default='127.0.0.1:34562',
|
||||
help="Wallet RPC URL [user[:password]@]host[:port]")
|
||||
argsparser.add_argument('-t', dest='timeout', type=int, default=30, help="Request timeout")
|
||||
argsparser.add_argument('-a', dest='account', default=0, type=int, help="Source account index")
|
||||
|
|
|
@ -16,7 +16,7 @@ def url_data(url):
|
|||
|
||||
def get_wallet():
|
||||
argsparser = argparse.ArgumentParser(description="Display wallet contents")
|
||||
argsparser.add_argument('wallet_rpc_url', nargs='?', type=url_data, default='127.0.0.1:18082',
|
||||
argsparser.add_argument('wallet_rpc_url', nargs='?', type=url_data, default='127.0.0.1:34562',
|
||||
help="Wallet RPC URL [user[:password]@]host[:port]")
|
||||
argsparser.add_argument('-v', dest='verbosity', action='count', default=0,
|
||||
help="Verbosity (repeat to increase; -v for INFO, -vv for DEBUG")
|
||||
|
|
Loading…
Reference in a new issue