Skip to content

Commit 39082e3

Browse files
authored
Fix degree notation examples (#4289)
1 parent 0662dbf commit 39082e3

File tree

2 files changed

+32
-17
lines changed

2 files changed

+32
-17
lines changed

β€Žcrates/ordinals/src/sat.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,4 +833,19 @@ mod tests {
833833
assert!(!Charm::Palindrome.is_set(Sat(10).charms()));
834834
assert!(Charm::Palindrome.is_set(Sat(11).charms()));
835835
}
836+
837+
#[test]
838+
fn degree_examples() {
839+
#[track_caller]
840+
fn case(s: &str, rarity: Rarity) {
841+
assert_eq!(s.parse::<Sat>().unwrap().rarity(), rarity);
842+
}
843+
844+
case("0Β°0β€²0β€³1‴", Rarity::Common);
845+
case("0Β°1β€²1β€³0‴", Rarity::Uncommon);
846+
case("0Β°2016β€²0β€³0‴", Rarity::Rare);
847+
case("0Β°0β€²336β€³0‴", Rarity::Epic);
848+
case("1Β°0β€²0β€³0‴", Rarity::Legendary);
849+
case("0Β°0β€²0β€³0‴", Rarity::Mythic);
850+
}
836851
}

β€Ždocs/src/overview.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -100,42 +100,42 @@ for *A*, *B*, *C*, and *D*, respectively.
100100
Now for some examples. This satoshi is common:
101101

102102
```
103-
1Β°1β€²1β€³1‴
103+
0Β°0β€²0β€³1‴
104104
β”‚ β”‚ β”‚ ╰─ Not first sat in block
105-
β”‚ β”‚ ╰─── Not first block in difficulty adjustment period
106-
β”‚ ╰───── Not first block in halving epoch
107-
╰─────── Second cycle
105+
β”‚ β”‚ ╰─── Any block in difficulty adjustment period
106+
β”‚ ╰───── Any block in halving epoch
107+
╰─────── Any cycle
108108
```
109109

110110

111111
This satoshi is uncommon:
112112

113113
```
114-
1Β°1β€²1β€³0‴
114+
0Β°1β€²1β€³0‴
115115
β”‚ β”‚ β”‚ ╰─ First sat in block
116116
β”‚ β”‚ ╰─── Not first block in difficulty adjustment period
117117
β”‚ ╰───── Not first block in halving epoch
118-
╰─────── Second cycle
118+
╰─────── Any cycle
119119
```
120120

121121
This satoshi is rare:
122122

123123
```
124-
1Β°1β€²0β€³0‴
125-
β”‚ β”‚ β”‚ ╰─ First sat in block
126-
β”‚ β”‚ ╰─── First block in difficulty adjustment period
127-
β”‚ ╰───── Not the first block in halving epoch
128-
╰─────── Second cycle
124+
0Β°2016β€²0β€³0‴
125+
β”‚ β”‚ β”‚ ╰─ First sat in block
126+
β”‚ β”‚ ╰─── First block in difficulty adjustment period
127+
β”‚ ╰───── Not the first block in halving epoch
128+
╰────────── Any cycle
129129
```
130130

131131
This satoshi is epic:
132132

133133
```
134-
1Β°0β€²1β€³0‴
135-
β”‚ β”‚ β”‚ ╰─ First sat in block
136-
β”‚ β”‚ ╰─── Not first block in difficulty adjustment period
137-
β”‚ ╰───── First block in halving epoch
138-
╰─────── Second cycle
134+
0Β°0β€²336β€³0‴
135+
β”‚ β”‚ β”‚ ╰─ First sat in block
136+
β”‚ β”‚ ╰─── Not first block in difficulty adjustment period
137+
β”‚ ╰─────── First block in halving epoch
138+
╰───────── Any cycle
139139
```
140140

141141
This satoshi is legendary:
@@ -145,7 +145,7 @@ This satoshi is legendary:
145145
β”‚ β”‚ β”‚ ╰─ First sat in block
146146
β”‚ β”‚ ╰─── First block in difficulty adjustment period
147147
β”‚ ╰───── First block in halving epoch
148-
╰─────── Second cycle
148+
╰─────── Any cycle but first
149149
```
150150

151151
And this satoshi is mythic:

0 commit comments

Comments
Β (0)