Skip to content

Commit be76ce9

Browse files
authored
Improve acceptance tests run against remote instances (#244)
* Improve acceptance tests run against remote instances Improve acceptance test runs - Update `rpc.spect.ts` - differentiate logs - increase account1 balance to afford other transactions - log configurations - display test expense - Shorten client logs - Fix missed metric removal logic - Trim `OPERATOR_ID_MAIN` - Add timeout reset on mirror client - add operator balance check Signed-off-by: Nana-EC <[email protected]>
1 parent c7d206c commit be76ce9

File tree

6 files changed

+114
-89
lines changed

6 files changed

+114
-89
lines changed

packages/relay/src/lib/clients/mirrorNodeClient.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class MirrorNodeClient {
142142
try {
143143
const response = await this.client.get(path);
144144
ms = Date.now() - start;
145-
this.logger.debug(`Mirror Node Response: [GET] ${path} ${response.status} ${ms} ms`);
145+
this.logger.debug(`[GET] ${path} ${response.status} ${ms} ms`);
146146
this.mirrorResponseHistogram.labels(pathLabel, response.status).observe(ms);
147147
return response.data;
148148
} catch (error: any) {
@@ -156,12 +156,12 @@ export class MirrorNodeClient {
156156
handleError(error: any, path: string, allowedErrorStatuses?: number[]) {
157157
if (allowedErrorStatuses && allowedErrorStatuses.length) {
158158
if (error.response && allowedErrorStatuses.indexOf(error.response.status) !== -1) {
159-
this.logger.debug(`Mirror Node Response: [GET] ${path} ${error.response.status} status`);
159+
this.logger.debug(`[GET] ${path} ${error.response.status} status`);
160160
return null;
161161
}
162162
}
163163

164-
this.logger.error(new Error(error.message), `Mirror Node Response: [GET] ${path} ${error.response.status} status`);
164+
this.logger.error(new Error(error.message), `[GET] ${path} ${error.response.status} status`);
165165
throw predefined.INTERNAL_ERROR;
166166
}
167167

packages/relay/src/lib/clients/sdkClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class SDKClient {
9292
});
9393

9494
const metricGaugeName = 'rpc_relay_operator_balance';
95-
register.removeSingleMetric(metricHistogramName);
95+
register.removeSingleMetric(metricGaugeName);
9696
this.operatorAccountGauge = new Gauge({
9797
name: metricGaugeName,
9898
help: 'Relay operator balance gauge',

packages/relay/src/lib/relay.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class RelayImpl implements Relay {
119119
default: {
120120
if (process.env.OPERATOR_ID_MAIN && process.env.OPERATOR_KEY_MAIN) {
121121
client = client.setOperator(
122-
AccountId.fromString(process.env.OPERATOR_ID_MAIN),
122+
AccountId.fromString(process.env.OPERATOR_ID_MAIN.trim()),
123123
PrivateKey.fromString(process.env.OPERATOR_KEY_MAIN)
124124
);
125125
}

0 commit comments

Comments
 (0)