Skip to content

Commit

Permalink
Fmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
oskin1 committed Oct 16, 2023
1 parent 4c46b8f commit 6b025a9
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 57 deletions.
10 changes: 2 additions & 8 deletions chain/rust/src/builders/tx_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -889,10 +889,7 @@ impl TransactionBuilder {
.witness_set_builder
.add_required_wits(result.required_wits.clone());
let mut mint = self.mint.take().unwrap_or_default();
let combined_assets = mint
.deref_mut()
.entry(result.policy_id)
.or_default();
let combined_assets = mint.deref_mut().entry(result.policy_id).or_default();
for (asset_name, asset_value) in result.assets.iter() {
if combined_assets
.insert(asset_name.clone(), *asset_value)
Expand Down Expand Up @@ -3658,10 +3655,7 @@ mod tests {
// we need to look up the values to ensure there's enough
let mut input_values = BTreeMap::new();
for utxo in tx_builder.utxos.iter() {
input_values.insert(
utxo.input.transaction_id,
utxo.utxo_info.amount().clone(),
);
input_values.insert(utxo.input.transaction_id, utxo.utxo_info.amount().clone());
}
let mut encountered = std::collections::HashSet::new();
let mut input_total = Value::from(Coin::zero());
Expand Down
4 changes: 1 addition & 3 deletions chain/wasm/src/byron/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,7 @@ impl SpendingData {

pub fn as_spending_data_script(&self) -> Option<ByronScript> {
match &self.0 {
cml_chain::byron::SpendingData::SpendingDataScript(script) => {
Some((*script).into())
}
cml_chain::byron::SpendingData::SpendingDataScript(script) => Some((*script).into()),
_ => None,
}
}
Expand Down
8 changes: 2 additions & 6 deletions chain/wasm/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,7 @@ impl TransactionBody {
}

pub fn auxiliary_data_hash(&self) -> Option<AuxiliaryDataHash> {
self.0
.auxiliary_data_hash
.map(std::convert::Into::into)
self.0.auxiliary_data_hash.map(std::convert::Into::into)
}

pub fn set_validity_interval_start(&mut self, validity_interval_start: u64) {
Expand All @@ -552,9 +550,7 @@ impl TransactionBody {
}

pub fn script_data_hash(&self) -> Option<ScriptDataHash> {
self.0
.script_data_hash
.map(std::convert::Into::into)
self.0.script_data_hash.map(std::convert::Into::into)
}

pub fn set_collateral_inputs(&mut self, collateral_inputs: &TransactionInputList) {
Expand Down
5 changes: 1 addition & 4 deletions multi-era/rust/src/babbage/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4555,10 +4555,7 @@ impl Deserialize for BabbageUpdate {
})
})?;
let updates_value = BabbageProtocolParamUpdate::deserialize(raw)?;
if updates_table
.insert(updates_key, updates_value)
.is_some()
{
if updates_table.insert(updates_key, updates_value).is_some() {
return Err(DeserializeFailure::DuplicateKey(Key::Str(String::from(
"some complicated/unsupported type",
)))
Expand Down
4 changes: 1 addition & 3 deletions multi-era/wasm/src/allegra/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,7 @@ impl AllegraTransactionBody {
}

pub fn auxiliary_data_hash(&self) -> Option<AuxiliaryDataHash> {
self.0
.auxiliary_data_hash
.map(std::convert::Into::into)
self.0.auxiliary_data_hash.map(std::convert::Into::into)
}

pub fn set_validity_interval_start(&mut self, validity_interval_start: u64) {
Expand Down
14 changes: 3 additions & 11 deletions multi-era/wasm/src/alonzo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,7 @@ impl AlonzoProposedProtocolParameterUpdates {
}

pub fn keys(&self) -> GenesisHashList {
self.0
.iter()
.map(|(k, _v)| *k)
.collect::<Vec<_>>()
.into()
self.0.iter().map(|(k, _v)| *k).collect::<Vec<_>>().into()
}
}

Expand Down Expand Up @@ -594,9 +590,7 @@ impl AlonzoTransactionBody {
}

pub fn auxiliary_data_hash(&self) -> Option<AuxiliaryDataHash> {
self.0
.auxiliary_data_hash
.map(std::convert::Into::into)
self.0.auxiliary_data_hash.map(std::convert::Into::into)
}

pub fn set_validity_interval_start(&mut self, validity_interval_start: u64) {
Expand All @@ -620,9 +614,7 @@ impl AlonzoTransactionBody {
}

pub fn script_data_hash(&self) -> Option<ScriptDataHash> {
self.0
.script_data_hash
.map(std::convert::Into::into)
self.0.script_data_hash.map(std::convert::Into::into)
}

pub fn set_collateral_inputs(&mut self, collateral_inputs: &TransactionInputList) {
Expand Down
14 changes: 3 additions & 11 deletions multi-era/wasm/src/babbage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,7 @@ impl BabbageProposedProtocolParameterUpdates {
}

pub fn keys(&self) -> GenesisHashList {
self.0
.iter()
.map(|(k, _v)| *k)
.collect::<Vec<_>>()
.into()
self.0.iter().map(|(k, _v)| *k).collect::<Vec<_>>().into()
}
}

Expand Down Expand Up @@ -723,9 +719,7 @@ impl BabbageTransactionBody {
}

pub fn auxiliary_data_hash(&self) -> Option<AuxiliaryDataHash> {
self.0
.auxiliary_data_hash
.map(std::convert::Into::into)
self.0.auxiliary_data_hash.map(std::convert::Into::into)
}

pub fn set_validity_interval_start(&mut self, validity_interval_start: u64) {
Expand All @@ -749,9 +743,7 @@ impl BabbageTransactionBody {
}

pub fn script_data_hash(&self) -> Option<ScriptDataHash> {
self.0
.script_data_hash
.map(std::convert::Into::into)
self.0.script_data_hash.map(std::convert::Into::into)
}

pub fn set_collateral_inputs(&mut self, collateral_inputs: &TransactionInputList) {
Expand Down
4 changes: 1 addition & 3 deletions multi-era/wasm/src/mary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ impl MaryTransactionBody {
}

pub fn auxiliary_data_hash(&self) -> Option<AuxiliaryDataHash> {
self.0
.auxiliary_data_hash
.map(std::convert::Into::into)
self.0.auxiliary_data_hash.map(std::convert::Into::into)
}

pub fn set_validity_interval_start(&mut self, validity_interval_start: u64) {
Expand Down
10 changes: 2 additions & 8 deletions multi-era/wasm/src/shelley/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,11 +702,7 @@ impl ShelleyProposedProtocolParameterUpdates {
}

pub fn keys(&self) -> GenesisHashList {
self.0
.iter()
.map(|(k, _v)| *k)
.collect::<Vec<_>>()
.into()
self.0.iter().map(|(k, _v)| *k).collect::<Vec<_>>().into()
}
}

Expand Down Expand Up @@ -964,9 +960,7 @@ impl ShelleyTransactionBody {
}

pub fn auxiliary_data_hash(&self) -> Option<AuxiliaryDataHash> {
self.0
.auxiliary_data_hash
.map(std::convert::Into::into)
self.0.auxiliary_data_hash.map(std::convert::Into::into)
}

pub fn new(
Expand Down

0 comments on commit 6b025a9

Please sign in to comment.