Skip to content

Commit

Permalink
Fix remaining execution tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Eitu33 committed May 3, 2023
1 parent 95c8cc9 commit 6f16f0b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
4 changes: 0 additions & 4 deletions massa-execution-worker/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,12 @@ impl ExecutionState {
// get the thread to which the operation belongs
let op_thread = sender_addr.get_thread(self.config.thread_count);

// TODO
dbg!(op_thread, block_slot.thread);
// check block/op thread compatibility
if op_thread != block_slot.thread {
return Err(ExecutionError::IncludeOperationError(
"operation vs block thread mismatch".to_string(),
));
}
dbg!("compatibility ok");
// TODO

// get operation ID
let operation_id = operation.id;
Expand Down
2 changes: 1 addition & 1 deletion massa-execution-worker/src/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ pub fn get_initials_vesting(with_value: bool) -> NamedTempFile {
];

let keypair_0 =
KeyPair::from_str("S1JJeHiZv1C1zZN5GLFcbz6EXYiccmUPLkYuDFA3kayjxP39kFQ").unwrap();
KeyPair::from_str("S18r2i8oJJyhF7Kprx98zwxAc3W4szf7RKuVMX6JydZz8zSxHeC").unwrap();
let addr_0 = Address::from_public_key(&keypair_0.get_public_key());

map.insert(addr_0, vec);
Expand Down
16 changes: 8 additions & 8 deletions massa-execution-worker/src/tests/scenarios_mandatories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ mod tests {
});

// match the events
assert_eq!(events.len(), 2, "Two events were expected");
assert_eq!(events.len(), 2, "2 events were expected");
assert_eq!(events[0].data, "Triggered");

// keypair associated to thread 1
Expand Down Expand Up @@ -999,8 +999,7 @@ mod tests {
});

// match the events
assert!(events.len() == 3, "Three event was expected");
assert_eq!(events[0].data, "Triggered");
assert!(events.len() == 3, "3 events were expected");

// keypair associated to thread 2
let keypair = KeyPair::from_str(TEST_SK_3).unwrap();
Expand All @@ -1027,14 +1026,11 @@ mod tests {

// retrieve events emitted by smart contracts
let events = controller.get_filtered_sc_output_event(EventFilter {
start: Some(Slot::new(1, 3)),
..Default::default()
});

// match the events
assert_eq!(events.len(), 1, "One event was expected");
assert_eq!(events[0].data, "Triggered");
assert_eq!(events[0].data, "Triggered");
assert!(events.len() == 4, "4 events were expected");

manager.stop();
}
Expand Down Expand Up @@ -1207,7 +1203,11 @@ mod tests {
std::thread::sleep(Duration::from_millis(100));

// retrieve the event emitted by the execution error
let events = controller.get_filtered_sc_output_event(EventFilter::default());
let events = controller.get_filtered_sc_output_event(EventFilter {
is_error: Some(true),
..Default::default()
});
dbg!(&events);
assert!(events[0].data.contains("massa_execution_error"));
assert!(events[0]
.data
Expand Down
6 changes: 3 additions & 3 deletions massa-execution-worker/src/tests/tests_vesting_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ mod test {
fn test_get_addr_vesting_at_time() {
let manager = mock_manager(true);

let keypair_0 = massa_signature::KeyPair::from_str(
"S1JJeHiZv1C1zZN5GLFcbz6EXYiccmUPLkYuDFA3kayjxP39kFQ",
let keypair = massa_signature::KeyPair::from_str(
"S18r2i8oJJyhF7Kprx98zwxAc3W4szf7RKuVMX6JydZz8zSxHeC",
)
.unwrap();
let addr = Address::from_public_key(&keypair_0.get_public_key());
let addr = Address::from_public_key(&keypair.get_public_key());

{
// addr not vested
Expand Down

0 comments on commit 6f16f0b

Please sign in to comment.