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

feat: Update xrpl-dev-portal to use xrpl-py 2.0 #1933

Merged
merged 19 commits into from
Jul 5, 2023
Merged

feat: Update xrpl-dev-portal to use xrpl-py 2.0 #1933

merged 19 commits into from
Jul 5, 2023

Conversation

JST5000
Copy link
Contributor

@JST5000 JST5000 commented Jun 5, 2023

In preparation for breaking changes to the xrpl-py library, this PR updates the code samples & tutorials in order to follow new best practices.

This should NOT be merged until xrpl-py 2.0 is released. (This will be set as a draft PR until that point)

This PR may be most digestible if read on a commit-by-commit basis. Most commits only migrate one of these breaking changes.

Breaking Changes

Updates to function names for signing/submitting:

  • send_reliable_submission is now submit_and_wait
    • submit_and_wait can also handle the autofill and sign steps automatically (similar to how submit_and_wait works with xrpl.js)
  • submit_transaction is now submit
  • safe_sign_and_submit_transaction is now sign_and_submit
    • The wallet parameter here has been moved after client to be consistent with submit_and_wait
  • safe_sign_transaction is now sign
  • safe_sign_and_autofill_transaction is now autofill_and_sign
    • The wallet parameter here has been moved after client to be consistent with submit_and_wait

Wallet Class

  • Removed sequence field
  • Changed constructor to take in public and private key as required parameters
  • Changed class methods to use the Ed25519 cryptographic algorithm by default
  • Changed classic_address to address and made it read-only

AccountSetFlags

  • AccountSetAsfFlags now contains Account Set Flags with the ASF... prefix.
  • AccountSetFlags now is exclusively transaction flags.

Core Keypairs

  • Changed the generate_seed method to take a hex string instead of a UTF-8 string
  • Ed25519 key string is formatted with padded zeros if length is less than 32 bytes
  • sign was made synchronous instead of asynchronous (moving a fee check out).

@github-actions
Copy link

github-actions bot commented Jun 5, 2023

Link check report. 467248 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

@github-actions
Copy link

github-actions bot commented Jun 6, 2023

Link check report. 467248 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

@github-actions
Copy link

github-actions bot commented Jun 6, 2023

Link check report. 467248 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

@mDuo13
Copy link
Collaborator

mDuo13 commented Jun 6, 2023

How does this PR relate to #1639? Is this a companion or replacement for that one?

@github-actions
Copy link

github-actions bot commented Jun 6, 2023

Link check report. 467249 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

@JST5000 JST5000 changed the title Update xrpl-dev-portal to use xrpl-py 2.0 feat: Update xrpl-dev-portal to use xrpl-py 2.0 Jun 8, 2023
@JST5000
Copy link
Contributor Author

JST5000 commented Jun 8, 2023

How does this PR relate to #1639? Is this a companion or replacement for that one?

@mDuo13 This would be a replacement for that PR. I didn't realize we'd created a renamed autofill_and_submit - I'll add that into this PR, and then we should close the old one from Connor. (Mostly I want to make sure that we're making all the changes at once - so I'll add in his changes to this one)

@github-actions
Copy link

github-actions bot commented Jun 8, 2023

Link check report. 467249 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

@github-actions
Copy link

github-actions bot commented Jun 8, 2023

Link check report. 467249 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

2 similar comments
@github-actions
Copy link

github-actions bot commented Jun 8, 2023

Link check report. 467249 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

@github-actions
Copy link

github-actions bot commented Jun 8, 2023

Link check report. 467249 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

@github-actions
Copy link

github-actions bot commented Jun 8, 2023

Link check report. 467249 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

@github-actions
Copy link

github-actions bot commented Jun 8, 2023

Link check report. 467249 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

2 similar comments
@github-actions
Copy link

github-actions bot commented Jun 8, 2023

Link check report. 467249 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

@github-actions
Copy link

github-actions bot commented Jun 8, 2023

Link check report. 467249 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

@JST5000
Copy link
Contributor Author

JST5000 commented Jun 8, 2023

I went through and ran every modified snippet to verify they would work with xrpl-py-2.0. All did what was expected (noticed a couple small fixes doing that which were in the last couple commits)

@github-actions
Copy link

Link check report. 467253 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

@github-actions
Copy link

Link check report. 467253 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

@github-actions
Copy link

Link check report. 467253 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

@JST5000 JST5000 marked this pull request as ready for review July 3, 2023 22:14
@github-actions
Copy link

github-actions bot commented Jul 3, 2023

Link check report. 467253 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

@github-actions
Copy link

github-actions bot commented Jul 5, 2023

Link check report. 495049 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

Copy link
Collaborator

@mDuo13 mDuo13 left a comment

Choose a reason for hiding this comment

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

Overall looks very thorough and nicely showcases the improvements in xrpl-py 2.0. I removed one import that was rendered redundant by the changes; otherwise, looks great!

@mDuo13 mDuo13 merged commit 5116247 into master Jul 5, 2023
2 checks passed
@mDuo13 mDuo13 deleted the xrpl-py-2.0 branch July 5, 2023 22:05
@github-actions
Copy link

github-actions bot commented Jul 5, 2023

Link check report. 495071 links checked.
Success! No broken links found.

Preview: https://XRPLF.github.io/xrpl-dev-portal/pr-preview/xrpl-py-2.0/

Style Report

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.

3 participants