Minor refactors on address check.
This commit is contained in:
parent
13c71dd155
commit
1acfff9f46
@ -3,7 +3,7 @@ import logging
|
|||||||
|
|
||||||
# external imports
|
# external imports
|
||||||
import celery
|
import celery
|
||||||
from chainlib.eth.address import is_checksum_address
|
from chainlib.eth.address import is_checksum_address, is_address
|
||||||
|
|
||||||
# local imports
|
# local imports
|
||||||
from cic_eth.db.models.role import AccountRole
|
from cic_eth.db.models.role import AccountRole
|
||||||
@ -65,7 +65,7 @@ def reserve_nonce(self, chained_input, chain_spec_dict, signer_address=None):
|
|||||||
address = AccountRole.get_address(signer_address, session=session)
|
address = AccountRole.get_address(signer_address, session=session)
|
||||||
logg.debug('role for reserve nonce {} -> {}'.format(signer_address, address))
|
logg.debug('role for reserve nonce {} -> {}'.format(signer_address, address))
|
||||||
|
|
||||||
if not is_checksum_address(address):
|
if not is_address(address):
|
||||||
raise ValueError('invalid result when resolving address for nonce {}'.format(address))
|
raise ValueError('invalid result when resolving address for nonce {}'.format(address))
|
||||||
|
|
||||||
root_id = self.request.root_id
|
root_id = self.request.root_id
|
||||||
|
Loading…
Reference in New Issue
Block a user