Cleanup assignments (#2811)
* Cleanup assignments * Small adjustments * Cleanup AnyJson results * Event toHuman
This commit is contained in:
@@ -51,9 +51,7 @@ function retrieveProposals (api: ApiInterfaceRx, proposalCount: ProposalIndex, a
|
||||
const count = proposalCount.toNumber();
|
||||
|
||||
for (let index = 0; index < count; index++) {
|
||||
const isApproval = approvalIds.some((id): boolean => id.eqn(index));
|
||||
|
||||
if (!isApproval) {
|
||||
if (!approvalIds.some((id) => id.eqn(index))) {
|
||||
proposalIds.push(api.registry.createType('ProposalIndex', index));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +36,9 @@ export default class HeaderExtended extends _Header {
|
||||
/**
|
||||
* @description Creates a human-friendly JSON representation
|
||||
*/
|
||||
public toHuman (isExtended?: boolean): AnyJson {
|
||||
public toHuman (isExtended?: boolean): Record<string, AnyJson> {
|
||||
return {
|
||||
...super.toHuman(isExtended) as { [index: string]: AnyJson },
|
||||
...super.toHuman(isExtended),
|
||||
author: this.author
|
||||
? this.author.toHuman()
|
||||
: undefined
|
||||
@@ -48,9 +48,9 @@ export default class HeaderExtended extends _Header {
|
||||
/**
|
||||
* @description Creates the JSON representation
|
||||
*/
|
||||
public toJSON (): AnyJson {
|
||||
public toJSON (): Record<string, AnyJson> {
|
||||
return {
|
||||
...super.toJSON() as { [index: string]: AnyJson },
|
||||
...super.toJSON(),
|
||||
author: this.author
|
||||
? this.author.toJSON()
|
||||
: undefined
|
||||
|
||||
@@ -36,9 +36,9 @@ export default class BlockExtended extends _SignedBlock {
|
||||
/**
|
||||
* @description Creates a human-friendly JSON representation
|
||||
*/
|
||||
public toHuman (isExtended?: boolean): AnyJson {
|
||||
public toHuman (isExtended?: boolean): Record<string, AnyJson> {
|
||||
return {
|
||||
...super.toHuman(isExtended) as { [index: string]: AnyJson },
|
||||
...super.toHuman(isExtended),
|
||||
author: this.author
|
||||
? this.author.toHuman()
|
||||
: undefined
|
||||
@@ -48,9 +48,9 @@ export default class BlockExtended extends _SignedBlock {
|
||||
/**
|
||||
* @description Creates the JSON representation
|
||||
*/
|
||||
public toJSON (): AnyJson {
|
||||
public toJSON (): Record<string, AnyJson> {
|
||||
return {
|
||||
...super.toJSON() as { [index: string]: AnyJson },
|
||||
...super.toJSON(),
|
||||
author: this.author
|
||||
? this.author.toJSON()
|
||||
: undefined
|
||||
|
||||
Reference in New Issue
Block a user