Skip to content

Commit

Permalink
Marinade LP - fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dankelleher committed Feb 29, 2024
1 parent 24ea566 commit 42a7cef
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions programs/sunrise-core/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ mod internal_tests {
let mut input = RegisterStateInput::default();
input.initial_capacity = 10;

state.register(input, 0, &Pubkey::default(), 1000);
state.register(input, 0, &Pubkey::default(), 1000).unwrap();
assert_eq!(state.allocations, vec![BeamDetails::default(); 10]);
}
#[test]
Expand Down Expand Up @@ -396,7 +396,7 @@ mod internal_tests {
let mut input = RegisterStateInput::default();

input.initial_capacity = 2;
state.register(input, 0, &Pubkey::new_unique(), 1000);
state.register(input, 0, &Pubkey::new_unique(), 1000).unwrap();

let beam_key = Pubkey::new_unique();
let new_beam = BeamDetails::new(beam_key, 10);
Expand Down Expand Up @@ -505,12 +505,10 @@ mod internal_tests {

let initial_size = state.size_inner();
assert_eq!(state.allocations.len(), 0);
assert_eq!(initial_size, State::SIZE_WITH_ZERO_BEAMS);
assert_eq!(initial_size, State::size(0));

state.allocations = vec![BeamDetails::default(); 10];
let size = state.size_inner();
assert_eq!(size, State::size(10));
assert_eq!(size, initial_size + (10 * BeamDetails::SIZE))
}
}

0 comments on commit 42a7cef

Please sign in to comment.