File tree 2 files changed +15
-18
lines changed
2 files changed +15
-18
lines changed Original file line number Diff line number Diff line change @@ -435,18 +435,16 @@ export class EvmPricePusher implements IPricePusher {
435
435
hash : hash ,
436
436
} ) ;
437
437
438
- if ( receipt . status === "success" ) {
439
- this . logger . info ( { hash } , "Price update successful" ) ;
440
- } else if ( receipt . status === "reverted" ) {
441
- this . logger . info (
442
- { hash, receipt } ,
443
- "Price update reverted or its transaction did not land. " +
444
- "This is an expected behaviour in high frequency or multi-instance setup."
445
- ) ;
446
- } else {
447
- throw new Error (
448
- "This codepath should be unreachable. Please file a bug report."
449
- ) ;
438
+ switch ( receipt . status ) {
439
+ case "success" :
440
+ this . logger . info ( { hash } , "Price update successful" ) ;
441
+ break ;
442
+ default :
443
+ this . logger . info (
444
+ { hash, receipt } ,
445
+ "Price update did not succeed or its transaction did not land. " +
446
+ "This is an expected behaviour in high frequency or multi-instance setup."
447
+ ) ;
450
448
}
451
449
} catch ( err : any ) {
452
450
this . logger . warn ( { err } , "Failed to get transaction receipt" ) ;
Original file line number Diff line number Diff line change @@ -18,12 +18,11 @@ export function removeLeading0x(id: HexString): HexString {
18
18
return id ;
19
19
}
20
20
21
- export function addLeading0x ( id : HexString ) : `0x${string } ` {
22
- if ( id . startsWith ( "0x" ) ) {
23
- return id as `0x${string } `;
24
- }
25
- return ( "0x" + id ) as `0x${string } `;
26
- }
21
+ export const addLeading0x = ( id : HexString ) : `0x${string } ` =>
22
+ hasLeading0x ( id ) ? id : `0x${ id } ` ;
23
+
24
+ const hasLeading0x = ( input : string ) : input is `0x${string } ` =>
25
+ input . startsWith ( "0x" ) ;
27
26
28
27
export function isWsEndpoint ( endpoint : string ) : boolean {
29
28
const url = new URL ( endpoint ) ;
You can’t perform that action at this time.
0 commit comments