Skip to content

Commit c4cf4d5

Browse files
committed
style: fix formatting with oxfmt
1 parent 5b30d04 commit c4cf4d5

3 files changed

Lines changed: 30 additions & 19 deletions

File tree

packages/controller-utils/src/create-service-policy.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ export type ServicePolicy = IPolicy & {
117117
* never succeeds before the retry policy gives up and before the maximum
118118
* number of consecutive failures has been reached.
119119
*/
120-
onDegraded: CockatielEvent<FailureReason<unknown> | { duration: number } | void>;
120+
onDegraded: CockatielEvent<
121+
FailureReason<unknown> | { duration: number } | void
122+
>;
121123
/**
122124
* A function which is called when the service succeeds for the first time,
123125
* or when the service fails enough times to cause the circuit to break and
@@ -321,8 +323,9 @@ export function createServicePolicy(
321323
});
322324
const onBreak = circuitBreakerPolicy.onBreak.bind(circuitBreakerPolicy);
323325

324-
const onDegradedEventEmitter =
325-
new CockatielEventEmitter<FailureReason<unknown> | { duration: number } | void>();
326+
const onDegradedEventEmitter = new CockatielEventEmitter<
327+
FailureReason<unknown> | { duration: number } | void
328+
>();
326329
const onDegraded = onDegradedEventEmitter.addListener;
327330

328331
const onAvailableEventEmitter = new CockatielEventEmitter<void>();

packages/network-controller/src/create-network-client.ts

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -350,21 +350,24 @@ function createRpcServiceChain({
350350
},
351351
);
352352

353-
rpcServiceChain.onDegraded(({ rpcMethodName, duration, traceId, ...rest }) => {
354-
const error = getError(rest);
355-
const type: DegradedEventType =
356-
error === undefined ? 'slow_success' : 'retries_exhausted';
357-
messenger.publish('NetworkController:rpcEndpointChainDegraded', {
358-
chainId: configuration.chainId,
359-
networkClientId: id,
360-
error,
361-
rpcMethodName,
362-
duration,
363-
traceId,
364-
type,
365-
retryReason: error === undefined ? undefined : classifyRetryReason(error),
366-
});
367-
});
353+
rpcServiceChain.onDegraded(
354+
({ rpcMethodName, duration, traceId, ...rest }) => {
355+
const error = getError(rest);
356+
const type: DegradedEventType =
357+
error === undefined ? 'slow_success' : 'retries_exhausted';
358+
messenger.publish('NetworkController:rpcEndpointChainDegraded', {
359+
chainId: configuration.chainId,
360+
networkClientId: id,
361+
error,
362+
rpcMethodName,
363+
duration,
364+
traceId,
365+
type,
366+
retryReason:
367+
error === undefined ? undefined : classifyRetryReason(error),
368+
});
369+
},
370+
);
368371

369372
rpcServiceChain.onServiceDegraded(
370373
({

packages/network-controller/src/rpc-service/rpc-service-requestable.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ export type RpcServiceRequestable = {
6565
onDegraded(
6666
listener: CockatielEventToEventListenerWithData<
6767
ServicePolicy['onDegraded'],
68-
{ endpointUrl: string; rpcMethodName: string; duration?: number; traceId?: string }
68+
{
69+
endpointUrl: string;
70+
rpcMethodName: string;
71+
duration?: number;
72+
traceId?: string;
73+
}
6974
>,
7075
): ReturnType<ServicePolicy['onDegraded']>;
7176

0 commit comments

Comments
 (0)