Skip to content

Commit

Permalink
fix txn fuzz tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtian committed Dec 29, 2024
1 parent 19f97c0 commit 366100b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions crates/transaction-fuzzer/src/account_universe/transfer_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,22 +469,24 @@ impl AUTransactionGen for P2PTransferGenRandomGasRandomPriceRandomSponsorship {
max_gas_price: PROTOCOL_CONFIG.max_gas_price(),
},
}),
// NOTE: at protocol version 71, gas budget can be both too high and too low.
// So the variants here need to be ordered same as the checks in gas_v2.rs
RunInfo {
gas_budget_too_low: true,
gas_budget_too_high: true,
..
} => Err(SuiError::UserInputError {
error: UserInputError::GasBudgetTooLow {
error: UserInputError::GasBudgetTooHigh {
gas_budget: self.gas,
min_budget: PROTOCOL_CONFIG.base_tx_cost_fixed() * self.gas_price,
max_budget: PROTOCOL_CONFIG.max_tx_gas(),
},
}),
RunInfo {
gas_budget_too_high: true,
gas_budget_too_low: true,
..
} => Err(SuiError::UserInputError {
error: UserInputError::GasBudgetTooHigh {
error: UserInputError::GasBudgetTooLow {
gas_budget: self.gas,
max_budget: PROTOCOL_CONFIG.max_tx_gas(),
min_budget: PROTOCOL_CONFIG.base_tx_cost_fixed() * self.gas_price,
},
}),
RunInfo {
Expand Down

0 comments on commit 366100b

Please sign in to comment.