Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Fix rust formatting #363

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pallas-applying/tests/byron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ mod byron_tests {
}

#[test]
// Transaction hash: a9e4413a5fb61a7a43c7df006ffcaaf3f2ffc9541f54757023968c5a8f8294fd
// Transaction hash:
// a9e4413a5fb61a7a43c7df006ffcaaf3f2ffc9541f54757023968c5a8f8294fd
fn successful_mainnet_tx_with_genesis_utxos() {
let cbor_bytes: Vec<u8> = cbor_to_bytes(include_str!("../../test_data/byron2.tx"));
let mtxp: MintedTxPayload = tx_from_cbor(&cbor_bytes);
Expand Down Expand Up @@ -81,7 +82,8 @@ mod byron_tests {
}

#[test]
// Transaction hash: a06e5a0150e09f8983be2deafab9e04afc60d92e7110999eb672c903343f1e26
// Transaction hash:
// a06e5a0150e09f8983be2deafab9e04afc60d92e7110999eb672c903343f1e26
fn successful_mainnet_tx() {
let cbor_bytes: Vec<u8> = cbor_to_bytes(include_str!("../../test_data/byron1.tx"));
let mtxp: MintedTxPayload = tx_from_cbor(&cbor_bytes);
Expand Down
34 changes: 20 additions & 14 deletions pallas-applying/tests/shelley_ma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ mod shelley_tests {
}

#[test]
// Transaction hash: 50eba65e73c8c5f7b09f4ea28cf15dce169f3d1c322ca3deff03725f51518bb2
// Transaction hash:
// 50eba65e73c8c5f7b09f4ea28cf15dce169f3d1c322ca3deff03725f51518bb2
fn successful_mainnet_shelley_tx() {
let cbor_bytes: Vec<u8> = cbor_to_bytes(include_str!("../../test_data/shelley1.tx"));
let mtx: MintedTx = minted_tx_from_cbor(&cbor_bytes);
Expand Down Expand Up @@ -90,7 +91,8 @@ mod shelley_tests {
}

#[test]
// Transaction hash: 4a3f86762383f1d228542d383ae7ac89cf75cf7ff84dec8148558ea92b0b92d0
// Transaction hash:
// 4a3f86762383f1d228542d383ae7ac89cf75cf7ff84dec8148558ea92b0b92d0
fn successful_mainnet_shelley_tx_with_script() {
let cbor_bytes: Vec<u8> = cbor_to_bytes(include_str!("../../test_data/shelley2.tx"));
let mtx: MintedTx = minted_tx_from_cbor(&cbor_bytes);
Expand Down Expand Up @@ -121,7 +123,8 @@ mod shelley_tests {
}

#[test]
// Transaction hash: c220e20cc480df9ce7cd871df491d7390c6a004b9252cf20f45fc3c968535b4a
// Transaction hash:
// c220e20cc480df9ce7cd871df491d7390c6a004b9252cf20f45fc3c968535b4a
fn successful_mainnet_shelley_tx_with_metadata() {
let cbor_bytes: Vec<u8> = cbor_to_bytes(include_str!("../../test_data/shelley3.tx"));
let mtx: MintedTx = minted_tx_from_cbor(&cbor_bytes);
Expand Down Expand Up @@ -152,7 +155,8 @@ mod shelley_tests {
}

#[test]
// Transaction hash: b7b1046d1787ac6917f5bb5841e73b3f4bef8f0a6bf692d05ef18e1db9c3f519
// Transaction hash:
// b7b1046d1787ac6917f5bb5841e73b3f4bef8f0a6bf692d05ef18e1db9c3f519
fn successful_mainnet_mary_tx_with_minting() {
let cbor_bytes: Vec<u8> = cbor_to_bytes(include_str!("../../test_data/mary1.tx"));
let mtx: MintedTx = minted_tx_from_cbor(&cbor_bytes);
Expand Down Expand Up @@ -367,8 +371,8 @@ mod shelley_tests {
}

#[test]
// Min lovelace per UTxO is too high (10000000000000 lovelace against 2332262258756 lovelace in
// transaction output).
// Min lovelace per UTxO is too high (10000000000000 lovelace against
// 2332262258756 lovelace in transaction output).
fn output_below_min_lovelace() {
let cbor_bytes: Vec<u8> = cbor_to_bytes(include_str!("../../test_data/shelley1.tx"));
let mtx: MintedTx = minted_tx_from_cbor(&cbor_bytes);
Expand Down Expand Up @@ -402,7 +406,8 @@ mod shelley_tests {
}

#[test]
// The "preservation of value" property doesn't hold - the fee is reduced by exactly 1.
// The "preservation of value" property doesn't hold - the fee is reduced by
// exactly 1.
fn preservation_of_value() {
let cbor_bytes: Vec<u8> = cbor_to_bytes(include_str!("../../test_data/shelley1.tx"));
let mut mtx: MintedTx = minted_tx_from_cbor(&cbor_bytes);
Expand Down Expand Up @@ -479,7 +484,8 @@ mod shelley_tests {
}

#[test]
// One of the output's address network ID is changed from the mainnet value to the testnet one.
// One of the output's address network ID is changed from the mainnet value to
// the testnet one.
fn wrong_network_id() {
let cbor_bytes: Vec<u8> = cbor_to_bytes(include_str!("../../test_data/shelley1.tx"));
let mut mtx: MintedTx = minted_tx_from_cbor(&cbor_bytes);
Expand Down Expand Up @@ -576,8 +582,8 @@ mod shelley_tests {

#[test]
// Like successful_mainnet_shelley_tx (hash:
// 50eba65e73c8c5f7b09f4ea28cf15dce169f3d1c322ca3deff03725f51518bb2), but the verification-key
// witness is removed.
// 50eba65e73c8c5f7b09f4ea28cf15dce169f3d1c322ca3deff03725f51518bb2), but the
// verification-key witness is removed.
fn missing_vk_witness() {
let cbor_bytes: Vec<u8> = cbor_to_bytes(include_str!("../../test_data/shelley1.tx"));
let mut mtx: MintedTx = minted_tx_from_cbor(&cbor_bytes);
Expand Down Expand Up @@ -622,8 +628,8 @@ mod shelley_tests {

#[test]
// Like successful_mainnet_shelley_tx (hash:
// 50eba65e73c8c5f7b09f4ea28cf15dce169f3d1c322ca3deff03725f51518bb2), but the signature inside
// the verification-key witness is changed.
// 50eba65e73c8c5f7b09f4ea28cf15dce169f3d1c322ca3deff03725f51518bb2), but the
// signature inside the verification-key witness is changed.
fn vk_witness_changed() {
let cbor_bytes: Vec<u8> = cbor_to_bytes(include_str!("../../test_data/shelley1.tx"));
let mut mtx: MintedTx = minted_tx_from_cbor(&cbor_bytes);
Expand Down Expand Up @@ -673,8 +679,8 @@ mod shelley_tests {

#[test]
// Like successful_mainnet_shelley_tx_with_script(hash:
// 4a3f86762383f1d228542d383ae7ac89cf75cf7ff84dec8148558ea92b0b92d0), but the native-script
// witness is removed.
// 4a3f86762383f1d228542d383ae7ac89cf75cf7ff84dec8148558ea92b0b92d0), but the
// native-script witness is removed.
fn missing_native_script_witness() {
let cbor_bytes: Vec<u8> = cbor_to_bytes(include_str!("../../test_data/shelley2.tx"));
let mut mtx: MintedTx = minted_tx_from_cbor(&cbor_bytes);
Expand Down