mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-02 13:23:10 +00:00
fix: fmt
This commit is contained in:
parent
b9d3f921e9
commit
eb16534ad9
@ -17,11 +17,9 @@ pub fn produce_blob_list_from_sc_public_state<S: Serialize>(
|
||||
//`ToDo` Replace with `next_chunk` usage, when feature stabilizes in Rust
|
||||
for i in 0..=(ser_data.len() / SC_DATA_BLOB_SIZE) {
|
||||
let next_chunk: Vec<u8> = if (i + 1) * SC_DATA_BLOB_SIZE < ser_data.len() {
|
||||
ser_data[(i * SC_DATA_BLOB_SIZE)..((i + 1) * SC_DATA_BLOB_SIZE)]
|
||||
.to_vec()
|
||||
ser_data[(i * SC_DATA_BLOB_SIZE)..((i + 1) * SC_DATA_BLOB_SIZE)].to_vec()
|
||||
} else {
|
||||
ser_data[(i * SC_DATA_BLOB_SIZE)..(ser_data.len())]
|
||||
.to_vec()
|
||||
ser_data[(i * SC_DATA_BLOB_SIZE)..(ser_data.len())].to_vec()
|
||||
};
|
||||
|
||||
blob_list.push(produce_blob_from_fit_vec(next_chunk));
|
||||
@ -47,10 +45,7 @@ pub fn compare_blob_lists(
|
||||
}
|
||||
} else if new_len > old_len {
|
||||
for (id, blob) in blob_list_new.iter().enumerate().take(new_len).skip(old_len) {
|
||||
changed_ids.push(DataBlobChangeVariant::Created {
|
||||
id,
|
||||
blob: *blob,
|
||||
});
|
||||
changed_ids.push(DataBlobChangeVariant::Created { id, blob: *blob });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -343,18 +343,16 @@ mod tests {
|
||||
assert_eq!(sequencer.sequencer_config.max_num_tx_in_block, 10);
|
||||
assert_eq!(sequencer.sequencer_config.port, 8080);
|
||||
|
||||
let acc1_addr: [u8; 32] = hex::decode(
|
||||
"bfd91e6703273a115ad7f099ef32f621243be69369d00ddef5d3a25117d09a8c",
|
||||
)
|
||||
.unwrap()
|
||||
.try_into()
|
||||
.unwrap();
|
||||
let acc2_addr: [u8; 32] = hex::decode(
|
||||
"20573479053979b98d2ad09ef31a0750f22c77709bed51c4e64946bd1e376f31",
|
||||
)
|
||||
.unwrap()
|
||||
.try_into()
|
||||
.unwrap();
|
||||
let acc1_addr: [u8; 32] =
|
||||
hex::decode("bfd91e6703273a115ad7f099ef32f621243be69369d00ddef5d3a25117d09a8c")
|
||||
.unwrap()
|
||||
.try_into()
|
||||
.unwrap();
|
||||
let acc2_addr: [u8; 32] =
|
||||
hex::decode("20573479053979b98d2ad09ef31a0750f22c77709bed51c4e64946bd1e376f31")
|
||||
.unwrap()
|
||||
.try_into()
|
||||
.unwrap();
|
||||
|
||||
assert!(sequencer.store.acc_store.contains_account(&acc1_addr));
|
||||
assert!(sequencer.store.acc_store.contains_account(&acc2_addr));
|
||||
@ -397,18 +395,16 @@ mod tests {
|
||||
let config = setup_sequencer_config_variable_initial_accounts(initial_accounts);
|
||||
let sequencer = SequencerCore::start_from_config(config.clone());
|
||||
|
||||
let acc1_addr: [u8; 32] = hex::decode(
|
||||
"bfd91e6703273a115ad7f099ef32f621243be69369d00ddef5d3a25117ffffff",
|
||||
)
|
||||
.unwrap()
|
||||
.try_into()
|
||||
.unwrap();
|
||||
let acc2_addr: [u8; 32] = hex::decode(
|
||||
"20573479053979b98d2ad09ef31a0750f22c77709bed51c4e64946bd1effffff",
|
||||
)
|
||||
.unwrap()
|
||||
.try_into()
|
||||
.unwrap();
|
||||
let acc1_addr: [u8; 32] =
|
||||
hex::decode("bfd91e6703273a115ad7f099ef32f621243be69369d00ddef5d3a25117ffffff")
|
||||
.unwrap()
|
||||
.try_into()
|
||||
.unwrap();
|
||||
let acc2_addr: [u8; 32] =
|
||||
hex::decode("20573479053979b98d2ad09ef31a0750f22c77709bed51c4e64946bd1effffff")
|
||||
.unwrap()
|
||||
.try_into()
|
||||
.unwrap();
|
||||
|
||||
assert!(sequencer.store.acc_store.contains_account(&acc1_addr));
|
||||
assert!(sequencer.store.acc_store.contains_account(&acc2_addr));
|
||||
|
||||
@ -89,7 +89,7 @@ impl SequencerAccountsStore {
|
||||
///Is accounts store empty
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.accounts.is_empty()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for SequencerAccountsStore {
|
||||
@ -221,8 +221,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn account_sequencer_store_is_empty_test() {
|
||||
let seq_acc_store =
|
||||
SequencerAccountsStore::default();
|
||||
let seq_acc_store = SequencerAccountsStore::default();
|
||||
|
||||
assert!(seq_acc_store.is_empty());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user