Skip to content

Commit

Permalink
machete, license, test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi committed Nov 27, 2024
1 parent d964828 commit 680f4f6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions base_layer/common_types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ tari_crypto = { version = "0.21.0" }
tari_utilities = { version = "0.8" }
tari_common = { path = "../../common", version = "1.7.0-pre.3" }
minotari_ledger_wallet_common = { path = "../../applications/minotari_ledger_wallet/common" }
tari_hashing = { path = "../../hashing", version = "1.7.0-pre.3" }

chacha20poly1305 = "0.10.1"
bitflags = { version = "2.4", features = ["serde"] }
Expand All @@ -35,5 +34,4 @@ default = []
[package.metadata.cargo-machete]
ignored = [
"strum",
"strum_macros",
] # this is so we can run cargo machete without getting false positive about macro dependancies
21 changes: 13 additions & 8 deletions base_layer/core/src/consensus/consensus_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub struct ConsensusConstants {
/// An allowlist of output types
permitted_output_types: &'static [OutputType],
/// The allowlist of range proof types
permitted_range_proof_types: [(OutputType, &'static [RangeProofType]); 5],
permitted_range_proof_types: &'static [(OutputType, &'static [RangeProofType])],
/// Coinbase outputs are allowed to have metadata, but it has the following length limit
coinbase_output_features_extra_max_length: u32,
/// Maximum number of token elements permitted in covenants
Expand Down Expand Up @@ -336,7 +336,7 @@ impl ConsensusConstants {
}

/// Returns the permitted range proof types
pub fn permitted_range_proof_types(&self) -> [(OutputType, &[RangeProofType]); 5] {
pub fn permitted_range_proof_types(&self) -> &'static [(OutputType, &'static [RangeProofType])] {
self.permitted_range_proof_types
}

Expand Down Expand Up @@ -725,8 +725,8 @@ impl ConsensusConstants {
&[OutputType::Coinbase, OutputType::Standard, OutputType::Burn]
}

const fn current_permitted_range_proof_types() -> [(OutputType, &'static [RangeProofType]); 5] {
[
const fn current_permitted_range_proof_types() -> &'static [(OutputType, &'static [RangeProofType])] {
&[
(OutputType::Standard, &[RangeProofType::BulletProofPlus]),
(OutputType::Coinbase, &[
RangeProofType::BulletProofPlus,
Expand All @@ -737,17 +737,22 @@ impl ConsensusConstants {
RangeProofType::BulletProofPlus,
]),
(OutputType::CodeTemplateRegistration, &[RangeProofType::BulletProofPlus]),
(OutputType::SidechainCheckpoint, &[RangeProofType::BulletProofPlus]),
(OutputType::SidechainProof, &[RangeProofType::BulletProofPlus]),
]
}

const fn all_range_proof_types() -> [(OutputType, &'static [RangeProofType]); 5] {
[
const fn all_range_proof_types() -> &'static [(OutputType, &'static [RangeProofType])] {
const RP_TYPES: &[(OutputType, &[RangeProofType])] = &[
(OutputType::Standard, RangeProofType::all()),
(OutputType::Coinbase, RangeProofType::all()),
(OutputType::Burn, RangeProofType::all()),
(OutputType::ValidatorNodeRegistration, RangeProofType::all()),
(OutputType::CodeTemplateRegistration, RangeProofType::all()),
]
(OutputType::SidechainCheckpoint, RangeProofType::all()),
(OutputType::SidechainProof, RangeProofType::all()),
];
RP_TYPES
}
}

Expand Down Expand Up @@ -894,7 +899,7 @@ impl ConsensusConstantsBuilder {

pub fn with_permitted_range_proof_types(
mut self,
permitted_range_proof_types: [(OutputType, &'static [RangeProofType]); 5],
permitted_range_proof_types: &'static [(OutputType, &'static [RangeProofType])],
) -> Self {
self.consensus.permitted_range_proof_types = permitted_range_proof_types;
self
Expand Down
14 changes: 5 additions & 9 deletions base_layer/core/src/validation/block_body/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ mod orphan_validator {
let rules = ConsensusManager::builder(Network::LocalNet)
.add_consensus_constants(
ConsensusConstantsBuilder::new(Network::LocalNet)
.with_permitted_range_proof_types([
.with_permitted_range_proof_types(&[
(OutputType::Standard, &[RangeProofType::RevealedValue]),
(OutputType::Coinbase, &[RangeProofType::RevealedValue]),
(OutputType::Burn, &[RangeProofType::RevealedValue]),
Expand Down Expand Up @@ -652,7 +652,7 @@ mod orphan_validator {
let rules = ConsensusManager::builder(Network::LocalNet)
.add_consensus_constants(
ConsensusConstantsBuilder::new(Network::LocalNet)
.with_permitted_range_proof_types([
.with_permitted_range_proof_types(&[
(OutputType::Standard, &[RangeProofType::BulletProofPlus]),
(OutputType::Coinbase, &[RangeProofType::BulletProofPlus]),
(OutputType::Burn, &[RangeProofType::BulletProofPlus]),
Expand Down Expand Up @@ -686,13 +686,9 @@ mod orphan_validator {
let rules = ConsensusManager::builder(Network::LocalNet)
.add_consensus_constants(
ConsensusConstantsBuilder::new(Network::LocalNet)
.with_permitted_range_proof_types([
(OutputType::CodeTemplateRegistration, &[RangeProofType::BulletProofPlus]),
(OutputType::CodeTemplateRegistration, &[RangeProofType::BulletProofPlus]),
(OutputType::CodeTemplateRegistration, &[RangeProofType::BulletProofPlus]),
(OutputType::CodeTemplateRegistration, &[RangeProofType::BulletProofPlus]),
(OutputType::CodeTemplateRegistration, &[RangeProofType::BulletProofPlus]),
])
.with_permitted_range_proof_types(&[(OutputType::CodeTemplateRegistration, &[
RangeProofType::BulletProofPlus,
])])
.with_coinbase_lockheight(0)
.build(),
)
Expand Down
2 changes: 2 additions & 0 deletions base_layer/sidechain/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2024 The Tari Project
// SPDX-License-Identifier: BSD-3-Clause
mod command;
mod commit_proof;
mod error;
Expand Down

0 comments on commit 680f4f6

Please sign in to comment.