fix: transferAll in batch for identity migration

This commit is contained in:
poka 2022-08-29 20:50:43 +02:00
parent 9301eaf1a7
commit 37dee7f866
1 changed files with 5 additions and 4 deletions

View File

@ -688,7 +688,7 @@ class SubstrateSdk with ChangeNotifier {
); );
const tx1 = 'api.tx.universalDividend.claimUds()'; const tx1 = 'api.tx.universalDividend.claimUds()';
final tx2 = amount == -1 final tx2 = amount == -1
? 'api.tx.balances.transferAll(false)' ? 'api.tx.balances.transferAll("$destAddress", false)'
: 'api.tx.balances.transferKeepAlive("$destAddress", $amountUnit)'; : 'api.tx.balances.transferKeepAlive("$destAddress", $amountUnit)';
rawParams = '[[$tx1, $tx2]]'; rawParams = '[[$tx1, $tx2]]';
@ -851,10 +851,11 @@ newKeySig: $newKeySig""");
const tx1 = 'api.tx.universalDividend.claimUds()'; const tx1 = 'api.tx.universalDividend.claimUds()';
final tx2 = final tx2 =
'api.tx.identity.changeOwnerKey("$destAddress", "$newKeySig")'; 'api.tx.identity.changeOwnerKey("$destAddress", "$newKeySig")';
// const tx3 = 'api.tx.balances.transferAll(false)'; final tx3 = 'api.tx.balances.transferAll("$destAddress", false)';
rawParams = rawParams = fromBalance['unclaimedUds'] == 0
fromBalance['unclaimedUds'] == 0 ? '[[$tx2]]' : '[[$tx1, $tx2]]'; ? '[[$tx2, $tx3]]'
: '[[$tx1, $tx2, $tx3]]';
} else { } else {
txInfo = TxInfoData( txInfo = TxInfoData(
'identity', 'identity',