File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1722,11 +1722,10 @@ impl Backend {
1722
1722
cache_db. commit ( state) ;
1723
1723
gas_used += result. gas_used ( ) ;
1724
1724
1725
- // TODO: this is likely incomplete
1726
1725
// create the transaction from a request
1727
1726
let from = request. from . unwrap_or_default ( ) ;
1728
- let request =
1729
- transaction_request_to_typed ( WithOtherFields :: new ( request ) ) . unwrap ( ) ;
1727
+ let request = transaction_request_to_typed ( WithOtherFields :: new ( request ) )
1728
+ . ok_or ( BlockchainError :: MissingRequiredFields ) ? ;
1730
1729
let tx = build_typed_transaction (
1731
1730
request,
1732
1731
Signature :: new ( Default :: default ( ) , Default :: default ( ) , false ) ,
Original file line number Diff line number Diff line change @@ -115,6 +115,8 @@ pub enum BlockchainError {
115
115
/// Duration that was waited before timing out
116
116
duration : Duration ,
117
117
} ,
118
+ #[ error( "Failed to parse transaction request: missing required fields" ) ]
119
+ MissingRequiredFields ,
118
120
}
119
121
120
122
impl From < eyre:: Report > for BlockchainError {
@@ -563,6 +565,9 @@ impl<T: Serialize> ToRpcResponseResult for Result<T> {
563
565
err @ BlockchainError :: UnknownTransactionType => {
564
566
RpcError :: invalid_params ( err. to_string ( ) )
565
567
}
568
+ err @ BlockchainError :: MissingRequiredFields => {
569
+ RpcError :: invalid_params ( err. to_string ( ) )
570
+ }
566
571
}
567
572
. into ( ) ,
568
573
}
You can’t perform that action at this time.
0 commit comments