Skip to content

Commit

Permalink
Merge pull request #5 from TokenMarketNet/fix-start-block
Browse files Browse the repository at this point in the history
fixed type conversion of start and end block
  • Loading branch information
voith committed Feb 5, 2019
2 parents 4652797 + c522ff5 commit 7f3bab8
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions sto/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,8 @@ def next_nonce(config: BoardCommmadConfiguration):


@cli.command(name="token-scan")
@click.option('--start-block', required=False, help="The first block where we start (re)scan", default=None)
@click.option('--end-block', required=False, help="Until which block we scan, also can be 'latest'", default=None)
@click.option('--start-block', required=False, help="The first block where we start (re)scan", type=int, default=None)
@click.option('--end-block', required=False, help="Until which block we scan, also can be 'latest'", type=int, default=None)
@click.option('--token-address', required=True, help="Token contract address", default=None)
@click.pass_obj
def token_scan(config: BoardCommmadConfiguration, token_address, start_block, end_block):
Expand All @@ -502,7 +502,7 @@ def token_scan(config: BoardCommmadConfiguration, token_address, start_block, en
If start block and end block information are omitted, continue the scan where we were left last time.
Scan operations may take a while.
"""

assert is_ethereum_network(config.network)

logger = config.logger
Expand All @@ -511,14 +511,16 @@ def token_scan(config: BoardCommmadConfiguration, token_address, start_block, en

dbsession = config.dbsession

updated_addresses = token_scan(logger,
dbsession,
config.network,
ethereum_node_url=config.ethereum_node_url,
ethereum_abi_file=config.ethereum_abi_file,
token_address=token_address,
start_block=start_block,
end_block=end_block)
updated_addresses = token_scan(
logger,
dbsession,
config.network,
ethereum_node_url=config.ethereum_node_url,
ethereum_abi_file=config.ethereum_abi_file,
token_address=token_address,
start_block=start_block,
end_block=end_block
)

logger.info("Updated %d token holder balances", len(updated_addresses))

Expand Down

0 comments on commit 7f3bab8

Please sign in to comment.