Adjust class privates via #, where applicable (#1921)

* Adjust class priates via #, where applicable

* Remove stray log

* Cleanup rpc-provider

* Small adjustments

* No private access in tests

* Submittable privates

* Use derive for nonce derivation

* Tweak observers

* Alphabetical privates
This commit is contained in:
Jaco Greeff
2020-02-22 11:29:50 +01:00
committed by GitHub
parent ccf32a6289
commit 3bf4c3fac5
32 changed files with 406 additions and 514 deletions
@@ -17,12 +17,12 @@ const _Header: Constructor<Header> = Struct.with(runtimeTypes.types.Header as an
* A [[Block]] header with an additional `author` field that indicates the block author
*/
export default class HeaderExtended extends _Header {
private _author?: AccountId;
readonly #author?: AccountId;
constructor (registry: Registry, header?: Header, sessionValidators?: AccountId[]) {
super(registry, header);
this._author = this.extractAuthor(sessionValidators);
this.#author = this.extractAuthor(sessionValidators);
}
private extractAuthor (sessionValidators: AccountId[] = []): AccountId | undefined {
@@ -51,7 +51,7 @@ export default class HeaderExtended extends _Header {
* @description Convenience method, returns the author for the block
*/
public get author (): AccountId | undefined {
return this._author;
return this.#author;
}
/**
@@ -18,12 +18,12 @@ const _ReferendumInfo: Constructor<ReferendumInfo> = Struct.with(democracyTypes.
* A [[ReferendumInfo]] with an additional `index` field
*/
export default class ReferendumInfoExtended extends _ReferendumInfo {
private _index: ReferendumIndex;
readonly #index: ReferendumIndex;
constructor (registry: Registry, value: ReferendumInfo | ReferendumInfoExtended, index?: BN | number) {
super(registry, value);
this._index = value instanceof ReferendumInfoExtended
this.#index = value instanceof ReferendumInfoExtended
? value.index
: createType(registry, 'ReferendumIndex', index);
}
@@ -32,7 +32,7 @@ export default class ReferendumInfoExtended extends _ReferendumInfo {
* @description Convenience getter, returns the referendumIndex
*/
public get index (): ReferendumIndex {
return this._index;
return this.#index;
}
/**