Skip to content

Commit

Permalink
Update asset updates regexes.
Browse files Browse the repository at this point in the history
To be able to work with the changes here:
rotki/assets#133

Essentially to:

1. Handle "(" inside a string
2. Handle no space between ) and VALUES

Signed-off-by: Lefteris Karapetsas <[email protected]>
  • Loading branch information
LefterisJP committed Feb 27, 2024
1 parent 4431347 commit cce2ac2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rotkehlchen/globaldb/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ def __init__(self, msg_aggregator: 'MessagesAggregator') -> None:
self.local_assets_version = GlobalDBHandler().get_setting_value(ASSETS_VERSION_KEY, 0)
self.last_remote_checked_version = -1 # integer value that represents no update
self.conflicts: list[tuple[AssetData, AssetData]] = []
self.assets_re = re.compile(r'.*INSERT +INTO +assets\( *identifier *, *name *, *type *\) +VALUES\(([^\)]*?),([^\)]*?),([^\)]*?)\).*?') # noqa: E501
self.evm_tokens_re = re.compile(r'.*INSERT +INTO +evm_tokens\( *identifier *, *token_kind *, *chain *, *address *, *decimals *, *protocol *\) +VALUES\(([^\)]*?),([^\)]*?),([^\)]*?),([^\)]*?),([^\)]*?),([^\)]*?)\).*') # noqa: E501
self.common_asset_details_re = re.compile(r'.*INSERT +INTO +common_asset_details\( *identifier *, *symbol *, *coingecko *, *cryptocompare *, *forked *, *started *, *swapped_for *\) +VALUES\((.*?),(.*?),(.*?),(.*?),(.*?),([^\)]*?),([^\)]*?)\).*') # noqa: E501
self.assets_collection_re = re.compile(r'.*INSERT +INTO +asset_collections\( *id *, *name *, *symbol *\) +VALUES +\(([^\)]*?),([^\)]*?),([^\)]*?)\).*?') # noqa: E501
self.multiasset_mappings_re = re.compile(r'.*INSERT +INTO +multiasset_mappings\( *collection_id *, *asset *\) +VALUES +\(([^\)]*?), *"([^\)]+?)"\).*?') # noqa: E501
self.assets_re = re.compile(r'.*INSERT +INTO +assets\( *identifier *, *name *, *type *\) *VALUES\(([^,]*?),([^,]*?),([^,]*?)\).*?') # noqa: E501
self.evm_tokens_re = re.compile(r'.*INSERT +INTO +evm_tokens\( *identifier *, *token_kind *, *chain *, *address *, *decimals *, *protocol *\) *VALUES\(([^,]*?),([^,]*?),([^,]*?),([^,]*?),([^,]*?),([^,]*?)\).*') # noqa: E501
self.common_asset_details_re = re.compile(r'.*INSERT +INTO +common_asset_details\( *identifier *, *symbol *, *coingecko *, *cryptocompare *, *forked *, *started *, *swapped_for *\) *VALUES\((.*?),(.*?),(.*?),(.*?),(.*?),([^,]*?),([^,]*?)\).*') # noqa: E501
self.assets_collection_re = re.compile(r'.*INSERT +INTO +asset_collections\( *id *, *name *, *symbol *\) *VALUES +\(([^,]*?),([^,]*?),([^,]*?)\).*?') # noqa: E501
self.multiasset_mappings_re = re.compile(r'.*INSERT +INTO +multiasset_mappings\( *collection_id *, *asset *\) *VALUES +\(([^,]*?), *"([^,]+?)"\).*?') # noqa: E501
self.string_re = re.compile(r'.*"(.*?)".*')
self.branch = 'develop'
if is_production():
Expand Down

0 comments on commit cce2ac2

Please sign in to comment.