Skip to content

Commit

Permalink
xmr: black styling
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Oct 3, 2018
1 parent 0266440 commit 6470678
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/apps/monero/protocol/key_image_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions src/apps/monero/protocol/signing/step_02_set_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/protocol/signing/step_04_input_vini.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/protocol/signing/step_05_all_in_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/protocol/signing/step_06_set_out1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/protocol/signing/step_07_all_out1_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/protocol/signing/step_08_mlsag_done.py
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/protocol/signing/step_09_sign_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ async def sign_input(
state.mem_trace()

from trezor.messages.MoneroTransactionSignInputAck import (
MoneroTransactionSignInputAck
MoneroTransactionSignInputAck,
)

return MoneroTransactionSignInputAck(
Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/xmr/bulletproof.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/apps/monero/xmr/serialize/int_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/xmr/serialize_messages/tx_prefix.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def f_specs(cls):

class TxinGen(MessageType):
__slots__ = ("height",)
VARIANT_CODE = 0xff
VARIANT_CODE = 0xFF

@classmethod
def f_specs(cls):
Expand Down

0 comments on commit 6470678

Please sign in to comment.