diff --git a/apps/cic-eth/cic_eth/admin/token.py b/apps/cic-eth/cic_eth/admin/token.py index ffb17568..985a5f2c 100644 --- a/apps/cic-eth/cic_eth/admin/token.py +++ b/apps/cic-eth/cic_eth/admin/token.py @@ -16,4 +16,6 @@ def default_token(self): return { 'symbol': self.default_token_symbol, 'address': self.default_token_address, + 'name': self.default_token_name, + 'decimals': self.default_token_decimals, } diff --git a/apps/cic-eth/cic_eth/runnable/daemons/tasker.py b/apps/cic-eth/cic_eth/runnable/daemons/tasker.py index bcc14b31..af31c9ab 100644 --- a/apps/cic-eth/cic_eth/runnable/daemons/tasker.py +++ b/apps/cic-eth/cic_eth/runnable/daemons/tasker.py @@ -22,6 +22,7 @@ from chainlib.eth.connection import ( from chainlib.chain import ChainSpec from chainqueue.db.models.otx import Otx from cic_eth_registry.error import UnknownContractError +from cic_eth_registry.erc20 import ERC20Token import liveness.linux @@ -203,6 +204,11 @@ def main(): BaseTask.default_token_symbol = config.get('CIC_DEFAULT_TOKEN_SYMBOL') BaseTask.default_token_address = registry.by_name(BaseTask.default_token_symbol) + default_token = ERC20Token(chain_spec, rpc, BaseTask.default_token_address) + default_token.load(rpc) + BaseTask.default_token_decimals = default_token.decimals + BaseTask.default_token_name = default_token.name + BaseTask.run_dir = config.get('CIC_RUN_DIR') logg.info('default token set to {} {}'.format(BaseTask.default_token_symbol, BaseTask.default_token_address)) diff --git a/apps/cic-eth/cic_eth/runnable/info.py b/apps/cic-eth/cic_eth/runnable/info.py index 69604ca0..e6b82f06 100644 --- a/apps/cic-eth/cic_eth/runnable/info.py +++ b/apps/cic-eth/cic_eth/runnable/info.py @@ -67,6 +67,8 @@ def main(): token_info = t.get() print('Default token symbol: {}'.format(token_info['symbol'])) print('Default token address: {}'.format(token_info['address'])) + logg.debug('Default token name: {}'.format(token_info['name'])) + logg.debug('Default token decimals: {}'.format(token_info['decimals'])) if __name__ == '__main__': diff --git a/apps/cic-eth/cic_eth/task.py b/apps/cic-eth/cic_eth/task.py index d0d41d47..2275971c 100644 --- a/apps/cic-eth/cic_eth/task.py +++ b/apps/cic-eth/cic_eth/task.py @@ -33,6 +33,8 @@ class BaseTask(celery.Task): create_gas_oracle = RPCGasOracle default_token_address = None default_token_symbol = None + default_token_name = None + default_token_decimals = None run_dir = '/run' def create_session(self):