web/multinode: fix wrong undistributed payout amount
Resolves https://github.com/storj/storj/issues/5849 Change-Id: I074f6ca9f9ac1e8ffa62649188a6059d9bcd4c25
This commit is contained in:
parent
162af1e836
commit
8a206f0aee
@ -4,6 +4,11 @@
|
|||||||
import { Operators as OperatorsClient } from '@/api/operators';
|
import { Operators as OperatorsClient } from '@/api/operators';
|
||||||
import { Cursor, Page } from '@/private/pagination';
|
import { Cursor, Page } from '@/private/pagination';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Divider to convert payout amounts to cents.
|
||||||
|
*/
|
||||||
|
const PRICE_DIVIDER = 10000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Operator contains contains SNO payouts contact details and amount of undistributed payouts.
|
*Operator contains contains SNO payouts contact details and amount of undistributed payouts.
|
||||||
*/
|
*/
|
||||||
@ -14,7 +19,9 @@ export class Operator {
|
|||||||
public wallet: string,
|
public wallet: string,
|
||||||
public walletFeatures: string[] | null,
|
public walletFeatures: string[] | null,
|
||||||
public undistributed: number,
|
public undistributed: number,
|
||||||
) {}
|
) {
|
||||||
|
this.undistributed = this.convertToCents(this.undistributed);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* indicates if wallet features are enabled.
|
* indicates if wallet features are enabled.
|
||||||
@ -38,6 +45,10 @@ export class Operator {
|
|||||||
// TODO: place this to config.
|
// TODO: place this to config.
|
||||||
return `https://zkscan.io/explorer/accounts/${this.wallet}`;
|
return `https://zkscan.io/explorer/accounts/${this.wallet}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private convertToCents(value: number): number {
|
||||||
|
return value / PRICE_DIVIDER;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -167,5 +167,10 @@ export class Expectation {
|
|||||||
public currentMonthEstimation: number = 0,
|
public currentMonthEstimation: number = 0,
|
||||||
public undistributed: number = 0,
|
public undistributed: number = 0,
|
||||||
) {
|
) {
|
||||||
|
this.undistributed = this.convertToCents(this.undistributed);
|
||||||
|
}
|
||||||
|
|
||||||
|
private convertToCents(value: number): number {
|
||||||
|
return value / PRICE_DIVIDER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user