Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

[RPC] Send timestamps as numbers #4899

Merged
merged 1 commit into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions golem/rpc/api/ethereum_.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ def payment(wallet_operation_id: int) -> typing.Optional[dict]:
'task_id': o.task,
'subtask_id': o.subtask,
'charged_from_deposit': o.charged_from_deposit,
'accepted_ts': str(o.accepted_ts) if o.accepted_ts else None,
'settled_ts': str(o.settled_ts) if o.settled_ts else None,
'accepted_ts': o.accepted_ts if o.accepted_ts else None,
'settled_ts': o.settled_ts if o.settled_ts else None,
'missing_amount': str(o.missing_amount),
'created': common.datetime_to_timestamp_utc(o.created_date),
'modified': common.datetime_to_timestamp_utc(o.modified_date),
Expand Down
21 changes: 21 additions & 0 deletions tests/golem/rpc/api/test_ethereum.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,24 @@ def test_wallet_operation(self):
count,
1,
)

def test_operation_type(self):
operation_types = model.WalletOperation.TYPE
_ = model_factory.WalletOperation(
operation_type=operation_types.deposit_transfer,
)

count0, _result0 = self.ets_provider.get_operations(
operation_type=operation_types.task_payment,
)
self.assertEqual(
count0,
0,
)
count, _result = self.ets_provider.get_operations(
operation_type=operation_types.deposit_transfer,
)
self.assertEqual(
count,
1,
)