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

add block based rarities #12

Merged
merged 2 commits into from
Aug 15, 2023
Merged

add block based rarities #12

merged 2 commits into from
Aug 15, 2023

Conversation

haozhiliu
Copy link

Support block based rarities for both individual sat and sat range, including:

  • Vintage
  • Nakamoto
  • First Transaction
  • Pizza
  • Block 9
  • Block 78
  • Palindrome (note: iterating sats within a large range is expensive, current implementation is combining accurate counting (if sat range contains less than 1 million sats), and estimation for large range. Given the fact that palindrome becomes very sparse along with sat number increases, even for a huge range, the count of palindrome sat is 0 or 1. Therefore the estimation is not much useful.

Copy link
Member

@nothing0012 nothing0012 left a comment

Choose a reason for hiding this comment

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

lgtm, thanks for all the tests. Is it easy to add more types of block rarity?

s == reversed
}

fn in_pizza_range(n: &u64, ranges: &Vec<(u64, u64)>) -> bool {

Choose a reason for hiding this comment

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

nit: in_range since this can be used for any range

@haozhiliu
Copy link
Author

lgtm, thanks for all the tests. Is it easy to add more types of block rarity?

Hmm... It would be a case by case implementation depending on the definition of the new "block rarities".

@haozhiliu haozhiliu merged this pull request into 6.x Aug 15, 2023
nothing0012 pushed a commit that referenced this pull request Aug 16, 2023
* add block based rarities

* cargo fmt
nothing0012 pushed a commit that referenced this pull request Sep 11, 2023
* add block based rarities

* cargo fmt
nothing0012 pushed a commit that referenced this pull request Sep 26, 2023
* add block based rarities

* cargo fmt
nothing0012 pushed a commit that referenced this pull request Oct 23, 2023
* add block based rarities

* cargo fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants