Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
py-g1-migrator
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tools
py-g1-migrator
Commits
98127adb
Commit
98127adb
authored
2 years ago
by
Hugo Trentesaux
Browse files
Options
Downloads
Patches
Plain Diff
wip
parent
21d5cee7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
custom/smiths.json
+1
-0
1 addition, 0 deletions
custom/smiths.json
lib/functions.py
+18
-13
18 additions, 13 deletions
lib/functions.py
with
19 additions
and
13 deletions
custom/smiths.json
+
1
−
0
View file @
98127adb
...
...
@@ -21,6 +21,7 @@
},
{
"HugoTrentesaux"
:
{
"session_keys"
:
"dummy"
,
"certs_received"
:
[
"elois"
,
"tuxmain"
,
...
...
This diff is collapsed.
Click to expand it.
lib/functions.py
+
18
−
13
View file @
98127adb
...
...
@@ -53,6 +53,8 @@ def get_identities_and_wallets(start_timestamp):
# Get custom identities
custom_identities
=
load_json
(
"
custom/identities.json
"
)
# TODO manage membership expiration
# TODO make sure that index respects order of arrival
# Get identities names by pubkey
for
i
,
idty
in
enumerate
(
idty_data
):
pubkey
=
idty
[
"
key
"
]
...
...
@@ -60,16 +62,12 @@ def get_identities_and_wallets(start_timestamp):
value
=
idty
[
"
value
"
][
0
]
uid
=
value
[
"
uid
"
]
identity_names
[
pubkey
]
=
uid
identities
[
uid
]
=
{
"
index
"
:
i
,
"
owner_key
"
:
address
,
"
balance
"
:
0
,
"
membership_expire_on
"
:
0
,
"
next_cert_issuable_on
"
:
0
,
"
certs_received
"
:
{},
}
# TODO depending if member manage membership expiration
# TODO make sure that index respects order of arrival
# FIXME
if
value
[
"
member
"
]:
membership_expire_on
=
666
else
:
membership_expire_on
=
0
# add address and balance to identity
if
address
not
in
wallets
:
...
...
@@ -80,6 +78,16 @@ def get_identities_and_wallets(start_timestamp):
# (only let simple wallets)
del
wallets
[
address
]
# fill in identity entry
identities
[
uid
]
=
{
"
index
"
:
i
,
"
owner_key
"
:
address
,
"
balance
"
:
balance
,
"
membership_expire_on
"
:
membership_expire_on
,
"
next_cert_issuable_on
"
:
0
,
"
certs_received
"
:
{},
}
# Switch address to custom if exist
if
uid
in
addresses_switches
.
keys
():
identities
[
uid
][
"
owner_key
"
]
=
addresses_switches
[
uid
][
"
v2
"
]
...
...
@@ -87,9 +95,6 @@ def get_identities_and_wallets(start_timestamp):
addresses_switches
[
uid
][
"
v1
"
]
)
identities
[
uid
][
"
balance
"
]
=
balance
identities
[
uid
][
"
pubkey
"
]
=
address
# Add custom identities
identities
.
update
(
custom_identities
)
...
...
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