diff --git a/src/tribler/core/components/bandwidth_accounting/community/payload.py b/src/tribler/core/components/bandwidth_accounting/community/payload.py index d9ed8d0b108..9dcb024facb 100644 --- a/src/tribler/core/components/bandwidth_accounting/community/payload.py +++ b/src/tribler/core/components/bandwidth_accounting/community/payload.py @@ -14,7 +14,7 @@ class BandwidthTransactionPayload(VariablePayload): "timestamp", "request_id"] @classmethod - def from_transaction(cls, transaction: BandwidthTransaction, request_id: int) -> BandwidthTransactionPayload: # noqa: F821 + def from_transaction(cls, transaction, request_id: int) -> BandwidthTransactionPayload: return BandwidthTransactionPayload( transaction.sequence_number, transaction.public_key_a, diff --git a/src/tribler/core/components/bandwidth_accounting/db/transaction.py b/src/tribler/core/components/bandwidth_accounting/db/transaction.py index 273dadaeaf7..f73c79fa2ab 100644 --- a/src/tribler/core/components/bandwidth_accounting/db/transaction.py +++ b/src/tribler/core/components/bandwidth_accounting/db/transaction.py @@ -88,7 +88,7 @@ def is_valid(self) -> bool: return True @classmethod - def from_payload(cls, payload: BandwidthTransactionPayload) -> BandwidthTransaction: # noqa: F821 + def from_payload(cls, payload: BandwidthTransactionPayload): """ Create a block according to a given payload. This method can be used when receiving a block from the network. @@ -99,10 +99,10 @@ def from_payload(cls, payload: BandwidthTransactionPayload) -> BandwidthTransact payload.signature_a, payload.signature_b, payload.amount, payload.timestamp) @classmethod - def from_db(cls, db_obj: BandwidthTransaction) -> BandwidthTransactionData: # noqa: F821 + def from_db(cls, db_obj) -> BandwidthTransactionData: """ Return a BandwidthTransaction object from a database object. - :param db_obj: The database object to convert. + :param db_obj: The BandwidthTransaction object to convert. :return A BandwidthTransaction object, based on the database object. """ return BandwidthTransactionData(db_obj.sequence_number, db_obj.public_key_a, db_obj.public_key_b,