Skip to content

Commit

Permalink
warnings cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lisicky committed Jun 22, 2024
1 parent 62a6a06 commit e056c45
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions rust/src/builders/mint_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ struct NativeMints {
}

impl NativeMints {

#[allow(dead_code)]
fn script_hash(&self) -> PolicyID {
match &self.script {
NativeScriptSourceEnum::NativeScript(script, _) => script.hash(),
Expand Down
1 change: 1 addition & 0 deletions rust/src/builders/script_structs/script_witness_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub(crate) enum ScriptWitnessType {
}

impl ScriptWitnessType {
#[allow(dead_code)]
pub(crate) fn script_hash(&self) -> ScriptHash {
match self {
ScriptWitnessType::NativeScriptWitness(script) => script.script_hash(),
Expand Down
1 change: 1 addition & 0 deletions rust/src/builders/tx_inputs_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ impl TxInputsBuilder {
.filter_map(|wit| wit.get_script_ref_input_with_size())
}

#[allow(dead_code)]
pub(crate) fn get_required_signers(&self) -> Ed25519KeyHashes {
self.into()
}
Expand Down
1 change: 1 addition & 0 deletions rust/src/protocol_types/credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ impl Credentials {
}
}

#[allow(dead_code)]
pub(crate) fn contains(&self, elem: &Credential) -> bool {
self.dedup.contains(elem)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ impl VotingProposals {
voting_proposals
}

#[allow(dead_code)]
pub(crate) fn contains(&self, proposal: &VotingProposal) -> bool {
self.dedup.contains(proposal)
}
Expand Down
1 change: 1 addition & 0 deletions rust/src/protocol_types/native_scripts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ impl NativeScripts {
NativeScripts(scripts)
}

#[allow(dead_code)]
pub(crate) fn contains(&self, script: &NativeScript) -> bool {
self.0.contains(script)
}
Expand Down
1 change: 1 addition & 0 deletions rust/src/protocol_types/plutus/plutus_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ impl PlutusList {
self.definite_encoding = None;
}

#[allow(dead_code)]
pub(crate) fn contains(&self, elem: &PlutusData) -> bool {
self.elems.contains(elem)
}
Expand Down
2 changes: 2 additions & 0 deletions rust/src/protocol_types/plutus/plutus_scripts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ impl PlutusScripts {
self.0.push(elem.clone());
}

#[allow(dead_code)]
pub(crate) fn by_version(&self, language: &Language) -> PlutusScripts {
PlutusScripts(
self.0
Expand Down Expand Up @@ -92,6 +93,7 @@ impl PlutusScripts {
PlutusScripts(scripts)
}

#[allow(dead_code)]
pub(crate) fn contains(&self, script: &PlutusScript) -> bool {
self.0.contains(&script)
}
Expand Down
1 change: 1 addition & 0 deletions rust/src/protocol_types/plutus/redeemers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ impl Redeemers {
}
}

#[allow(dead_code)]
pub(crate) fn new_with_serialization_format(
redeemers: Vec<Redeemer>,
serialization_format: CborContainerType,
Expand Down
6 changes: 0 additions & 6 deletions rust/src/protocol_types/protocol_param_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,6 @@ impl DrepVotingThresholds {
}
}

pub(crate) fn new_default() -> Self {
Self {
..Default::default()
}
}

pub fn set_motion_no_confidence(&mut self, motion_no_confidence: &UnitInterval) {
self.motion_no_confidence = motion_no_confidence.clone()
}
Expand Down
1 change: 1 addition & 0 deletions rust/src/rational.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ impl Rational {
}
}

#[allow(dead_code)]
pub(crate) fn to_bignum_floor(&self) -> Result<BigNum, JsError> {
let num = self.numerator();
let denum = self.denominator();
Expand Down
4 changes: 0 additions & 4 deletions rust/src/tests/builders/tx_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3776,10 +3776,6 @@ fn test_add_native_script_input() {
);
}

fn unsafe_tx_len(b: &TransactionBuilder) -> usize {
b.build_tx_unsafe().unwrap().to_bytes().len()
}

#[test]
fn test_native_input_scripts_are_added_to_the_witnesses() {
let mut tx_builder = create_reallistic_tx_builder();
Expand Down

0 comments on commit e056c45

Please sign in to comment.