Ovreride toJSON on {Header, ReferendumInfo}Extended (#723)

This commit is contained in:
Jaco Greeff
2019-02-20 07:33:53 +01:00
committed by GitHub
parent 081f87d11f
commit bf1a4a9e08
2 changed files with 22 additions and 0 deletions
@@ -33,6 +33,16 @@ export class ReferendumInfoExtended extends ReferendumInfo {
get index (): ReferendumIndex {
return this._index;
}
/**
* @description Creates the JSON representation
*/
toJSON (): any {
return {
...super.toJSON(),
index: this.index.toJSON()
};
}
}
export function referendumInfo (api: ApiInterface$Rx) {
+12
View File
@@ -107,4 +107,16 @@ export class HeaderExtended extends Header {
get author (): AccountId | undefined {
return this._author;
}
/**
* @description Creates the JSON representation
*/
toJSON (): any {
return {
...super.toJSON(),
author: this.author
? this.author.toJSON()
: undefined
};
}
}