Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mvadari committed May 17, 2024
1 parent 8ae0e1c commit 310363e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/unit/models/transactions/test_oracle_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def test_early_last_update_time_field(self):
self.assertEqual(
err.exception.args[0],
"{'last_update_time': 'LastUpdateTime"
+ " must be greater than or equal to Ripple-Epoch 946684800.0 seconds'}",
+ " must be greater than or equal to ripple epoch - 946684800 seconds'}",
)

# Validity depends on the time of the Last Closed Ledger. This test verifies the
Expand Down
10 changes: 5 additions & 5 deletions xrpl/models/transactions/oracle_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
MAX_ORACLE_SYMBOL_CLASS = 16

# epoch offset must equal 946684800 seconds. It represents the diff between the
# genesis of Unix time and Ripple-Epoch time
EPOCH_OFFSET = (
datetime.datetime(2000, 1, 1) - datetime.datetime(1970, 1, 1)
).total_seconds()
# genesis of Unix time and ripple epoch time
EPOCH_OFFSET = int(
(datetime.datetime(2000, 1, 1) - datetime.datetime(1970, 1, 1)).total_seconds()
)


@require_kwargs_on_init
Expand Down Expand Up @@ -136,7 +136,7 @@ def _get_errors(self: OracleSet) -> Dict[str, str]:
if self.last_update_time < EPOCH_OFFSET:
errors["last_update_time"] = (
"LastUpdateTime must be greater than or equal"
f" to Ripple-Epoch {EPOCH_OFFSET} seconds"
f" to ripple epoch - {EPOCH_OFFSET} seconds"
)

return errors
Expand Down

0 comments on commit 310363e

Please sign in to comment.