-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Method calls | ||
* | ||
* set_claim_permission | ||
* claim_payout_other | ||
* set_commission | ||
* set_commision_max | ||
* set_commission_change_rate | ||
* claim_commission | ||
*/ |
24 changes: 24 additions & 0 deletions
24
packages/txwrapper-substrate/src/methods/nominationPools/bondExtraOther.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { | ||
itHasCorrectBaseTxInfo, | ||
KUSAMA_TEST_OPTIONS, | ||
TEST_BASE_TX_INFO, | ||
} from '@substrate/txwrapper-dev'; | ||
|
||
import { TEST_METHOD_ARGS } from '../../test-helpers'; | ||
import { bondExtraOther } from './bondExtraOther'; | ||
|
||
describe('nominationPools::bondExtraOther', () => { | ||
it('should work', () => { | ||
const unsigned = bondExtraOther( | ||
TEST_METHOD_ARGS.nominationPools.bondExtraOther, | ||
TEST_BASE_TX_INFO, | ||
KUSAMA_TEST_OPTIONS | ||
); | ||
|
||
itHasCorrectBaseTxInfo(unsigned); | ||
|
||
expect(unsigned.method).toBe( | ||
'0x290e00d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0040420f00000000000000000000000000' | ||
); | ||
}); | ||
}); |
49 changes: 49 additions & 0 deletions
49
packages/txwrapper-substrate/src/methods/nominationPools/bondExtraOther.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { | ||
BaseTxInfo, | ||
defineMethod, | ||
OptionsWithMeta, | ||
UnsignedTransaction, | ||
} from '@substrate/txwrapper-core'; | ||
|
||
import { NominationPoolsBondExtra } from './bondExtra'; | ||
|
||
export interface NominationPoolsBondExtraOther | ||
extends NominationPoolsBondExtra { | ||
/** | ||
* AccountId. | ||
*/ | ||
member: string; | ||
} | ||
|
||
/** | ||
* `origin` bonds funds from `extra` for some pool member `member` into their respective | ||
* pools. | ||
* | ||
* `origin` can bond extra funds from free balance or pending rewards when `origin == | ||
* other`. | ||
* | ||
* In the case of `origin != other`, `origin` can only bond extra pending rewards of | ||
* `other` members assuming set_claim_permission for the given member is | ||
* `PermissionlessAll` or `PermissionlessCompound`. | ||
* | ||
* @param args - Arguments specific to this method. | ||
* @param info - Information required to construct the transaction. | ||
* @param options - Registry and metadata used for constructing the method. | ||
*/ | ||
export function bondExtraOther( | ||
args: NominationPoolsBondExtraOther, | ||
info: BaseTxInfo, | ||
options: OptionsWithMeta | ||
): UnsignedTransaction { | ||
return defineMethod( | ||
{ | ||
method: { | ||
args, | ||
name: 'bondExtraOther', | ||
pallet: 'nominationPools', | ||
}, | ||
...info, | ||
}, | ||
options | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters