Update WithdrawReasons to match substrate (#865)

* Update WithdrawReasons to match substrate

* Linting, comment alignment
This commit is contained in:
Xiliang Chen
2019-05-03 10:16:16 +02:00
committed by Jaco Greeff
parent 52414d9dd1
commit 91341e63ae
+10 -2
View File
@@ -10,11 +10,12 @@ import Set from '../codec/Set';
* The Substrate WithdrawReasons for staking
*/
export default class WithdrawReasons extends Set {
constructor (value: any = ['header', 'body', 'justification']) {
constructor (value: any = []) {
super({
TransactionPayment: 0b00000001,
Transfer: 0b00000010,
Reserve: 0b00000100
Reserve: 0b00000100,
Fee: 0b00001000
}, value);
}
@@ -38,4 +39,11 @@ export default class WithdrawReasons extends Set {
get isTransfer (): boolean {
return this.values.includes('Transfer');
}
/**
* @description /// In order to pay some other (higher-level) fees.
*/
get isFee (): boolean {
return this.values.includes('Fee');
}
}