@@ -1637,7 +1637,7 @@ impl AptosVM {
16371637 & gas_meter. vm_gas_params( ) . txn,
16381638 & txn_data,
16391639 txn. payload( ) ,
1640- ) ? ;
1640+ ) ;
16411641 txn_data. set_required_deposit( required_deposit) ;
16421642 self . validate_signed_transaction( session, resolver, txn, & txn_data, log_context)
16431643 } ) ) ;
@@ -2319,11 +2319,11 @@ impl AptosVM {
23192319 txn_gas_params : & TransactionGasParameters ,
23202320 txn_metadata : & TransactionMetadata ,
23212321 payload : & TransactionPayload ,
2322- ) -> VMResult < Option < u64 > > {
2322+ ) -> Option < u64 > {
23232323 match payload {
23242324 TransactionPayload :: EntryFunction ( entry_func) => {
23252325 if self . randomness_enabled
2326- && has_randomness_attribute ( resolver, session, entry_func) ?
2326+ && has_randomness_attribute ( resolver, session, entry_func) . unwrap_or ( false )
23272327 {
23282328 let max_execution_gas: Gas = txn_gas_params
23292329 . max_execution_gas
@@ -2336,14 +2336,14 @@ impl AptosVM {
23362336 let cand_1 =
23372337 txn_metadata. gas_unit_price * txn_gas_params. maximum_number_of_gas_units ;
23382338 let required_fee_deposit = min ( cand_0, cand_1) ;
2339- Ok ( Some ( u64:: from ( required_fee_deposit) ) )
2339+ Some ( u64:: from ( required_fee_deposit) )
23402340 } else {
2341- Ok ( None )
2341+ None
23422342 }
23432343 } ,
23442344 TransactionPayload :: Script ( _)
23452345 | TransactionPayload :: ModuleBundle ( _)
2346- | TransactionPayload :: Multisig ( _) => Ok ( None ) ,
2346+ | TransactionPayload :: Multisig ( _) => None ,
23472347 }
23482348 }
23492349}
@@ -2481,7 +2481,7 @@ impl VMValidator for AptosVM {
24812481
24822482 let resolver = self . as_move_resolver ( & state_view) ;
24832483 let mut session = self . new_session ( & resolver, SessionId :: prologue_meta ( & txn_data) ) ;
2484- let maybe_required_deposit = if let Ok ( gas_params) = & self . gas_params {
2484+ let required_deposit = if let Ok ( gas_params) = & self . gas_params {
24852485 self . get_required_deposit (
24862486 & mut session,
24872487 & resolver,
@@ -2493,13 +2493,6 @@ impl VMValidator for AptosVM {
24932493 return VMValidatorResult :: error ( StatusCode :: GAS_PARAMS_MISSING ) ;
24942494 } ;
24952495
2496- let required_deposit = match maybe_required_deposit {
2497- Ok ( v) => v,
2498- Err ( _e) => {
2499- return VMValidatorResult :: error ( StatusCode :: DEPOSIT_CALCULATION_FAILED ) ;
2500- } ,
2501- } ;
2502-
25032496 txn_data. set_required_deposit ( required_deposit) ;
25042497
25052498 // Increment the counter for transactions verified.
0 commit comments