Rehabiilitate import scripts to handle sempo exports after changes

This commit is contained in:
nolash 2021-02-18 16:38:09 +01:00
parent 3431991565
commit 8449ff8b58
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 7 additions and 3 deletions

View File

@ -142,7 +142,7 @@ class Handler:
except FileNotFoundError:
logg.error('no import record of address {}'.format(recipient))
return
u = Person(o)
u = Person.deserialize(o)
original_address = u.identities['evm'][old_chain_spec_str][0]
balance = self.balances[original_address]
logg.info('registered {} originally {} ({}) tx hash {} balance {}'.format(recipient, original_address, u, tx.hash, balance))

View File

@ -129,9 +129,11 @@ if __name__ == '__main__':
logg.error('load error for {}: {}'.format(y, e))
continue
f.close()
u = Person(o)
u = Person.deserialize(o)
new_address = register_eth(i, u)
if u.identities.get('evm') == None:
u.identities['evm'] = {}
u.identities['evm'][chain_str] = [new_address]
register_ussd(u)

View File

@ -268,7 +268,9 @@ def main():
logg.error('load error for {}: {}'.format(y, e))
continue
f.close()
u = Person(o)
u = Person.deserialize(o)
logg.debug('data {}'.format(u.identities['evm']))
new_address = u.identities['evm'][chain_str][0]
old_address = u.identities['evm'][old_chain_str][0]