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

refactor: create new abstract model for nested dict objects #421

Merged
merged 5 commits into from Sep 1, 2022

Conversation

mvadari
Copy link
Collaborator

@mvadari mvadari commented Aug 2, 2022

High Level Overview of Change

Some objects are of the form:

{
  "Memo": {
    ...
  }
}

xrpl-py abstracts this away and creates the outer dictionary for you. There are a few objects that do this (Memo, Signer, and SignerList). There is a lot of copy-pasted code between these 3 objects. This PR seeks to simplify that by creating a parent object that inherits from BaseModel that handles this extra code.

Context of Change

I have a draft PR that has a few more of these objects, and it avoids having copy-pasted code.

Type of Change

  • Refactor (non-breaking change that only restructures code)

Test Plan

CI passes. No change in functionality.

@mvadari mvadari marked this pull request as ready for review August 2, 2022 16:23
@mvadari mvadari mentioned this pull request Aug 3, 2022
2 tasks
Copy link
Collaborator

@JST5000 JST5000 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@khancode khancode left a comment

Choose a reason for hiding this comment

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

Nice refactor!

@mvadari mvadari merged commit 3511d1c into master Sep 1, 2022
@mvadari mvadari deleted the st-object branch September 1, 2022 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants