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

Parse flags in account_info method #4459

Merged

Conversation

drlongle
Copy link
Contributor

@drlongle drlongle commented Mar 13, 2023

High Level Overview of Change

This PR resolves #2457. It adds an object account_flags at the top level of the account_info response. This new object contains relevant flags of an account.

Context of Change

./ripped account_info rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn

{
        "result" :
        {
                "account_data" :
                {
                        ...
                        ...
                },
                "account_flags" :
                {
                        "defaultRipple" : true,
                        "depositAuth" : true,
                        "disableMasterKey" : false,
                        "disallowIncomingCheck" : true,
                        "disallowIncomingNFTokenOffer" : true,
                        "disallowIncomingPayChan" : true,
                        "disallowIncomingTrustline" : true,
                        "disallowIncomingXRP" : true,
                        "globalFreeze" : true,
                        "noFreeze" : true,
                        "passwordSpent" : false,
                        "requireAuthorization" : true,
                        "requireDestinationTag" : true
                },
                "ledger_current_index" : 17,
                "status" : "success",
                "validated" : false
        }
}

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

@drlongle drlongle changed the title Parse flags in account_info method (#2457) Parse flags in account_info method Mar 13, 2023
@intelliot intelliot added this to the 1.11.0 milestone Mar 13, 2023
Copy link
Collaborator

@justinr1234 justinr1234 left a comment

Choose a reason for hiding this comment

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

Only comment would be to make a docs ticket on xrpl-dev-portal repo, otherwise looks great! Nice work!

@intelliot
Copy link
Collaborator

@drlongle will check whether there are any other flags to add

@drlongle
Copy link
Contributor Author

@drlongle will check whether there are any other flags to add

All account flags defined in LedgerFormats.h have been added.

@intelliot intelliot requested review from HowardHinnant and removed request for ximinez March 16, 2023 00:10
Copy link
Collaborator

@seelabs seelabs left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me. Nice job on this.

@intelliot
Copy link
Collaborator

@drlongle at your convenience, please comment with a suggested commit message for this PR

@drlongle
Copy link
Contributor Author

drlongle commented Mar 30, 2023

Below is my suggestion for a commit message.

Add an object containing account flags to the account_info's response: (#2457)

Currently, the object account_data of the account_info's response contains a single field Flags that stores relevant flags of an account. Users need to performing bitwise operations on this field to retrieve relevant account flags. This PR adds a new object containing relevant flags of an account. This makes it easier to write simple code to check a flag's value.

@intelliot intelliot merged commit 5ebcaf0 into XRPLF:develop Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Request: Parse flags in account_info method
7 participants