Skip to content

Commit

Permalink
xmr: py3 only inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Sep 13, 2018
1 parent 8031b1b commit aa86fb1
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/apps/monero/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


# persistent state objects
class Holder(object):
class Holder:
def __init__(self):
self.ctx_sign = None
self.ctx_ki = None
Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/controller/iface.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class TrezorInterface(object):
class TrezorInterface:
def __init__(self, ctx=None):
self.ctx = ctx

Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/controller/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TrezorChangeAddressError(TrezorError):
pass


class StdObj(object):
class StdObj:
def __init__(self, **kwargs):
for kw in kwargs:
setattr(self, kw, kwargs[kw])
Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/protocol/key_image_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from apps.monero.controller import wrapper as twrap


class KeyImageSync(object):
class KeyImageSync:
def __init__(self, ctx=None, iface=None, creds=None):
from apps.monero.xmr import crypto
from apps.monero.xmr.sub.keccak_hasher import HashWrapper
Expand Down
4 changes: 2 additions & 2 deletions src/apps/monero/protocol/tsx_sign_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
from apps.monero.xmr import common, crypto, monero


class TprefixStub(object):
class TprefixStub:
__slots__ = ("version", "unlock_time", "vin", "vout", "extra")

def __init__(self, **kwargs):
for kw in kwargs:
setattr(self, kw, kwargs[kw])


class TTransactionBuilder(object):
class TTransactionBuilder:
"""
Transaction builder
"""
Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/protocol/tsx_sign_state.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from micropython import const


class TState(object):
class TState:
"""
Transaction state
"""
Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/protocol/tsx_sign_state_holder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class TsxSignStateHolder(object):
class TsxSignStateHolder:
"""
Simple transaction signer state holder.
Externalized state uses smaller amount of memory compared to storing the builder instance in the state.
Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/protocol_lite/lite.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def memcpy(dst, dst_off, src, src_off, ln):
return dst


class LiteProtocol(object):
class LiteProtocol:
"""
Lite protocol
"""
Expand Down
6 changes: 3 additions & 3 deletions src/apps/monero/xmr/bulletproof.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def get_exponent(dst, base, idx):
#


class KeyVBase(object):
class KeyVBase:
"""
Base KeyVector object
"""
Expand Down Expand Up @@ -786,7 +786,7 @@ def is_reduced(sc):
return crypto.encodeint(crypto.decodeint(sc)) == sc


class MultiExpSequential(object):
class MultiExpSequential:
"""
MultiExp object similar to MultiExp array of [(scalar, point), ]
MultiExp computes simply: res = \sum_i scalar_i * point_i
Expand Down Expand Up @@ -840,7 +840,7 @@ def multiexp(dst=None, data=None, GiHi=False):
return data.eval(dst, GiHi)


class BulletProofBuilder(object):
class BulletProofBuilder:
def __init__(self):
self.use_det_masks = True
self.proof_sec = None
Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/xmr/serialize/xmrserialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def import_def(module, name):
return r


class Archive(object):
class Archive:
"""
Archive object for object binary serialization / deserialization.
Resembles Archive API from the Monero codebase or Boost serialization archive.
Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/xmr/serialize_messages/tx_rsig.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class RctType(object):
class RctType:
Null = 0
Full = 1
Simple = 2
Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/xmr/sub/creds.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from apps.monero.xmr.sub.xmr_net import NetworkTypes, net_version


class AccountCreds(object):
class AccountCreds:
"""
Stores account private keys
"""
Expand Down
4 changes: 2 additions & 2 deletions src/apps/monero/xmr/sub/keccak_hasher.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from apps.monero.xmr import crypto


class KeccakXmrArchive(object):
class KeccakXmrArchive:
def __init__(self, ctx=None):
self.kwriter = get_keccak_writer(ctx=ctx)
self.ar = None
Expand Down Expand Up @@ -51,7 +51,7 @@ async def container_size(
return await ar.container_size(container_len, container_type, params)


class HashWrapper(object):
class HashWrapper:
def __init__(self, ctx):
self.ctx = ctx

Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/xmr/sub/mlsag_hasher.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from apps.monero.xmr import crypto


class PreMlsagHasher(object):
class PreMlsagHasher:
"""
Iterative construction of the pre_mlsag_hash
"""
Expand Down
8 changes: 4 additions & 4 deletions src/apps/monero/xmr/sub/xmr_net.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
class NetworkTypes(object):
class NetworkTypes:
MAINNET = 0
TESTNET = 1
STAGENET = 2
FAKECHAIN = 3


class MainNet(object):
class MainNet:
PUBLIC_ADDRESS_BASE58_PREFIX = 18
PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 19
PUBLIC_SUBADDRESS_BASE58_PREFIX = 42


class TestNet(object):
class TestNet:
PUBLIC_ADDRESS_BASE58_PREFIX = 53
PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 54
PUBLIC_SUBADDRESS_BASE58_PREFIX = 63


class StageNet(object):
class StageNet:
PUBLIC_ADDRESS_BASE58_PREFIX = 24
PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 25
PUBLIC_SUBADDRESS_BASE58_PREFIX = 36
Expand Down

0 comments on commit aa86fb1

Please sign in to comment.