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
7fd82df7
Commit
7fd82df7
authored
2 years ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
remove unused sandbox screen
parent
6d55b551
No related branches found
No related tags found
No related merge requests found
Pipeline
#16748
waiting for manual action
Stage: format
Stage: build_and_test
Stage: package
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/providers/substrate_sdk.dart
+0
-33
0 additions, 33 deletions
lib/providers/substrate_sdk.dart
lib/screens/substrate_sandbox.dart
+0
-178
0 additions, 178 deletions
lib/screens/substrate_sandbox.dart
with
0 additions
and
211 deletions
lib/providers/substrate_sdk.dart
+
0
−
33
View file @
7fd82df7
...
@@ -79,20 +79,6 @@ class SubstrateSdk with ChangeNotifier {
...
@@ -79,20 +79,6 @@ class SubstrateSdk with ChangeNotifier {
////////// 2: GET ONCHAIN STORAGE //////////
////////// 2: GET ONCHAIN STORAGE //////////
////////////////////////////////////////////
////////////////////////////////////////////
Future
<
List
<
AddressInfo
>>
getKeyStoreAddress
()
async
{
List
<
AddressInfo
>
result
=
[];
for
(
var
element
in
keyring
.
allAccounts
)
{
final
account
=
AddressInfo
(
address:
element
.
address
);
final
globalBalance
=
await
getBalance
(
element
.
address
!
);
account
.
balance
=
globalBalance
[
'transferableBalance'
]
!
;
result
.
add
(
account
);
}
return
result
;
}
Future
<
int
>
getIdentityIndexOf
(
String
address
)
async
{
Future
<
int
>
getIdentityIndexOf
(
String
address
)
async
{
return
await
getStorage
(
'identity.identityIndexOf("
$address
")'
)
??
0
;
return
await
getStorage
(
'identity.identityIndexOf("
$address
")'
)
??
0
;
}
}
...
@@ -233,25 +219,6 @@ class SubstrateSdk with ChangeNotifier {
...
@@ -233,25 +219,6 @@ class SubstrateSdk with ChangeNotifier {
return
await
idtyStatus
(
address
)
==
'Validated'
;
return
await
idtyStatus
(
address
)
==
'Validated'
;
}
}
Future
<
String
>
getMemberAddress
()
async
{
// TODOO: Continue digging memberAddress detection
String
memberAddress
=
''
;
walletBox
.
toMap
()
.
forEach
((
key
,
value
)
async
{
final
bool
isMember
=
await
isMemberGet
(
value
.
address
!
);
log
.
d
(
isMember
);
if
(
isMember
)
{
final
currentChestNumber
=
configBox
.
get
(
'currentChest'
);
ChestData
newChestData
=
chestBox
.
get
(
currentChestNumber
)
!
;
newChestData
.
memberWallet
=
value
.
number
;
await
chestBox
.
put
(
currentChestNumber
,
newChestData
);
memberAddress
=
value
.
address
!
;
return
;
}
});
log
.
d
(
memberAddress
);
return
memberAddress
;
}
Future
<
Map
<
String
,
int
>>
certState
(
String
from
,
String
to
)
async
{
Future
<
Map
<
String
,
int
>>
certState
(
String
from
,
String
to
)
async
{
Map
<
String
,
int
>
result
=
{};
Map
<
String
,
int
>
result
=
{};
if
(
from
!=
to
&&
await
isMemberGet
(
from
))
{
if
(
from
!=
to
&&
await
isMemberGet
(
from
))
{
...
...
This diff is collapsed.
Click to expand it.
lib/screens/substrate_sandbox.dart
deleted
100644 → 0
+
0
−
178
View file @
6d55b551
// ignore_for_file: use_build_context_synchronously
import
'package:flutter/material.dart'
;
import
'package:gecko/globals.dart'
;
import
'package:gecko/models/stateful_wrapper.dart'
;
import
'package:gecko/providers/substrate_sdk.dart'
;
import
'package:provider/provider.dart'
;
class
SubstrateSandBox
extends
StatelessWidget
{
const
SubstrateSandBox
({
Key
?
key
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
// SubstrateSdk _sub = Provider.of<SubstrateSdk>(context, listen: false);
return
StatefulWrapper
(
onInit:
()
async
{
// if (!_sub.sdkReady && !_sub.sdkLoading) await _sub.initApi();
// if (_sub.sdkReady && !_sub.nodeConnected) await _sub.connectNode();
},
child:
Scaffold
(
appBar:
AppBar
(
toolbarHeight:
60
*
ratio
,
title:
const
SizedBox
(
height:
22
,
child:
Text
(
'⏳ Substrate Sandbox'
),
),
),
body:
SafeArea
(
child:
Consumer
<
SubstrateSdk
>(
builder:
(
context
,
sub
,
_
)
{
return
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
Text
(
'js-api chargé ?:
${sub.sdkReady}
'
),
InkWell
(
onTap:
()
async
{
await
sub
.
connectNode
(
context
);
},
child:
Text
(
'🌐 Noeud connecté ?:
${sub.nodeConnected}
(
${sub.sdk.api.connectedNode?.endpoint}
)'
)),
if
(
sub
.
nodeConnected
)
Text
(
'🏆 Noeud "
$currencyName
", bloc N°
${sub.blocNumber}
'
),
const
SizedBox
(
height:
20
),
Row
(
children:
[
const
Text
(
'💳 Liste des coffres:'
),
const
Spacer
(),
InkWell
(
child:
Image
.
asset
(
'assets/walletOptions/trash.png'
,
height:
35
,
),
onTap:
()
async
{
await
sub
.
deleteAllAccounts
();
sub
.
reload
();
},
),
const
SizedBox
(
width:
10
),
]),
FutureBuilder
(
future:
sub
.
getKeyStoreAddress
(),
builder:
(
BuildContext
context
,
AsyncSnapshot
<
List
<
AddressInfo
>>
data
)
{
return
Column
(
children:
[
if
(
data
.
data
!=
null
)
for
(
final
AddressInfo
addressInfo
in
data
.
data
!
)
Row
(
children:
[
InkWell
(
onTap:
()
=
>
sub
.
keyring
.
setCurrent
(
sub
.
keyring
.
keyPairs
.
firstWhere
((
element
)
=
>
element
.
address
==
addressInfo
.
address
!
)),
child:
Text
(
getShortPubkey
(
addressInfo
.
address
!
),
style:
const
TextStyle
(
fontFamily:
'Monospace'
),
),
),
const
SizedBox
(
width:
20
),
// InkWell(
// onTap: () async => await _sub.pay(
// context,
// addressInfo.address!,
// 10,
// _sub.keystorePassword.text),
// child:
Text
(
"
${addressInfo.balance.toString()}
$currencyName
"
),
// ),
const
SizedBox
(
width:
20
),
InkWell
(
onTap:
()
async
=
>
await
sub
.
derive
(
context
,
addressInfo
.
address
!
,
2
,
sub
.
keystorePassword
.
text
),
child:
const
Text
(
"🏂 Dériver"
),
)
])
]);
}),
const
SizedBox
(
height:
20
),
const
Text
(
'🔒 Mot de passe du coffre:'
),
TextField
(
controller:
sub
.
keystorePassword
,
obscureText:
true
,
obscuringCharacter:
'•'
,
enableSuggestions:
false
,
autocorrect:
false
,
onChanged:
(
_
)
=
>
sub
.
reload
(),
),
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
const
SizedBox
(
height:
20
,
width:
double
.
infinity
),
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
primary:
yellowC
,
// background
onPrimary:
Colors
.
black
,
// foreground
),
onPressed:
sub
.
keystorePassword
.
text
.
isNotEmpty
?
()
async
{
final
res
=
await
sub
.
importAccount
();
sub
.
importIsLoading
=
false
;
sub
.
reload
();
snack
(
context
,
res
!=
''
?
'Portefeuille importé'
:
'Le format de coffre est invalide'
);
}
:
null
,
child:
const
Text
(
'📎 Importer depuis le presse-papier'
,
style:
TextStyle
(
fontSize:
20
),
),
),
if
(
sub
.
importIsLoading
)
const
CircularProgressIndicator
(),
const
SizedBox
(
height:
20
),
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
primary:
yellowC
,
// background
onPrimary:
Colors
.
black
,
// foreground
),
onPressed:
()
async
{
await
sub
.
generateMnemonic
();
sub
.
importIsLoading
=
false
;
sub
.
reload
();
snack
(
context
,
'Le mnemonic a été copié'
);
},
child:
const
Text
(
"🏦 Générer un mnemonic et le copier"
,
style:
TextStyle
(
fontSize:
20
),
),
),
const
SizedBox
(
height:
10
),
SizedBox
(
width:
400
,
child:
Text
(
sub
.
generatedMnemonic
,
textAlign:
TextAlign
.
center
,
),
),
const
Text
(
'-〰️---〰️---〰️-'
),
const
SizedBox
(
height:
10
),
Text
(
sub
.
debugConnection
)
])
]),
);
}),
),
),
);
}
}
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