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
a88034b2
Commit
a88034b2
authored
2 years ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
Use certsByReceiver to gets certValidityPeriod instead of obsolete certsByReceiver call
parent
81772f92
No related branches found
No related tags found
1 merge request
!26
Features gdev2
Pipeline
#16676
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
+13
-11
13 additions, 11 deletions
lib/providers/substrate_sdk.dart
lib/screens/wallet_view.dart
+3
-0
3 additions, 0 deletions
lib/screens/wallet_view.dart
with
16 additions
and
11 deletions
lib/providers/substrate_sdk.dart
+
13
−
11
View file @
a88034b2
...
...
@@ -257,21 +257,24 @@ class SubstrateSdk with ChangeNotifier {
return
[
certsReceiver
[
'receivedCount'
],
certsReceiver
[
'issuedCount'
]];
}
Future
<
Map
>
getCert
Data
(
String
from
,
String
to
)
async
{
Future
<
int
>
getCert
ValidityPeriod
(
String
from
,
String
to
)
async
{
final
idtyIndexFrom
=
await
getIdentityIndexOf
(
from
);
final
idtyIndexTo
=
await
getIdentityIndexOf
(
to
);
if
(
idtyIndexFrom
==
0
||
idtyIndexTo
==
0
)
return
{}
;
if
(
idtyIndexFrom
==
0
||
idtyIndexTo
==
0
)
return
0
;
final
certData
=
await
sdk
.
webView
!
.
evalJavascript
(
'api.query.cert.storageCertsByIssuer(
$idtyIndexFrom
,
$idtyIndexTo
)'
)
??
''
;
final
List
certData
=
await
sdk
.
webView
!
.
evalJavascript
(
'api.query.cert.certsByReceiver(
$idtyIndexTo
)'
)
??
[]
;
if
(
certData
==
''
)
return
{};
if
(
certData
.
isEmpty
)
return
0
;
for
(
List
certInfo
in
certData
)
{
if
(
certInfo
[
0
]
==
idtyIndexFrom
)
{
return
certInfo
[
1
];
}
}
// log.d(_certData);
return
certData
;
return
0
;
}
Future
<
Map
<
String
,
dynamic
>>
getParameters
()
async
{
...
...
@@ -666,9 +669,8 @@ class SubstrateSdk with ChangeNotifier {
Future
<
Map
<
String
,
int
>>
certState
(
String
from
,
String
to
)
async
{
Map
<
String
,
int
>
result
=
{};
if
(
from
!=
to
&&
await
isMemberGet
(
from
))
{
final
certData
=
await
getCert
Data
(
from
,
to
);
final
removableOn
=
await
getCert
ValidityPeriod
(
from
,
to
);
final
certMeta
=
await
getCertMeta
(
from
);
final
int
removableOn
=
certData
[
'removableOn'
]
??
0
;
final
int
nextIssuableOn
=
certMeta
[
'nextIssuableOn'
]
??
0
;
final
certRemovableDuration
=
(
removableOn
-
blocNumber
)
*
6
;
const
int
renewDelay
=
2
*
30
*
24
*
3600
;
// 2 months
...
...
This diff is collapsed.
Click to expand it.
lib/screens/wallet_view.dart
+
3
−
0
View file @
a88034b2
...
...
@@ -129,6 +129,9 @@ class WalletViewScreen extends StatelessWidget {
builder:
(
context
,
AsyncSnapshot
<
Map
<
String
,
int
>>
snapshot
)
{
if
(
snapshot
.
data
==
null
)
return
const
SizedBox
();
String
duration
=
''
;
log
.
d
(
snapshot
.
data
!
[
'certDelay'
]);
log
.
d
(
snapshot
.
data
!
[
'certRenewable'
]);
if
(
snapshot
.
data
!
[
'certDelay'
]
!=
null
||
snapshot
.
data
!
[
'certRenewable'
]
!=
null
)
{
final
Duration
durationSeconds
=
Duration
(
...
...
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