Skip to content

Commit be1e4ac

Browse files
committed
CRC: fix some comments
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent 74f6c37 commit be1e4ac

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

stacks-common/src/deps_common/bitcoin/blockdata/script.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,10 @@ mod test {
840840

841841
let original = hex_script!("827651a0698faaa9a8a7a687");
842842
let json_value = serde_json::to_value(&original).unwrap();
843-
assert_eq!(serde_json::to_vec(&json_value).unwrap(), b"\"827651a0698faaa9a8a7a687\"");
843+
assert_eq!(
844+
serde_json::to_vec(&json_value).unwrap(),
845+
b"\"827651a0698faaa9a8a7a687\""
846+
);
844847
assert_eq!(json_value.to_string(), "\"827651a0698faaa9a8a7a687\"");
845848
let des = serde_json::from_value(json_value).unwrap();
846849
assert_eq!(original, des);

stacks-common/src/deps_common/bitcoin/network/message_network.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ use crate::deps_common::bitcoin::network::address::Address;
2222
use crate::deps_common::bitcoin::network::constants;
2323
use crate::util;
2424

25-
/// Some simple messages
25+
// Some simple messages
26+
2627
/// The `version` message
2728
#[derive(PartialEq, Eq, Clone, Debug)]
2829
pub struct VersionMessage {

stacks-common/src/types/mod.rs

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -122,22 +122,21 @@ pub struct CoinbaseInterval {
122122
pub effective_start_height: u64,
123123
}
124124

125-
/// From SIP-029:
126-
///
127-
/// | Coinbase Interval | Bitcoin Height | Offset Height | Approx. Supply | STX Reward | Annual Inflation |
128-
/// |--------------------|----------------|---------------------|------------------|------------|------------------|
129-
/// | Current | - | - | 1,552,452,847 | 1000 | - |
130-
/// | 1st | 945,000 | 278,950 | 1,627,352,847 | 500 (50%) | 3.23% |
131-
/// | 2nd | 1,050,000 | 383,950 | 1,679,852,847 | 250 (50%) | 1.57% |
132-
/// | 3rd | 1,260,000 | 593,950 | 1,732,352,847 | 125 (50%) | 0.76% |
133-
/// | 4th | 1,470,000 | 803,950 | 1,758,602,847 | 62.5 (50%) | 0.37% |
134-
/// | - | 2,197,560 | 1,531,510 | 1,804,075,347 | 62.5 (0%) | 0.18% |
135-
///
136-
/// The above is for mainnet, which has a burnchain year of 52596 blocks and starts at burnchain height 666050.
137-
/// The `Offset Height` column is simply the difference between `Bitcoin Height` and 666050.
138-
///
125+
// From SIP-029:
126+
//
127+
// | Coinbase Interval | Bitcoin Height | Offset Height | Approx. Supply | STX Reward | Annual Inflation |
128+
// |--------------------|----------------|---------------------|------------------|------------|------------------|
129+
// | Current | - | - | 1,552,452,847 | 1000 | - |
130+
// | 1st | 945,000 | 278,950 | 1,627,352,847 | 500 (50%) | 3.23% |
131+
// | 2nd | 1,050,000 | 383,950 | 1,679,852,847 | 250 (50%) | 1.57% |
132+
// | 3rd | 1,260,000 | 593,950 | 1,732,352,847 | 125 (50%) | 0.76% |
133+
// | 4th | 1,470,000 | 803,950 | 1,758,602,847 | 62.5 (50%) | 0.37% |
134+
// | - | 2,197,560 | 1,531,510 | 1,804,075,347 | 62.5 (0%) | 0.18% |
135+
//
136+
// The above is for mainnet, which has a burnchain year of 52596 blocks and starts at burnchain height 666050.
137+
139138
/// Mainnet coinbase intervals, as of SIP-029
140-
// This static value is lazily initialized using `OnceLock` to avoid unnecessary
139+
// This static value is lazily initialized using `OnceLock` to avoid unnecessary
141140
// computation at program startup while ensuring thread safety and one-time initialization.
142141
// The intervals define the emission schedule for mainnet and are validated at runtime.
143142
pub static COINBASE_INTERVALS_MAINNET: OnceLock<[CoinbaseInterval; 5]> = OnceLock::new();
@@ -173,7 +172,7 @@ pub fn get_coinbase_intervals_mainnet() -> &'static [CoinbaseInterval; 5] {
173172

174173
/// Testnet coinbase intervals as defined by SIP-029.
175174
///
176-
/// This static value is lazily initialized using `OnceLock` to avoid unnecessary
175+
/// This static value is lazily initialized using `OnceLock` to avoid unnecessary
177176
/// computation at program startup while ensuring thread safety and one-time initialization.
178177
/// The intervals define the emission schedule for testnet and are validated at runtime.
179178
pub static COINBASE_INTERVALS_TESTNET: OnceLock<[CoinbaseInterval; 5]> = OnceLock::new();
@@ -261,7 +260,7 @@ impl CoinbaseInterval {
261260
}
262261

263262
let mut ht = intervals[0].effective_start_height;
264-
for interval in intervals {
263+
for interval in intervals {
265264
if interval.effective_start_height < ht {
266265
return false;
267266
}
@@ -553,13 +552,11 @@ impl StacksEpochId {
553552
| StacksEpochId::Epoch30 => {
554553
self.coinbase_reward_pre_sip029(first_burnchain_height, current_burnchain_height)
555554
}
556-
StacksEpochId::Epoch31 => {
557-
self.coinbase_reward_sip029(
558-
mainnet,
559-
first_burnchain_height,
560-
current_burnchain_height,
561-
)
562-
}
555+
StacksEpochId::Epoch31 => self.coinbase_reward_sip029(
556+
mainnet,
557+
first_burnchain_height,
558+
current_burnchain_height,
559+
),
563560
}
564561
}
565562
}

stacks-common/src/types/tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
use crate::types::{get_coinbase_intervals_mainnet, get_coinbase_intervals_testnet};
18-
1917
use super::{
2018
set_test_coinbase_schedule, CoinbaseInterval, StacksEpochId, COINBASE_INTERVALS_MAINNET,
2119
COINBASE_INTERVALS_TESTNET,
2220
};
21+
use crate::types::{get_coinbase_intervals_mainnet, get_coinbase_intervals_testnet};
2322

2423
#[test]
2524
fn test_mainnet_coinbase_emissions() {

stacks-common/src/util/hash.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,10 @@ pub struct MerklePathPoint<H: MerkleHashFunc> {
382382
pub type MerklePath<H> = Vec<MerklePathPoint<H>>;
383383

384384
/// Merkle tree implementation with tagged nodes:
385-
///
385+
///
386386
/// * A leaf hash is `H(0x00 + data)`
387387
/// * A node hash is `H(0x01 + left.hash + right.hash)`
388-
///
388+
///
389389
/// An empty tree has a root hash of `0x00000...00000`.
390390
///
391391
/// NOTE: This is consensus-critical code, because it is used to generate the transaction Merkle

0 commit comments

Comments
 (0)