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

Revise Models #74

Merged
merged 18 commits into from
Feb 7, 2024
Merged

Revise Models #74

merged 18 commits into from
Feb 7, 2024

Conversation

LimpidCrypto
Copy link
Collaborator

@LimpidCrypto LimpidCrypto commented Jan 5, 2024

High Level Overview of Change

This PR makes use of the XRPL CommonFields in the models making it easier to work with them.
It also adds some smaller features like:

  • LedgerObject trait

Context of Change

As I was working on #71 the current models made it really hard to get model values (mostly from common fields). I had to write workarounds to get/set values of a model making it really inconvenient to work with them. This PR add CommonFields introducing a way easier way to work with the models.

Type of Change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Test Plan

The tests already exist.

TODO

  • fix tests (mostly json string keys in false order)
  • recheck field order and if all common_field gets #[serde(flatten)]
  • check if all fields are pub
  • Add custom field documentation
  • run cargo fix etc.
  • delete file .DS_Store

@LimpidCrypto LimpidCrypto changed the title IN PROGRESS: Revise Models Revise Models Jan 15, 2024
Copy link
Owner

@sephynox sephynox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass.

src/_serde/mod.rs Outdated Show resolved Hide resolved
src/_serde/mod.rs Outdated Show resolved Hide resolved
src/models/.DS_Store Outdated Show resolved Hide resolved
src/models/mod.rs Show resolved Hide resolved
src/models/transactions/account_set.rs Show resolved Hide resolved
src/models/transactions/check_cash.rs Show resolved Hide resolved
@sephynox sephynox added the enhancement New feature or request label Jan 22, 2024
@LimpidCrypto LimpidCrypto merged commit 4dfcfcd into dev Feb 7, 2024
1 check failed
LimpidCrypto added a commit that referenced this pull request Aug 13, 2024
* current state

* initial

* initial

* add to changelog

* impl LedgerObject trait

* remove .DS_Store

* add documentation

* cargo fix

* add Default trait to FlagCollection

* refactoring of models

* fix serde tests

* fix serde tests

* Delete src/models/.DS_Store

* remove dafault_none

* resolve comments
LimpidCrypto added a commit that referenced this pull request Aug 31, 2024
* move BinarySerializer and BinaryParser

* add STObject

* current state of txn signing

* current state of sign

* current state of sign

* use String instead of Cow<'a, str> for structs using serde_with_tag macro due to lifetime issues when deserializing

* utilize Cow for models

* utilize Cow for models

* cargo fmt

* add simple test

* add devcontainer

* fix async client tests

* fix github workflow

* fix tests with --all-features

* fix --no-default-features tests with embedded-ws

* try fix colliding embebedded-websocket feature with dep: syntax

* fix ambiguous name error

* Revise Models (#74)

* current state

* initial

* initial

* add to changelog

* impl LedgerObject trait

* remove .DS_Store

* add documentation

* cargo fix

* add Default trait to FlagCollection

* refactoring of models

* fix serde tests

* fix serde tests

* Delete src/models/.DS_Store

* remove dafault_none

* resolve comments

* revise dependencies

* remove old clients

* add new clients

* add codec for std embedded websocket

* move websocket exceptions

* add WebsocketBase

* add Client and AsyncClient traits

* add XRPLWebsocketIO as standardized trait

* adjust clients mod

* add XRPLResponse

* revise the Request trait to have methods to get a resut models common fields

* cargo fmt

* add get_random_id utility function

* add xrpl testnet uri

* revise the tests to work with the changes

* error handling

* improve testing

* implement websocket client request

* implement websocket client request for embedded websocket

* update rand trying to get rid of cargo check: OsRng: rand_core::RngCore is not satisfied error

* fix github workflow build and tests

* fix github workflow build and tests

* run linters

* add json rpc client

* add json rpc for std and tests

* cargo fmt

* add pre-commit test with json-rpc-std

* cargo fmt

* cargo fix

* improve client code

* refactor features

* fix tungstenite example

* fix clients

* fix client tests

* fix tests

* rename features in github workflow

* add transaction auto filling as in #76 (#80)

* current state of txn signing

* current state of sign

* current state of sign

* add simple test

* resolve errors caused by updating branch

* resolve errors caused by updating branch

* add autofill_and_sign

* make tx signing work

* improve sign test

* handle unwraps

* add autofill_and_sign

* add sign and submit

* fix errors caused by solving merge conflicts

* rename SerializedDict and SerializedList to STObject and STArray

* rename SerializedDict and SerializedList to STObject and STArray

* handle unwraps

* fix tests

* fix tests

* fix tests

* add multisigning

* add multisigning

* fix tests

* fix tests

---------

Co-authored-by: LimpidCrypto <[email protected]>
LimpidCrypto added a commit that referenced this pull request Aug 31, 2024
* move BinarySerializer and BinaryParser

* add STObject

* current state of txn signing

* current state of sign

* current state of sign

* use String instead of Cow<'a, str> for structs using serde_with_tag macro due to lifetime issues when deserializing

* utilize Cow for models

* utilize Cow for models

* cargo fmt

* add simple test

* add devcontainer

* fix async client tests

* fix github workflow

* fix tests with --all-features

* fix --no-default-features tests with embedded-ws

* try fix colliding embebedded-websocket feature with dep: syntax

* fix ambiguous name error

* Revise Models (#74)

* current state

* initial

* initial

* add to changelog

* impl LedgerObject trait

* remove .DS_Store

* add documentation

* cargo fix

* add Default trait to FlagCollection

* refactoring of models

* fix serde tests

* fix serde tests

* Delete src/models/.DS_Store

* remove dafault_none

* resolve comments

* revise dependencies

* remove old clients

* add new clients

* add codec for std embedded websocket

* move websocket exceptions

* add WebsocketBase

* add Client and AsyncClient traits

* add XRPLWebsocketIO as standardized trait

* adjust clients mod

* add XRPLResponse

* revise the Request trait to have methods to get a resut models common fields

* cargo fmt

* add get_random_id utility function

* add xrpl testnet uri

* revise the tests to work with the changes

* error handling

* improve testing

* implement websocket client request

* implement websocket client request for embedded websocket

* update rand trying to get rid of cargo check: OsRng: rand_core::RngCore is not satisfied error

* fix github workflow build and tests

* fix github workflow build and tests

* run linters

* add json rpc client

* add json rpc for std and tests

* cargo fmt

* add pre-commit test with json-rpc-std

* cargo fmt

* cargo fix

* improve client code

* refactor features

* fix tungstenite example

* fix clients

* fix client tests

* fix tests

* rename features in github workflow

* add transaction auto filling as in #76 (#80)

* current state of txn signing

* current state of sign

* current state of sign

* add simple test

* resolve errors caused by updating branch

* resolve errors caused by updating branch

* add autofill_and_sign

* make tx signing work

* improve sign test

* handle unwraps

* add autofill_and_sign

* add sign and submit

* fix errors caused by solving merge conflicts

* rename SerializedDict and SerializedList to STObject and STArray

* rename SerializedDict and SerializedList to STObject and STArray

* handle unwraps

* fix tests

* fix tests

* fix tests

* add multisigning

* add multisigning

* fix tests

* fix tests

---------

Co-authored-by: LimpidCrypto <[email protected]>
@LimpidCrypto LimpidCrypto deleted the refactor-models branch September 8, 2024 18:20
LimpidCrypto added a commit that referenced this pull request Oct 6, 2024
* move BinarySerializer and BinaryParser

* add STObject

* current state of txn signing

* current state of sign

* current state of sign

* use String instead of Cow<'a, str> for structs using serde_with_tag macro due to lifetime issues when deserializing

* utilize Cow for models

* utilize Cow for models

* cargo fmt

* add simple test

* add devcontainer

* fix async client tests

* fix github workflow

* fix tests with --all-features

* fix --no-default-features tests with embedded-ws

* try fix colliding embebedded-websocket feature with dep: syntax

* fix ambiguous name error

* Revise Models (#74)

* current state

* initial

* initial

* add to changelog

* impl LedgerObject trait

* remove .DS_Store

* add documentation

* cargo fix

* add Default trait to FlagCollection

* refactoring of models

* fix serde tests

* fix serde tests

* Delete src/models/.DS_Store

* remove dafault_none

* resolve comments

* revise dependencies

* remove old clients

* add new clients

* add codec for std embedded websocket

* move websocket exceptions

* add WebsocketBase

* add Client and AsyncClient traits

* add XRPLWebsocketIO as standardized trait

* adjust clients mod

* add XRPLResponse

* revise the Request trait to have methods to get a resut models common fields

* cargo fmt

* add get_random_id utility function

* add xrpl testnet uri

* revise the tests to work with the changes

* error handling

* improve testing

* implement websocket client request

* implement websocket client request for embedded websocket

* update rand trying to get rid of cargo check: OsRng: rand_core::RngCore is not satisfied error

* fix github workflow build and tests

* fix github workflow build and tests

* run linters

* add json rpc client

* add json rpc for std and tests

* cargo fmt

* add pre-commit test with json-rpc-std

* cargo fmt

* cargo fix

* improve client code

* refactor features

* fix tungstenite example

* fix clients

* fix client tests

* fix tests

* rename features in github workflow

* add transaction auto filling as in #76 (#80)

* current state of txn signing

* current state of sign

* current state of sign

* add simple test

* resolve errors caused by updating branch

* resolve errors caused by updating branch

* add autofill_and_sign

* make tx signing work

* improve sign test

* handle unwraps

* add autofill_and_sign

* add sign and submit

* fix errors caused by solving merge conflicts

* rename SerializedDict and SerializedList to STObject and STArray

* rename SerializedDict and SerializedList to STObject and STArray

* handle unwraps

* fix tests

* fix tests

* fix tests

* add multisigning

* add multisigning

* fix tests

* fix tests

---------

Co-authored-by: LimpidCrypto <[email protected]>
LimpidCrypto added a commit that referenced this pull request Oct 6, 2024
* current state

* initial

* initial

* add to changelog

* impl LedgerObject trait

* remove .DS_Store

* add documentation

* cargo fix

* add Default trait to FlagCollection

* refactoring of models

* fix serde tests

* fix serde tests

* Delete src/models/.DS_Store

* remove dafault_none

* resolve comments
LimpidCrypto added a commit that referenced this pull request Oct 6, 2024
* move BinarySerializer and BinaryParser

* add STObject

* current state of txn signing

* current state of sign

* current state of sign

* use String instead of Cow<'a, str> for structs using serde_with_tag macro due to lifetime issues when deserializing

* utilize Cow for models

* utilize Cow for models

* cargo fmt

* add simple test

* add devcontainer

* fix async client tests

* fix github workflow

* fix tests with --all-features

* fix --no-default-features tests with embedded-ws

* try fix colliding embebedded-websocket feature with dep: syntax

* fix ambiguous name error

* Revise Models (#74)

* current state

* initial

* initial

* add to changelog

* impl LedgerObject trait

* remove .DS_Store

* add documentation

* cargo fix

* add Default trait to FlagCollection

* refactoring of models

* fix serde tests

* fix serde tests

* Delete src/models/.DS_Store

* remove dafault_none

* resolve comments

* revise dependencies

* remove old clients

* add new clients

* add codec for std embedded websocket

* move websocket exceptions

* add WebsocketBase

* add Client and AsyncClient traits

* add XRPLWebsocketIO as standardized trait

* adjust clients mod

* add XRPLResponse

* revise the Request trait to have methods to get a resut models common fields

* cargo fmt

* add get_random_id utility function

* add xrpl testnet uri

* revise the tests to work with the changes

* error handling

* improve testing

* implement websocket client request

* implement websocket client request for embedded websocket

* update rand trying to get rid of cargo check: OsRng: rand_core::RngCore is not satisfied error

* fix github workflow build and tests

* fix github workflow build and tests

* run linters

* add json rpc client

* add json rpc for std and tests

* cargo fmt

* add pre-commit test with json-rpc-std

* cargo fmt

* cargo fix

* improve client code

* refactor features

* fix tungstenite example

* fix clients

* fix client tests

* fix tests

* rename features in github workflow

* add transaction auto filling as in #76 (#80)

* current state of txn signing

* current state of sign

* current state of sign

* add simple test

* resolve errors caused by updating branch

* resolve errors caused by updating branch

* add autofill_and_sign

* make tx signing work

* improve sign test

* handle unwraps

* add autofill_and_sign

* add sign and submit

* fix errors caused by solving merge conflicts

* rename SerializedDict and SerializedList to STObject and STArray

* rename SerializedDict and SerializedList to STObject and STArray

* handle unwraps

* fix tests

* fix tests

* fix tests

* add multisigning

* add multisigning

* fix tests

* fix tests

---------

Co-authored-by: LimpidCrypto <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants