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

Rename NFT to NFToken for lsfDisallowIncomingNFTokenOffer flags #4442

Merged

Conversation

kennyzlei
Copy link
Collaborator

High Level Overview of Change

  • Rename lsfDisallowIncomingNFTOffer to lsfDisallowIncomingNFTokenOffer
  • Rename asfDisallowIncomingNFTOffer to asfDisallowIncomingNFTokenOffer
  • Update spacing on TXFlags.h after rename

Context of Change

NFToken is the more standard naming convention in the codebase compared to NFT

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

Copy link
Collaborator

@thejohnfreeman thejohnfreeman left a comment

Choose a reason for hiding this comment

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

Not generally an advocate of rename-only changesets, but I'm fine approving work that has already been done.

@@ -147,15 +147,15 @@ constexpr std::uint32_t const tfNFTokenMintMask =
~(tfUniversal | tfBurnable | tfOnlyXRP | tfTransferable);

// NFTokenCreateOffer flags:
constexpr std::uint32_t const tfSellNFToken = 0x00000001;
constexpr std::uint32_t const tfSellNFToken = 0x00000001;
constexpr std::uint32_t const tfNFTokenCreateOfferMask =
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems the equals signs in this file are aligned with the one on this line because it has the longest prefix. Two things:

  1. After changing "NFT" to "NFToken", the new longest prefix is on line 85. The equals sign on that line should be one space apart from that prefix. In this commit, it is four spaces apart.
  2. The equals sign on this line, 151, should be aligned with the others in the file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

happy to go with that spacing guidance, i had assumed it was a nearest every 4 spaces approach since the last one happened to be % 4 in a clean way

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@thejohnfreeman for point 2. I think I have seen a different approach in other lines that fold so I thought it was more consistent to not align when they fold, see lines https://github.com/XRPLF/rippled/blob/develop/src/ripple/protocol/TxFlags.h#L67 for example

Copy link
Collaborator

Choose a reason for hiding this comment

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

Out of curiosity, has it ever been considered to have formatting rules controlled by a linting tool automatically?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The file as it looked before clang-format hit it in the Great Reformat appears to have every equals sign aligned, even on lines that wrap. They are all in column 44, and they are all 4 spaces after the longest prefix. Both of these rules match the alignment you have, @kennyzlei, except for the wrapped lines that you are not touching. Let's keep that alignment and just add a comment at the start, before or after the // clang-format off line, explaining this rule. Optionally, you can restore the wrapped lines to conform to the rule.

@justinr1234 We do have that. It's controlled by clang-format. Style configuration in .clang-format. Enforcement in .github/workflows/clang-format.yml. We disable it for sections of special formatting like this. When deciding to incorporate it, the majority wanted to keep the special formatting.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@thejohnfreeman added a comment to describe the special formatting

@intelliot
Copy link
Collaborator

Not generally an advocate of rename-only changesets, but I'm fine approving work that has already been done.

I don't understand this sentence. Naming is important, and it seems clear that this rename follows the principle of least surprise. If we agree that the rename is worth doing, then it is not a problem to do it in a rename-only changeset.

@intelliot intelliot requested a review from thejohnfreeman March 2, 2023 17:23
@intelliot intelliot assigned kennyzlei and unassigned thejohnfreeman Mar 2, 2023
@intelliot intelliot removed the request for review from thejohnfreeman March 2, 2023 17:24
@kennyzlei kennyzlei force-pushed the rename-lsfDisallowIncomingNFTOffer branch 2 times, most recently from 12bf9b1 to e90a481 Compare March 2, 2023 19:23
@kennyzlei kennyzlei removed their assignment Mar 2, 2023
@kennyzlei kennyzlei requested a review from thejohnfreeman March 2, 2023 19:25
@kennyzlei kennyzlei added the Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. label Mar 2, 2023
@thejohnfreeman
Copy link
Collaborator

@kennyzlei Please, in the future, no more force-pushes. Not sure what is going on with review assignments either. Generally, assignments are left up even after a review is submitted.

ckniffen added a commit to XRPLF/xrpl.js that referenced this pull request Mar 2, 2023
`lsfDisallowIncomingNFTOffer` to `lsfDisallowIncomingNFTokenOffer`
`asfDisallowIncomingNFTOffer` to `asfDisallowIncomingNFTokenOffer`

Related to XRPLF/rippled#4442
ckniffen added a commit to XRPLF/xrpl-py that referenced this pull request Mar 2, 2023
`asfDisallowIncomingNFTOffer` to `asfDisallowIncomingNFTokenOffer`

Related to XRPLF/rippled#4442
@kennyzlei kennyzlei force-pushed the rename-lsfDisallowIncomingNFTOffer branch from e90a481 to 0585db3 Compare March 2, 2023 20:51
@kennyzlei
Copy link
Collaborator Author

😞 sorry I had to force push again here as my initial commits did not come with pgp signature, i thought i had auto-signed set up

@intelliot
Copy link
Collaborator

No worries; I think the signature changes when the commits get squashed anyway. This looks fine to me: I'll go ahead and merge; if we find any problems, we can fix with a follow-up PR.

@intelliot intelliot merged commit ecd49e1 into XRPLF:develop Mar 2, 2023
@intelliot intelliot mentioned this pull request Mar 2, 2023
1 task
ximinez added a commit to ximinez/rippled that referenced this pull request Mar 3, 2023
* upstream/develop:
  Set version to 1.10.0-rc4
  Rename 'NFT' to 'NFToken' in DisallowIncoming flags (XRPLF#4442)
  Update Docker.md (XRPLF#4432)
  Update package building scripts and images to use Conan (XRPLF#4435)
  Disable duplicate detector: (XRPLF#4438)
ximinez added a commit to ximinez/rippled that referenced this pull request Mar 3, 2023
* upstream/develop:
  Set version to 1.10.0-rc4
  Rename 'NFT' to 'NFToken' in DisallowIncoming flags (XRPLF#4442)
  Update Docker.md (XRPLF#4432)
  Update package building scripts and images to use Conan (XRPLF#4435)
  Disable duplicate detector: (XRPLF#4438)
ximinez added a commit to ximinez/rippled that referenced this pull request Mar 3, 2023
* upstream/develop:
  Set version to 1.10.0-rc4
  Rename 'NFT' to 'NFToken' in DisallowIncoming flags (XRPLF#4442)
  Update Docker.md (XRPLF#4432)
  Update package building scripts and images to use Conan (XRPLF#4435)
  Disable duplicate detector: (XRPLF#4438)
ximinez added a commit to ximinez/rippled that referenced this pull request Mar 3, 2023
* upstream/develop:
  Set version to 1.10.0-rc4
  Rename 'NFT' to 'NFToken' in DisallowIncoming flags (XRPLF#4442)
  Update Docker.md (XRPLF#4432)
  Update package building scripts and images to use Conan (XRPLF#4435)
  Disable duplicate detector: (XRPLF#4438)
ximinez added a commit to ximinez/rippled that referenced this pull request Mar 3, 2023
* upstream/develop:
  Set version to 1.10.0-rc4
  Rename 'NFT' to 'NFToken' in DisallowIncoming flags (XRPLF#4442)
  Update Docker.md (XRPLF#4432)
ximinez added a commit to ximinez/rippled that referenced this pull request Mar 3, 2023
…ctionality

* upstream/develop:
  Set version to 1.10.0-rc4
  Rename 'NFT' to 'NFToken' in DisallowIncoming flags (XRPLF#4442)
  Update Docker.md (XRPLF#4432)
  Update package building scripts and images to use Conan (XRPLF#4435)
  Disable duplicate detector: (XRPLF#4438)
ximinez added a commit to ximinez/rippled that referenced this pull request Mar 3, 2023
…tpage

* upstream/develop:
  Set version to 1.10.0-rc4
  Rename 'NFT' to 'NFToken' in DisallowIncoming flags (XRPLF#4442)
  Update Docker.md (XRPLF#4432)
  Update package building scripts and images to use Conan (XRPLF#4435)
  Disable duplicate detector: (XRPLF#4438)
@kennyzlei kennyzlei deleted the rename-lsfDisallowIncomingNFTOffer branch March 3, 2023 22:33
@kennyzlei kennyzlei removed the Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. label Mar 3, 2023
dangell7 pushed a commit to Transia-RnD/rippled that referenced this pull request Mar 5, 2023
* Follow-up to XRPLF#4336
* NFToken is the naming convention in the codebase (rather than NFT)
* Rename `lsfDisallowIncomingNFTOffer` to `lsfDisallowIncomingNFTokenOffer`
* Rename `asfDisallowIncomingNFTOffer` to `asfDisallowIncomingNFTokenOffer`
ckniffen added a commit to ripple/explorer that referenced this pull request Mar 7, 2023
`lsfDisallowIncomingNFTOffer` to `lsfDisallowIncomingNFTokenOffer`
`asfDisallowIncomingNFTOffer` to `asfDisallowIncomingNFTokenOffer`

Related to XRPLF/rippled#4442
ckniffen added a commit to XRPLF/xrpl.js that referenced this pull request Mar 8, 2023
`lsfDisallowIncomingNFTOffer` to `lsfDisallowIncomingNFTokenOffer`
`asfDisallowIncomingNFTOffer` to `asfDisallowIncomingNFTokenOffer`

Related to XRPLF/rippled#4442
ckniffen added a commit to XRPLF/xrpl-py that referenced this pull request Mar 9, 2023
`asfDisallowIncomingNFTOffer` to `asfDisallowIncomingNFTokenOffer`

Related to XRPLF/rippled#4442
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants