Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for PriceOracles #701

Merged
merged 32 commits into from
May 9, 2024
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
30b6522
include SetOracle and DeleteOracle transactions
ckeshava Apr 18, 2024
5764dc4
update the definitions.json with Oracle LedgerEntry types, new SField…
ckeshava Apr 18, 2024
c8a2bb3
[WIP] rename transactions to OracleSet, OracleDelete to maintain comp…
ckeshava Apr 19, 2024
6919e22
update the CI/CD file to latest rippled docker image.
ckeshava Apr 22, 2024
1545fee
snippets test for set, delete oracle
ckeshava Apr 29, 2024
e811c41
[WIP] updates to the SetOracle integration test
ckeshava Apr 30, 2024
d2237c2
GetAggregatePrice request implementation, unit and snippet tests.
ckeshava Apr 30, 2024
6a16e6e
LedgerEntry unit tests -- validate the behavior of PriceOracle objects
ckeshava Apr 30, 2024
d698d28
integration tests for OracleSet, OracleDelete transactions
ckeshava Apr 30, 2024
dad085f
Fix: use int data type, not str for oracle_document_id
ckeshava Apr 30, 2024
2af51b1
update changelog
ckeshava Apr 30, 2024
170dafd
update rippled version docker image
ckeshava May 1, 2024
bcec52c
fix: Use TypedDict instead of NestedModel to represent OracleInfo
ckeshava May 1, 2024
df462ba
address Mayukha's comments: rename files and variables to match defs.…
ckeshava May 1, 2024
7256c4c
include LedgerEntry verification in oracles snippets test
ckeshava May 4, 2024
9c7ce5e
address review comments by mayukha and omar
ckeshava May 6, 2024
9d1b476
remove snippets tests for PriceOracle feature
ckeshava May 6, 2024
23b0ef0
Update CHANGELOG.md
ckeshava May 6, 2024
d08ba7f
add unique values to each client run
mvadari May 6, 2024
c044ce7
Merge branch 'async-value' of https://github.com/XRPLF/xrpl-py into p…
ckeshava May 6, 2024
1a02a58
remove the usage of random.randint in OracleSet integraton tests
ckeshava May 6, 2024
7dd3f17
Merge branch 'poracle' of https://github.com/ckeshava/xrpl-py into po…
ckeshava May 6, 2024
958ee1a
Update tests/integration/transactions/test_delete_oracle.py
ckeshava May 7, 2024
915ff35
address review comments
ckeshava May 7, 2024
3957867
use "is not None" to check for non-existence of an optional field
ckeshava May 7, 2024
8251981
fixed the error message in OracleSet validation
ckeshava May 8, 2024
56ff610
Update tests/unit/models/requests/test_ledger_entry.py
ckeshava May 8, 2024
7f39f50
Update tests/unit/models/requests/test_ledger_entry.py
ckeshava May 8, 2024
db3d27f
rename test files to match transaction names
ckeshava May 8, 2024
72afddf
validate the exception message in negative test cases
ckeshava May 9, 2024
49370f1
include validity checks on LastUpdateTime
ckeshava May 9, 2024
e98980b
Merge branch 'main' into poracle
ckeshava May 9, 2024
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
15 changes: 9 additions & 6 deletions xrpl/models/transactions/oracle_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,26 +96,29 @@ def _get_errors(self: OracleSet) -> Dict[str, str]:
"price_data_series"
] = f"Field must have a length less than {MAX_ORACLE_DATA_SERIES}."

if self.asset_class and len(self.asset_class) == 0:
if self.asset_class is not None and len(self.asset_class) == 0:
errors["asset_class"] = "Field must have a length greater than 0."

if self.asset_class and len(self.asset_class) > MAX_ORACLE_SYMBOL_CLASS:
if (
self.asset_class is not None
and len(self.asset_class) > MAX_ORACLE_SYMBOL_CLASS
):
ckeshava marked this conversation as resolved.
Show resolved Hide resolved
errors[
"asset_class"
] = f"Field must have a length less than {MAX_ORACLE_SYMBOL_CLASS}."

if self.provider and len(self.provider) == 0:
if self.provider is not None and len(self.provider) == 0:
errors["provider"] = "Field must have a length greater than 0."

if self.provider and len(self.provider) > MAX_ORACLE_PROVIDER:
if self.provider is not None and len(self.provider) > MAX_ORACLE_PROVIDER:
errors[
"provider"
] = f"Field must have a length less than {MAX_ORACLE_PROVIDER}."
ckeshava marked this conversation as resolved.
Show resolved Hide resolved

if self.uri and len(self.uri) == 0:
if self.uri is not None and len(self.uri) == 0:
errors["uri"] = "Field must have a length greater than 0."

if self.uri and len(self.uri) > MAX_ORACLE_URI:
if self.uri is not None and len(self.uri) > MAX_ORACLE_URI:
errors["uri"] = f"Field must have a length less than {MAX_ORACLE_URI}."
ckeshava marked this conversation as resolved.
Show resolved Hide resolved

return errors
Expand Down
Loading