Ovreride toJSON on {Header, ReferendumInfo}Extended (#723)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user