some small api test fixes

This commit is contained in:
benedettadavico
2023-02-24 14:06:56 +01:00
parent 20c77e6987
commit cd9cdfa5bb
6 changed files with 46 additions and 26 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ common:
Content-Type: application/json
qa:
api_base_url: https://qwerty-validator-api.qa.nymte.ch/api/v1
mix_id: 7
mix_id: 63
identity_key: 4Yr4qmEHd9sgsuQ83191FR2hD88RfsbMmB4tzhhZWriz
gateway_identity: 336yuXAeGEgedRfqTJZsG2YV7P13QH1bHv1SjCZYarc9
log_level: error
+3 -2
View File
@@ -7,6 +7,7 @@ import {
InclusionProbabilities,
InclusionProbability,
NodeHistory,
NoUptime,
Report,
RewardEstimation,
StakeSaturation,
@@ -36,7 +37,7 @@ export default class Status extends APIClient {
return response.data;
}
public async getGatewayHistory(identity_key: string): Promise<NodeHistory> {
public async getGatewayHistory(identity_key: string): Promise<NodeHistory | NoUptime> {
const response = await this.restClient.sendGet({
route: `/gateway/${identity_key}/history`,
});
@@ -111,7 +112,7 @@ export default class Status extends APIClient {
return response.data;
}
public async getMixnodeHistory(mix_id: number): Promise<NodeHistory> {
public async getMixnodeHistory(mix_id: number): Promise<NodeHistory | NoUptime> {
const response = await this.restClient.sendGet({
route: `/mixnode/${mix_id}/history`,
});
+18 -7
View File
@@ -27,13 +27,6 @@ export interface Node {
in_active_set: boolean;
}
export interface RewardEstimation {
estimation: Estimation;
reward_params: RewardParams;
epoch: Epoch;
as_at: number;
}
export interface Estimation {
total_node_reward: string;
operator: string;
@@ -41,6 +34,13 @@ export interface Estimation {
operating_cost: string;
}
export interface RewardEstimation {
estimation: Estimation;
reward_params: RewardParams;
epoch: Epoch;
as_at: number;
}
export interface RewardParams {
interval: Interval;
rewarded_set_size: number;
@@ -129,6 +129,10 @@ export interface NodeHistory {
history: History[];
}
export interface NoUptime {
message: string;
}
export interface CoreCount {
mix_id: number;
identity: string;
@@ -162,9 +166,16 @@ export interface GatewayBond {
proxy?: any;
}
export interface nodePerformance {
most_recent: string;
last_hour: string;
last_24h: string;
}
export interface DetailedGateway {
gateway_bond: GatewayBond;
performance: string;
node_performance: nodePerformance;
}
export interface OriginalPledge {