improve batch meca

This commit is contained in:
poka 2022-08-10 07:18:04 +02:00
parent 2526f382f1
commit c487749f52
2 changed files with 8 additions and 15 deletions

View File

@ -506,6 +506,7 @@ class SubstrateSdk with ChangeNotifier {
keyring.current.pubKey,
);
TxInfoData txInfo;
List txOptions = [];
if (toIdtyStatus == 'noid') {
txInfo = TxInfoData(
@ -513,6 +514,7 @@ class SubstrateSdk with ChangeNotifier {
'createIdentity',
sender,
);
txOptions = [toAddress];
} else if (toIdtyStatus == 'Validated' ||
toIdtyStatus == 'ConfirmedByOwner') {
if (toCerts[0] >= currencyParameters['wotMinCertForMembership'] &&
@ -523,12 +525,17 @@ class SubstrateSdk with ChangeNotifier {
'batchAll',
sender,
);
txOptions = [
'cert.addCert($fromIndex, $toIndex)',
'identity.validateIdentity($toIndex)'
];
} else {
txInfo = TxInfoData(
'cert',
'addCert',
sender,
);
txOptions = [fromIndex, toIndex];
}
} else {
transactionStatus = 'cantBeCert';
@ -539,20 +546,6 @@ class SubstrateSdk with ChangeNotifier {
log.d('Cert action: ${txInfo.call!}');
try {
List txOptions = [];
if (txInfo.call == 'batchAll') {
txOptions = [
'cert.addCert($fromIndex, $toIndex)',
'identity.validateIdentity($toIndex)'
];
} else if (txInfo.call == 'createIdentity') {
txOptions = [toAddress];
} else if (txInfo.call == 'addCert') {
txOptions = [fromIndex, toIndex];
} else {
log.e('TX call is unexpected');
return 'Ğecko says: TX call is unexpected';
}
final hash = await sdk.api.tx
.signAndSend(
txInfo,

View File

@ -5,7 +5,7 @@ description: Pay with G1.
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 0.0.9+16
version: 0.0.9+17
environment:
sdk: '>=2.12.0 <3.0.0'