Skip to content

Commit dfbad96

Browse files
authored
fix panic config (#92)
1 parent dc74a63 commit dfbad96

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

harness/src/result.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,20 @@ impl Default for InstructionResult {
108108
}
109109
}
110110

111-
#[derive(Default)]
112111
pub struct Config {
113112
pub panic: bool,
114113
pub verbose: bool,
115114
}
116115

116+
impl Default for Config {
117+
fn default() -> Self {
118+
Self {
119+
panic: true,
120+
verbose: false,
121+
}
122+
}
123+
}
124+
117125
impl InstructionResult {
118126
/// Get an account from the resulting accounts by its pubkey.
119127
pub fn get_account(&self, pubkey: &Pubkey) -> Option<&Account> {

harness/tests/bpf_program.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ fn test_transfer() {
151151
],
152152
&[
153153
Check::success(),
154-
Check::compute_units(2504),
154+
Check::compute_units(2500),
155155
Check::account(&payer)
156156
.lamports(payer_lamports - transfer_amount)
157157
.build(),
@@ -209,7 +209,7 @@ fn test_close_account() {
209209
],
210210
&[
211211
Check::success(),
212-
Check::compute_units(2585),
212+
Check::compute_units(2581),
213213
Check::account(&key)
214214
.closed() // The rest is unnecessary, just testing.
215215
.data(&[])
@@ -265,7 +265,7 @@ fn test_cpi() {
265265
&[
266266
// This is the error thrown by SVM. It also emits the message
267267
// "Program is not cached".
268-
Check::err(ProgramError::InvalidAccountData),
268+
Check::instruction_err(InstructionError::UnsupportedProgramId),
269269
],
270270
);
271271
}
@@ -329,7 +329,7 @@ fn test_cpi() {
329329
],
330330
&[
331331
Check::success(),
332-
Check::compute_units(2288),
332+
Check::compute_units(2289),
333333
Check::account(&key)
334334
.data(data)
335335
.lamports(lamports)

0 commit comments

Comments
 (0)