Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ğecko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
Ğecko
Commits
f46acb23
Commit
f46acb23
authored
2 years ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
setSender methode
parent
54999657
No related branches found
No related tags found
1 merge request
!29
Revocation mechanisme
Pipeline
#17059
waiting for manual action
Stage: format
Stage: build_and_test
Stage: package
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/providers/substrate_sdk.dart
+6
-37
6 additions, 37 deletions
lib/providers/substrate_sdk.dart
lib/screens/myWallets/manage_membership.dart
+42
-33
42 additions, 33 deletions
lib/screens/myWallets/manage_membership.dart
with
48 additions
and
70 deletions
lib/providers/substrate_sdk.dart
+
6
−
37
View file @
f46acb23
...
@@ -662,13 +662,9 @@ class SubstrateSdk with ChangeNotifier {
...
@@ -662,13 +662,9 @@ class SubstrateSdk with ChangeNotifier {
required
double
amount
,
required
double
amount
,
required
String
password
})
async
{
required
String
password
})
async
{
transactionStatus
=
''
;
transactionStatus
=
''
;
final
fromPubkey
=
await
sdk
.
api
.
account
.
decodeAddress
([
fromAddress
]);
final
int
amountUnit
=
(
amount
*
100
)
.
toInt
();
final
int
amountUnit
=
(
amount
*
100
)
.
toInt
();
final
sender
=
TxSenderData
(
final
sender
=
await
_setSender
(
fromAddress
);
fromAddress
,
fromPubkey
!.
keys
.
first
,
);
final
globalBalance
=
await
getBalance
(
fromAddress
);
final
globalBalance
=
await
getBalance
(
fromAddress
);
TxInfoData
txInfo
;
TxInfoData
txInfo
;
...
@@ -761,29 +757,9 @@ class SubstrateSdk with ChangeNotifier {
...
@@ -761,29 +757,9 @@ class SubstrateSdk with ChangeNotifier {
return
await
_executeCall
(
txInfo
,
txOptions
,
password
,
rawParams
);
return
await
_executeCall
(
txInfo
,
txOptions
,
password
,
rawParams
);
}
}
// Future claimUDs(String password) async {
// final sender = TxSenderData(
// keyring.current.address,
// keyring.current.pubKey,
// );
// final txInfo = TxInfoData(
// 'universalDividend',
// 'claimUds',
// sender,
// );
// return await executeCall(txInfo, [], password);
// }
Future
<
String
>
confirmIdentity
(
Future
<
String
>
confirmIdentity
(
String
fromAddress
,
String
name
,
String
password
)
async
{
String
fromAddress
,
String
name
,
String
password
)
async
{
final
fromPubkey
=
await
sdk
.
api
.
account
.
decodeAddress
([
fromAddress
]);
final
sender
=
await
_setSender
(
fromAddress
);
final
sender
=
TxSenderData
(
fromAddress
,
fromPubkey
!.
keys
.
first
,
);
final
txInfo
=
TxInfoData
(
final
txInfo
=
TxInfoData
(
'identity'
,
'identity'
,
...
@@ -803,11 +779,7 @@ class SubstrateSdk with ChangeNotifier {
...
@@ -803,11 +779,7 @@ class SubstrateSdk with ChangeNotifier {
required
Map
fromBalance
,
required
Map
fromBalance
,
bool
withBalance
=
false
})
async
{
bool
withBalance
=
false
})
async
{
transactionStatus
=
''
;
transactionStatus
=
''
;
final
fromPubkey
=
await
sdk
.
api
.
account
.
decodeAddress
([
fromAddress
]);
final
sender
=
await
_setSender
(
fromAddress
);
final
sender
=
TxSenderData
(
fromAddress
,
fromPubkey
!.
keys
.
first
,
);
TxInfoData
txInfo
;
TxInfoData
txInfo
;
List
txOptions
=
[];
List
txOptions
=
[];
...
@@ -871,16 +843,13 @@ newKeySig: $newKeySig""");
...
@@ -871,16 +843,13 @@ newKeySig: $newKeySig""");
Future
revokeIdentity
(
String
address
,
String
password
)
async
{
Future
revokeIdentity
(
String
address
,
String
password
)
async
{
final
idtyIndex
=
await
_getIdentityIndexOf
(
address
);
final
idtyIndex
=
await
_getIdentityIndexOf
(
address
);
final
sender
=
TxSenderData
(
final
sender
=
await
_setSender
(
address
);
keyring
.
current
.
address
,
keyring
.
current
.
pubKey
,
);
TxInfoData
txInfo
;
TxInfoData
txInfo
;
txInfo
=
TxInfoData
(
txInfo
=
TxInfoData
(
'
membership
'
,
'
identity
'
,
'revoke
Membership
'
,
'revoke
Identity
'
,
sender
,
sender
,
);
);
...
...
This diff is collapsed.
Click to expand it.
lib/screens/myWallets/manage_membership.dart
+
42
−
33
View file @
f46acb23
// ignore_for_file: use_build_context_synchronously
import
'package:easy_localization/easy_localization.dart'
;
import
'package:easy_localization/easy_localization.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:gecko/globals.dart'
;
import
'package:gecko/globals.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:gecko/models/wallet_data.dart'
;
import
'package:gecko/models/widgets_keys.dart'
;
import
'package:gecko/models/widgets_keys.dart'
;
import
'package:gecko/providers/my_wallets.dart'
;
import
'package:gecko/providers/substrate_sdk.dart'
;
import
'package:gecko/screens/common_elements.dart'
;
import
'package:gecko/screens/myWallets/migrate_identity.dart'
;
import
'package:gecko/screens/myWallets/migrate_identity.dart'
;
import
'package:gecko/screens/myWallets/unlocking_wallet.dart'
;
import
'package:gecko/screens/transaction_in_progress.dart'
;
import
'package:provider/provider.dart'
;
// import 'package:gecko/models/wallet_data.dart';
// import 'package:gecko/models/wallet_data.dart';
// import 'package:gecko/providers/my_wallets.dart';
// import 'package:gecko/providers/my_wallets.dart';
// import 'package:gecko/providers/substrate_sdk.dart';
// import 'package:gecko/providers/substrate_sdk.dart';
...
@@ -68,43 +77,43 @@ class ManageMembership extends StatelessWidget {
...
@@ -68,43 +77,43 @@ class ManageMembership extends StatelessWidget {
key:
keyRevokeIdty
,
key:
keyRevokeIdty
,
onTap:
()
async
{
onTap:
()
async
{
// TODOO: Generate revoke document, and understand extrinsic identity.revokeIdentity options
// TODOO: Generate revoke document, and understand extrinsic identity.revokeIdentity options
//
final
_
answer = await confirmPopup(context,
final
answer
=
await
confirmPopup
(
context
,
//
'Êtes-vous certains de vouloir révoquer définitivement cette identité ?') ??
'Êtes-vous certains de vouloir révoquer définitivement cette identité ?'
)
??
//
false;
false
;
//
if (
_
answer) {
if
(
answer
)
{
//
MyWalletsProvider
_
myWalletProvider =
MyWalletsProvider
myWalletProvider
=
//
Provider.of<MyWalletsProvider>(context, listen: false);
Provider
.
of
<
MyWalletsProvider
>(
context
,
listen:
false
);
//
SubstrateSdk
_
sub = Provider.of<SubstrateSdk>(context, listen: false);
SubstrateSdk
sub
=
Provider
.
of
<
SubstrateSdk
>(
context
,
listen:
false
);
//
MyWalletsProvider
_
mw = MyWalletsProvider();
MyWalletsProvider
mw
=
MyWalletsProvider
();
//
final
_
wallet =
_
mw.getWalletDataByAddress(address);
final
wallet
=
mw
.
getWalletDataByAddress
(
address
);
//
await
_
sub.setCurrentWallet(
_
wallet!);
await
sub
.
setCurrentWallet
(
wallet
!
);
//
WalletData? defaultWallet =
_
myWalletProvider.getDefaultWallet();
WalletData
?
defaultWallet
=
myWalletProvider
.
getDefaultWallet
();
//
String?
_
pin;
String
?
pin
;
//
if (
_
myWalletProvider.pinCode == '') {
if
(
myWalletProvider
.
pinCode
==
''
)
{
//
_
pin = await Navigator.push(
pin
=
await
Navigator
.
push
(
//
context,
context
,
//
MaterialPageRoute(
MaterialPageRoute
(
//
builder: (homeContext) {
builder:
(
homeContext
)
{
//
return UnlockingWallet(wallet: defaultWallet);
return
UnlockingWallet
(
wallet:
defaultWallet
);
//
},
},
//
),
),
//
);
);
//
}
}
//
if (
_
pin != null ||
_
myWalletProvider.pinCode != '') {
if
(
pin
!=
null
||
myWalletProvider
.
pinCode
!=
''
)
{
//
_
sub.revokeIdentity(address,
_
myWalletProvider.pinCode);
sub
.
revokeIdentity
(
address
,
myWalletProvider
.
pinCode
);
//
}
}
//
Navigator.pop(context);
Navigator
.
pop
(
context
);
//
Navigator.push(
Navigator
.
push
(
//
context,
context
,
//
MaterialPageRoute(builder: (context) {
MaterialPageRoute
(
builder:
(
context
)
{
//
return const TransactionInProgress(transType: 'revokeIdty');
return
const
TransactionInProgress
(
transType:
'revokeIdty'
);
//
}),
}),
//
);
);
//
}
}
},
},
child:
SizedBox
(
child:
SizedBox
(
height:
60
,
height:
60
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment