From 6470678d8e0f1b986bc5d5d919954347b69d0e4e Mon Sep 17 00:00:00 2001 From: Dusan Klinec Date: Wed, 3 Oct 2018 16:32:35 +0200 Subject: [PATCH] xmr: black styling --- src/apps/monero/protocol/key_image_sync.py | 4 ++-- src/apps/monero/protocol/signing/step_01_init_transaction.py | 2 +- src/apps/monero/protocol/signing/step_02_set_input.py | 4 ++-- .../monero/protocol/signing/step_03_inputs_permutation.py | 2 +- src/apps/monero/protocol/signing/step_04_input_vini.py | 2 +- src/apps/monero/protocol/signing/step_05_all_in_set.py | 2 +- src/apps/monero/protocol/signing/step_06_set_out1.py | 2 +- src/apps/monero/protocol/signing/step_07_all_out1_set.py | 2 +- src/apps/monero/protocol/signing/step_08_mlsag_done.py | 2 +- src/apps/monero/protocol/signing/step_09_sign_input.py | 2 +- src/apps/monero/xmr/bulletproof.py | 2 +- src/apps/monero/xmr/serialize/int_serialize.py | 4 ++-- src/apps/monero/xmr/serialize_messages/tx_prefix.py | 2 +- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/apps/monero/protocol/key_image_sync.py b/src/apps/monero/protocol/key_image_sync.py index 917a94039..9edc19c94 100644 --- a/src/apps/monero/protocol/key_image_sync.py +++ b/src/apps/monero/protocol/key_image_sync.py @@ -30,7 +30,7 @@ async def init(self, ctx, msg): from trezor.messages import FailureType from trezor.messages.Failure import Failure from trezor.messages.MoneroKeyImageExportInitAck import ( - MoneroKeyImageExportInitAck + MoneroKeyImageExportInitAck, ) self.ctx = ctx @@ -97,7 +97,7 @@ async def sync(self, ctx, tds): async def final(self, ctx, msg=None): from apps.monero.layout import confirms from trezor.messages.MoneroKeyImageSyncFinalAck import ( - MoneroKeyImageSyncFinalAck + MoneroKeyImageSyncFinalAck, ) self.ctx = ctx diff --git a/src/apps/monero/protocol/signing/step_01_init_transaction.py b/src/apps/monero/protocol/signing/step_01_init_transaction.py index 1353c9c6c..95694afbc 100644 --- a/src/apps/monero/protocol/signing/step_01_init_transaction.py +++ b/src/apps/monero/protocol/signing/step_01_init_transaction.py @@ -343,7 +343,7 @@ def _encrypt_payment_id(payment_id, public_key, secret_key): derivation_p = crypto.generate_key_derivation(public_key, secret_key) derivation = bytearray(33) derivation = crypto.encodepoint_into(derivation, derivation_p) - derivation[32] = 0x8b + derivation[32] = 0x8B hash = crypto.cn_fast_hash(derivation) pm_copy = bytearray(payment_id) for i in range(8): diff --git a/src/apps/monero/protocol/signing/step_02_set_input.py b/src/apps/monero/protocol/signing/step_02_set_input.py index a7a1fbe50..483270c69 100644 --- a/src/apps/monero/protocol/signing/step_02_set_input.py +++ b/src/apps/monero/protocol/signing/step_02_set_input.py @@ -19,13 +19,13 @@ if False: from trezor.messages.MoneroTransactionSourceEntry import ( - MoneroTransactionSourceEntry + MoneroTransactionSourceEntry, ) async def set_input(state: State, src_entr: MoneroTransactionSourceEntry): from trezor.messages.MoneroTransactionSetInputAck import ( - MoneroTransactionSetInputAck + MoneroTransactionSetInputAck, ) from apps.monero.xmr.enc import chacha_poly from apps.monero.xmr.serialize_messages.tx_prefix import TxinToKey diff --git a/src/apps/monero/protocol/signing/step_03_inputs_permutation.py b/src/apps/monero/protocol/signing/step_03_inputs_permutation.py index d6c3c4d18..83b6f53c9 100644 --- a/src/apps/monero/protocol/signing/step_03_inputs_permutation.py +++ b/src/apps/monero/protocol/signing/step_03_inputs_permutation.py @@ -18,7 +18,7 @@ async def tsx_inputs_permutation(state: State, permutation: list): from trezor.messages.MoneroTransactionInputsPermutationAck import ( - MoneroTransactionInputsPermutationAck + MoneroTransactionInputsPermutationAck, ) await transaction_step(state.ctx, state.STEP_PERM) diff --git a/src/apps/monero/protocol/signing/step_04_input_vini.py b/src/apps/monero/protocol/signing/step_04_input_vini.py index d9228c9a3..242c07f38 100644 --- a/src/apps/monero/protocol/signing/step_04_input_vini.py +++ b/src/apps/monero/protocol/signing/step_04_input_vini.py @@ -15,7 +15,7 @@ async def input_vini( state: State, src_entr, vini_bin, hmac, pseudo_out, pseudo_out_hmac ): from trezor.messages.MoneroTransactionInputViniAck import ( - MoneroTransactionInputViniAck + MoneroTransactionInputViniAck, ) await confirms.transaction_step( diff --git a/src/apps/monero/protocol/signing/step_05_all_in_set.py b/src/apps/monero/protocol/signing/step_05_all_in_set.py index 3b6a83bbe..dfc264421 100644 --- a/src/apps/monero/protocol/signing/step_05_all_in_set.py +++ b/src/apps/monero/protocol/signing/step_05_all_in_set.py @@ -19,7 +19,7 @@ async def all_in_set(state: State, rsig_data): # todo: rsig_data not used? await confirms.transaction_step(state.ctx, state.STEP_ALL_IN) from trezor.messages.MoneroTransactionAllInputsSetAck import ( - MoneroTransactionAllInputsSetAck + MoneroTransactionAllInputsSetAck, ) from trezor.messages.MoneroTransactionRsigData import MoneroTransactionRsigData diff --git a/src/apps/monero/protocol/signing/step_06_set_out1.py b/src/apps/monero/protocol/signing/step_06_set_out1.py index 7be15a5c0..313222b54 100644 --- a/src/apps/monero/protocol/signing/step_06_set_out1.py +++ b/src/apps/monero/protocol/signing/step_06_set_out1.py @@ -98,7 +98,7 @@ async def set_out1(state: State, dst_entr, dst_entr_hmac, rsig_data=None): state.mem_trace(14, True) from trezor.messages.MoneroTransactionSetOutputAck import ( - MoneroTransactionSetOutputAck + MoneroTransactionSetOutputAck, ) out_pk_bin = bytearray(64) diff --git a/src/apps/monero/protocol/signing/step_07_all_out1_set.py b/src/apps/monero/protocol/signing/step_07_all_out1_set.py index 2a7b4b7b9..94c1e891d 100644 --- a/src/apps/monero/protocol/signing/step_07_all_out1_set.py +++ b/src/apps/monero/protocol/signing/step_07_all_out1_set.py @@ -75,7 +75,7 @@ async def all_out1_set(state: State): from trezor.messages.MoneroRingCtSig import MoneroRingCtSig from trezor.messages.MoneroTransactionAllOutSetAck import ( - MoneroTransactionAllOutSetAck + MoneroTransactionAllOutSetAck, ) # Initializes RCTsig structure (fee, tx prefix hash, type) diff --git a/src/apps/monero/protocol/signing/step_08_mlsag_done.py b/src/apps/monero/protocol/signing/step_08_mlsag_done.py index 61afc1437..68f2ec5e9 100644 --- a/src/apps/monero/protocol/signing/step_08_mlsag_done.py +++ b/src/apps/monero/protocol/signing/step_08_mlsag_done.py @@ -9,7 +9,7 @@ async def mlsag_done(state: State): from trezor.messages.MoneroTransactionMlsagDoneAck import ( - MoneroTransactionMlsagDoneAck + MoneroTransactionMlsagDoneAck, ) # state.state.set_final_message_done() todo needed? diff --git a/src/apps/monero/protocol/signing/step_09_sign_input.py b/src/apps/monero/protocol/signing/step_09_sign_input.py index bec615eaa..39318c275 100644 --- a/src/apps/monero/protocol/signing/step_09_sign_input.py +++ b/src/apps/monero/protocol/signing/step_09_sign_input.py @@ -187,7 +187,7 @@ async def sign_input( state.mem_trace() from trezor.messages.MoneroTransactionSignInputAck import ( - MoneroTransactionSignInputAck + MoneroTransactionSignInputAck, ) return MoneroTransactionSignInputAck( diff --git a/src/apps/monero/xmr/bulletproof.py b/src/apps/monero/xmr/bulletproof.py index 66aa18ffe..174c73441 100644 --- a/src/apps/monero/xmr/bulletproof.py +++ b/src/apps/monero/xmr/bulletproof.py @@ -987,7 +987,7 @@ def pow_two(i, d=None): flr = i // 2 lw = pow_two(flr) - rw = pow_two(flr + 1 if flr != i / 2. else lw) + rw = pow_two(flr + 1 if flr != i / 2.0 else lw) return sc_mul(d, lw, rw) return KeyVPrecomp(size, self.twoN, pow_two) diff --git a/src/apps/monero/xmr/serialize/int_serialize.py b/src/apps/monero/xmr/serialize/int_serialize.py index a965f6b8d..97b17c945 100644 --- a/src/apps/monero/xmr/serialize/int_serialize.py +++ b/src/apps/monero/xmr/serialize/int_serialize.py @@ -21,7 +21,7 @@ def dump_uint(writer, n, width): """ buffer = _UINT_BUFFER for _ in range(width): - buffer[0] = n & 0xff + buffer[0] = n & 0xFF writer.write(buffer) n >>= 8 @@ -79,7 +79,7 @@ def dump_uint_b_into(n, width, buffer, offset=0): Serializes fixed size integer to the buffer """ for idx in range(width): - buffer[idx + offset] = n & 0xff + buffer[idx + offset] = n & 0xFF n >>= 8 return buffer diff --git a/src/apps/monero/xmr/serialize_messages/tx_prefix.py b/src/apps/monero/xmr/serialize_messages/tx_prefix.py index de8384a84..0a0ddd0d2 100644 --- a/src/apps/monero/xmr/serialize_messages/tx_prefix.py +++ b/src/apps/monero/xmr/serialize_messages/tx_prefix.py @@ -53,7 +53,7 @@ def f_specs(cls): class TxinGen(MessageType): __slots__ = ("height",) - VARIANT_CODE = 0xff + VARIANT_CODE = 0xFF @classmethod def f_specs(cls):