Support case where post sender is the only author
This commit is contained in:
parent
21a0ef6bda
commit
7eddd66385
|
@ -113,10 +113,12 @@ export class ValidationPool extends ReputationHolder {
|
|||
throw new Error(`Each citation magnitude must not exceed revaluation limit ${params.revaluationLimit}`);
|
||||
}
|
||||
|
||||
const totalAuthorWeight = (post.authors ?? []).reduce((total, { weight }) => total += weight, 0);
|
||||
if (post.authors?.length) {
|
||||
const totalAuthorWeight = post.authors.reduce((total, { weight }) => total += weight, 0);
|
||||
if (totalAuthorWeight !== 1) {
|
||||
throw new Error(`Total author weight ${totalAuthorWeight} !== 1`);
|
||||
}
|
||||
}
|
||||
|
||||
this.state = ValidationPoolStates.OPEN;
|
||||
this.setStatus('Open');
|
||||
|
|
Loading…
Reference in New Issue