From 91341e63ae4ab83b4fc86ceb7f7ce80037474aee Mon Sep 17 00:00:00 2001 From: Xiliang Chen Date: Fri, 3 May 2019 20:16:16 +1200 Subject: [PATCH] Update WithdrawReasons to match substrate (#865) * Update WithdrawReasons to match substrate * Linting, comment alignment --- packages/types/src/type/WithdrawReasons.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/types/src/type/WithdrawReasons.ts b/packages/types/src/type/WithdrawReasons.ts index 5a868ba043..b5e6389e40 100644 --- a/packages/types/src/type/WithdrawReasons.ts +++ b/packages/types/src/type/WithdrawReasons.ts @@ -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'); + } }