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

fix: assorted fixes #570

Merged
merged 17 commits into from
May 25, 2023
Merged

fix: assorted fixes #570

merged 17 commits into from
May 25, 2023

Conversation

mvadari
Copy link
Collaborator

@mvadari mvadari commented May 3, 2023

High Level Overview of Change

This PR:

  • Allows keypairs.sign to take a hex string in addition to bytes
  • Fixes some issues with the SignerListSet validation
  • Fixes the integration tests so that the transaction tests are actually run on all 4 clients, instead of just on the JSON RPC clients
  • Fixes an issue in the integration tests where there weren't actually ledgers closed after each transaction

Context of Change

These were all issues I came across while working on #571.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)

Test Plan

CI passes.

@mvadari mvadari marked this pull request as ready for review May 3, 2023 20:31
Comment on lines 102 to 105
elif self.signer_quorum <= 0:
errors[
"signer_quorum"
] = "`signer_quorum` must be greater than or equal to 0."
Copy link
Contributor

Choose a reason for hiding this comment

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

This error says that signer_quorum must be greater than or equal to 0, but if it is 0 this error still happens. Is that a typo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hm, not sure - it appears to have been the same previously.

Copy link
Collaborator

@pdp2121 pdp2121 May 16, 2023

Choose a reason for hiding this comment

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

Based on definition here:
https://xrpl.org/signerlistset.html#signerlistset-fields
It seems 0 is still valid to delete the signer list so the if condition should be modified?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looking at the code again, I think this condition is fine - line 97 returns errors if signer_entries is None, which should handle that situation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You're right. Then should the error message be "signer_quorum must be greater than 0 when signer_list is not being deleted." since deletion cases have been handled in lines 86-98?

Copy link
Contributor

Choose a reason for hiding this comment

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

@mvadari I think updating the error to what @pdp2121 suggested makes sense here -

Relevant quote from xrpl.org on SignerlistSet fields: (https://xrpl.org/signerlistset.html#signerlistset-fields)
"You cannot create a signer list such that the SignerQuorum could never be met. The SignerQuorum must be greater than 0 but less than or equal to the sum of the SignerWeight values in the list. Otherwise, the transaction fails with the error temMALFORMED."

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Error message was fixed in this commit: e3b0f0eb9f262ed3ae3cdcbc5f6c59fc47432f3c

@mvadari mvadari requested a review from JST5000 May 16, 2023 16:00
Copy link
Contributor

@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 after updating the error message (logic looks good as is, just think we can be a bit clearer)

@mvadari mvadari merged commit ea977f9 into master May 25, 2023
@mvadari mvadari deleted the assorted-fixes branch May 25, 2023 16:54
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