Skip to content
Snippets Groups Projects
Commit c487749f authored by poka's avatar poka
Browse files

improve batch meca

parent 2526f382
No related branches found
No related tags found
1 merge request!26Features gdev2
Pipeline #16705 waiting for manual action
......@@ -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,
......
......@@ -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'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment