Skip to content

Commit 5dc8627

Browse files
author
Brian Faust
committed
Merge branch 'master' into develop
2 parents f6a26ec + 7e9ba67 commit 5dc8627

9 files changed

Lines changed: 9 additions & 153 deletions

File tree

.github/CODE_OF_CONDUCT.md

Lines changed: 0 additions & 71 deletions
This file was deleted.

.github/CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/ISSUE_TEMPLATE/Bug_report.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/Feature_request.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @faustbrian @supaiku0 @ItsANameToo

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ If you have any questions, requests or ideas open an issue or ask us in #python
2626

2727
## Documentation
2828

29-
You can find installation instructions and detailed instructions on how to use this package at the [dedicated documentation site](https://docs.ark.io/api/sdk/cryptography/python.html).
29+
You can find installation instructions and detailed instructions on how to use this package at the [dedicated documentation site](https://docs.ark.io/sdk/cryptography/python.html).
3030

3131
## Security
3232

crypto/transactions/builder/transfer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ def __init__(self, recipientId, amount, vendorField=None, fee=None):
1717
"""
1818
super().__init__()
1919
self.transaction.recipientId = recipientId
20-
self.transaction.amount = amount
20+
if type(amount) == int and amount > 0:
21+
self.transaction.amount = amount
22+
else:
23+
raise ValueError('Amount is not valid')
2124
self.transaction.vendorField = vendorField.encode() if vendorField else None
2225
if fee:
2326
self.transaction.fee = fee

crypto/transactions/transaction.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,10 @@ def to_bytes(self, skip_signature=True, skip_second_signature=True):
101101
else:
102102
bytes_data += pack('21x')
103103

104-
if self.vendorField and len(self.vendorField) < 65:
104+
if self.vendorField and len(self.vendorField) <= 255:
105105
bytes_data += self.vendorField
106-
bytes_data += pack('{}x'.format(64 - len(self.vendorField)))
106+
if len(self.vendorField) < 64:
107+
bytes_data += pack('{}x'.format(64 - len(self.vendorField)))
107108
else:
108109
bytes_data += pack('64x')
109110

0 commit comments

Comments
 (0)