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
c58d859d
Commit
c58d859d
authored
2 years ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
fix: Use _removableOn instead of _renewableOn for certification renewale delay (
#13
)
parent
fd9467ef
No related branches found
No related tags found
No related merge requests found
Pipeline
#16359
waiting for manual action
Stage: format
Stage: build_and_test
Stage: package
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config/gdev_endpoints.json
+0
-1
0 additions, 1 deletion
config/gdev_endpoints.json
lib/providers/substrate_sdk.dart
+9
-21
9 additions, 21 deletions
lib/providers/substrate_sdk.dart
pubspec.yaml
+1
-1
1 addition, 1 deletion
pubspec.yaml
with
10 additions
and
23 deletions
config/gdev_endpoints.json
+
0
−
1
View file @
c58d859d
...
@@ -2,5 +2,4 @@
...
@@ -2,5 +2,4 @@
"wss://gdev.librelois.fr/ws"
,
"wss://gdev.librelois.fr/ws"
,
"wss://gdev.1000i100.fr/ws"
,
"wss://gdev.1000i100.fr/ws"
,
"wss://gdev.komun.org/ws"
"wss://gdev.komun.org/ws"
]
]
This diff is collapsed.
Click to expand it.
lib/providers/substrate_sdk.dart
+
9
−
21
View file @
c58d859d
...
@@ -524,7 +524,7 @@ class SubstrateSdk with ChangeNotifier {
...
@@ -524,7 +524,7 @@ class SubstrateSdk with ChangeNotifier {
if
(
idtyStatus
!=
null
)
{
if
(
idtyStatus
!=
null
)
{
final
String
_status
=
idtyStatus
[
'status'
];
final
String
_status
=
idtyStatus
[
'status'
];
log
.
d
(
'Status
$address
:
$_status
'
);
//
log.d('Status $address: $_status');
return
(
_status
);
return
(
_status
);
}
else
{
}
else
{
return
'expired'
;
return
'expired'
;
...
@@ -605,40 +605,28 @@ class SubstrateSdk with ChangeNotifier {
...
@@ -605,40 +605,28 @@ class SubstrateSdk with ChangeNotifier {
}
}
Future
<
Map
<
String
,
int
>>
certState
(
String
from
,
String
to
)
async
{
Future
<
Map
<
String
,
int
>>
certState
(
String
from
,
String
to
)
async
{
//
String
from = await getMemberAddress()
;
Map
<
String
,
int
>
_result
=
{}
;
if
(
from
!=
to
&&
await
isMember
(
from
))
{
if
(
from
!=
to
&&
await
isMember
(
from
))
{
Map
<
String
,
int
>
_result
=
{};
final
_certData
=
await
getCertData
(
from
,
to
);
final
_certData
=
await
getCertData
(
from
,
to
);
final
_certMeta
=
await
getCertMeta
(
from
);
final
_certMeta
=
await
getCertMeta
(
from
);
final
int
_removableOn
=
_certData
[
'removableOn'
]
??
0
;
final
int
_removableOn
=
_certData
[
'removableOn'
]
??
0
;
final
int
_renewableOn
=
_certData
[
'renewableOn'
]
??
0
;
final
int
_nextIssuableOn
=
_certMeta
[
'nextIssuableOn'
]
??
0
;
final
int
_nextIssuableOn
=
_certMeta
[
'nextIssuableOn'
]
??
0
;
//TODO: use _removableOn instead of _renewableOn
final
certRemovableDuration
=
(
_removableOn
-
blocNumber
)
*
6
;
log
.
d
(
_renewableOn
.
toString
()
+
const
int
renewDelay
=
2
*
30
*
24
*
3600
;
// 2 months
'
\n
'
+
_removableOn
.
toString
()
+
if
(
certRemovableDuration
>
=
renewDelay
)
{
'
\n
'
+
final
certRenewDuration
=
certRemovableDuration
-
renewDelay
;
_nextIssuableOn
.
toString
());
if
(
_renewableOn
!=
0
)
{
final
certRenewDuration
=
(
_renewableOn
-
blocNumber
)
*
6
;
_result
.
putIfAbsent
(
'certRenewable'
,
()
=
>
certRenewDuration
);
_result
.
putIfAbsent
(
'certRenewable'
,
()
=
>
certRenewDuration
);
return
_result
;
}
else
if
(
_nextIssuableOn
>
blocNumber
)
{
}
else
if
(
_nextIssuableOn
>
blocNumber
)
{
final
certDelayDuration
=
(
_nextIssuableOn
-
blocNumber
)
*
6
;
final
certDelayDuration
=
(
_nextIssuableOn
-
blocNumber
)
*
6
;
_result
.
putIfAbsent
(
'certDelay'
,
()
=
>
certDelayDuration
);
_result
.
putIfAbsent
(
'certDelay'
,
()
=
>
certDelayDuration
);
return
_result
;
}
else
{
}
else
{
_result
.
putIfAbsent
(
'canCert'
,
()
=
>
0
);
_result
.
putIfAbsent
(
'canCert'
,
()
=
>
0
);
return
_result
;
}
}
}
}
return
{}
;
return
_result
;
}
}
// Future<String> certState(String from, String to) async {
// return '';
// }
Future
<
Map
>
getCertMeta
(
String
address
)
async
{
Future
<
Map
>
getCertMeta
(
String
address
)
async
{
var
idtyIndex
=
await
sdk
.
webView
!
var
idtyIndex
=
await
sdk
.
webView
!
.
evalJavascript
(
'api.query.identity.identityIndexOf("
$address
")'
);
.
evalJavascript
(
'api.query.identity.identityIndexOf("
$address
")'
);
...
@@ -648,7 +636,7 @@ class SubstrateSdk with ChangeNotifier {
...
@@ -648,7 +636,7 @@ class SubstrateSdk with ChangeNotifier {
''
;
''
;
// if (_certMeta['nextIssuableOn'] != 0) return {};
// if (_certMeta['nextIssuableOn'] != 0) return {};
log
.
d
(
_certMeta
);
//
log.d(_certMeta);
return
_certMeta
;
return
_certMeta
;
}
}
...
...
This diff is collapsed.
Click to expand it.
pubspec.yaml
+
1
−
1
View file @
c58d859d
...
@@ -5,7 +5,7 @@ description: Pay with G1.
...
@@ -5,7 +5,7 @@ description: Pay with G1.
# pub.dev using `pub publish`. This is preferred for private packages.
# 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
publish_to
:
'
none'
# Remove this line if you wish to publish to pub.dev
version
:
0.0.9+1
2
version
:
0.0.9+1
3
environment
:
environment
:
sdk
:
'
>=2.12.0
<3.0.0'
sdk
:
'
>=2.12.0
<3.0.0'
...
...
This diff is collapsed.
Click to expand it.
poka
@pokapow
mentioned in issue
#13 (closed)
·
2 years ago
mentioned in issue
#13 (closed)
mentioned in issue #13
Toggle commit list
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