@@ -261,7 +261,7 @@ fn update_price_feeds(
261
261
data : & [ Binary ] ,
262
262
) -> StdResult < Response < MsgWrapper > > {
263
263
if !is_fee_sufficient ( & deps. as_ref ( ) , info, data) ? {
264
- return Err ( PythContractError :: InsufficientFee ) ?;
264
+ Err ( PythContractError :: InsufficientFee ) ?;
265
265
}
266
266
267
267
let ( num_total_attestations, total_new_feeds) = apply_updates ( & mut deps, & env, data) ?;
@@ -308,7 +308,7 @@ fn execute_governance_instruction(
308
308
// Governance messages must be applied in order. This check prevents replay attacks where
309
309
// previous messages are re-applied.
310
310
if vaa. sequence <= state. governance_sequence_number {
311
- return Err ( PythContractError :: OldGovernanceMessage ) ?;
311
+ Err ( PythContractError :: OldGovernanceMessage ) ?;
312
312
} else {
313
313
updated_config. governance_sequence_number = vaa. sequence ;
314
314
}
@@ -320,13 +320,13 @@ fn execute_governance_instruction(
320
320
// Check that the instruction is intended for this chain.
321
321
// chain_id = 0 means the instruction applies to all chains
322
322
if instruction. target_chain_id != state. chain_id && instruction. target_chain_id != 0 {
323
- return Err ( PythContractError :: InvalidGovernancePayload ) ?;
323
+ Err ( PythContractError :: InvalidGovernancePayload ) ?;
324
324
}
325
325
326
326
// Check that the instruction is intended for this target chain contract (as opposed to
327
327
// other Pyth contracts that may live on the same chain).
328
328
if instruction. module != GovernanceModule :: Target {
329
- return Err ( PythContractError :: InvalidGovernancePayload ) ?;
329
+ Err ( PythContractError :: InvalidGovernancePayload ) ?;
330
330
}
331
331
332
332
let response = match instruction. action {
@@ -463,7 +463,7 @@ fn verify_vaa_from_data_source(state: &ConfigInfo, vaa: &ParsedVAA) -> StdResult
463
463
chain_id : vaa. emitter_chain ,
464
464
} ;
465
465
if !state. data_sources . contains ( & vaa_data_source) {
466
- return Err ( PythContractError :: InvalidUpdateEmitter ) ?;
466
+ Err ( PythContractError :: InvalidUpdateEmitter ) ?;
467
467
}
468
468
Ok ( ( ) )
469
469
}
@@ -475,7 +475,7 @@ fn verify_vaa_from_governance_source(state: &ConfigInfo, vaa: &ParsedVAA) -> Std
475
475
chain_id : vaa. emitter_chain ,
476
476
} ;
477
477
if state. governance_source != vaa_data_source {
478
- return Err ( PythContractError :: InvalidUpdateEmitter ) ?;
478
+ Err ( PythContractError :: InvalidUpdateEmitter ) ?;
479
479
}
480
480
Ok ( ( ) )
481
481
}
@@ -533,7 +533,7 @@ fn parse_accumulator(deps: &Deps, env: &Env, data: &[u8]) -> StdResult<Vec<Price
533
533
for update in updates {
534
534
let message_vec = Vec :: from ( update. message ) ;
535
535
if !root. check ( update. proof , & message_vec) {
536
- return Err ( PythContractError :: InvalidMerkleProof ) ?;
536
+ Err ( PythContractError :: InvalidMerkleProof ) ?;
537
537
}
538
538
539
539
let msg = from_slice :: < BigEndian , Message > ( & message_vec)
@@ -683,7 +683,7 @@ pub fn parse_price_feed_updates(
683
683
) -> StdResult < Response < MsgWrapper > > {
684
684
let _config = config_read ( deps. storage ) . load ( ) ?;
685
685
if !is_fee_sufficient ( & deps. as_ref ( ) , info, updates) ? {
686
- return Err ( PythContractError :: InsufficientFee ) ?;
686
+ Err ( PythContractError :: InsufficientFee ) ?;
687
687
}
688
688
let mut found_feeds = 0 ;
689
689
let mut results: Vec < ( Identifier , Option < PriceFeed > ) > =
@@ -709,7 +709,7 @@ pub fn parse_price_feed_updates(
709
709
}
710
710
}
711
711
if found_feeds != price_feeds. len ( ) {
712
- return Err ( PythContractError :: InvalidUpdatePayload ) ?;
712
+ Err ( PythContractError :: InvalidUpdatePayload ) ?;
713
713
}
714
714
715
715
let _unwrapped_feeds = results
@@ -1894,7 +1894,7 @@ mod test {
1894
1894
} )
1895
1895
. unwrap ( ) ;
1896
1896
1897
- let updates = vec ! [ Binary :: from( [ 1u8 ] ) , Binary :: from( [ 2u8 ] ) ] ;
1897
+ let updates = [ Binary :: from ( [ 1u8 ] ) , Binary :: from ( [ 2u8 ] ) ] ;
1898
1898
1899
1899
assert_eq ! (
1900
1900
get_update_fee( & deps. as_ref( ) , & updates[ 0 ..0 ] ) ,
0 commit comments