Skip to content

Commit

Permalink
Merge pull request #159 from OjusWiZard/fix/assets
Browse files Browse the repository at this point in the history
 Fix (Updates): Inconsistencies
  • Loading branch information
yabirgb committed May 21, 2024
2 parents 9920e03 + 44ee2cf commit 7cd79e4
Show file tree
Hide file tree
Showing 12 changed files with 950 additions and 17 deletions.
9 changes: 5 additions & 4 deletions tests/test_correct_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ def test_asset_collections_updates(version, schema_versions):
return

with open(upgrade) as f:
for line in f.readlines():
if '*' in line:
continue
lines = [x.strip() for x in f.readlines() if x.strip() != '']
for action, full_insert in zip(*[iter(lines)] * 2, strict=True):
if '*' == full_insert:
full_insert = action

collections_match = assets_collection_re.match(line)
collections_match = assets_collection_re.match(full_insert)
assert collections_match is not None
groups = collections_match.groups()
assert len(groups) == 3
Expand Down
2 changes: 1 addition & 1 deletion updates/18/updates.sql
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ UPDATE common_asset_details SET coingecko="multibtc" WHERE identifier="eip155:1/
INSERT INTO assets(identifier, name, type) VALUES("eip155:1/erc20:0x66eFF5221ca926636224650Fd3B9c497FF828F7D", "Multichain BTC", "C"); INSERT INTO evm_tokens(identifier, token_kind, chain, address, decimals, protocol) VALUES("eip155:1/erc20:0x66eFF5221ca926636224650Fd3B9c497FF828F7D", "A", 1, "0x66eFF5221ca926636224650Fd3B9c497FF828F7D", 8, NULL); INSERT INTO common_asset_details(identifier, symbol, coingecko, cryptocompare, forked, started, swapped_for) VALUES("eip155:1/erc20:0x66eFF5221ca926636224650Fd3B9c497FF828F7D", "multiBTC", "multibtc", "", NULL, 1671195491, NULL);
UPDATE common_asset_details SET cryptocompare="GRAIL" WHERE identifier="eip155:42161/erc20:0x3d9907F9a368ad0a51Be60f7Da3b97cf940982D8";
INSERT INTO assets(identifier, name, type) VALUES("eip155:42161/erc20:0x3d9907F9a368ad0a51Be60f7Da3b97cf940982D8", "Camelot token", "C"); INSERT INTO evm_tokens(identifier, token_kind, chain, address, decimals, protocol) VALUES("eip155:42161/erc20:0x3d9907F9a368ad0a51Be60f7Da3b97cf940982D8", "A", 42161, "0x3d9907F9a368ad0a51Be60f7Da3b97cf940982D8", 18, NULL); INSERT INTO common_asset_details(identifier, symbol, coingecko, cryptocompare, forked, started, swapped_for) VALUES("eip155:42161/erc20:0x3d9907F9a368ad0a51Be60f7Da3b97cf940982D8", "GRAIL", "camelot-token", "GRAIL", NULL, 1668866817, NULL);
UPDATE common_asset_details SET cryptocompare="IGU" WHERE identifier="eip155:1/erc20:0x201bC9F242f74C47Bbd898a5DC99cDCD81A21943";
UPDATE common_asset_details SET cryptocompare="IGU" WHERE identifier="eip155:56/erc20:0x201bC9F242f74C47Bbd898a5DC99cDCD81A21943";
INSERT INTO assets(identifier, name, type) VALUES("eip155:56/erc20:0x201bC9F242f74C47Bbd898a5DC99cDCD81A21943", "IGU Token", "C"); INSERT INTO evm_tokens(identifier, token_kind, chain, address, decimals, protocol) VALUES("eip155:56/erc20:0x201bC9F242f74C47Bbd898a5DC99cDCD81A21943", "A", 56, "0x201bC9F242f74C47Bbd898a5DC99cDCD81A21943", 18, NULL); INSERT INTO common_asset_details(identifier, symbol, coingecko, cryptocompare, forked, started, swapped_for) VALUES("eip155:56/erc20:0x201bC9F242f74C47Bbd898a5DC99cDCD81A21943", "IGU", "iguverse-igu", "IGU", NULL, 1667125109, NULL);
UPDATE common_asset_details SET cryptocompare="SUDO" WHERE identifier="eip155:1/erc20:0x3446Dd70B2D52A6Bf4a5a192D9b0A161295aB7F9";
INSERT INTO assets(identifier, name, type) VALUES("eip155:1/erc20:0x3446Dd70B2D52A6Bf4a5a192D9b0A161295aB7F9", "SUDO", "C"); INSERT INTO evm_tokens(identifier, token_kind, chain, address, decimals, protocol) VALUES("eip155:1/erc20:0x3446Dd70B2D52A6Bf4a5a192D9b0A161295aB7F9", "A", 1, "0x3446Dd70B2D52A6Bf4a5a192D9b0A161295aB7F9", 18, NULL); INSERT INTO common_asset_details(identifier, symbol, coingecko, cryptocompare, forked, started, swapped_for) VALUES("eip155:1/erc20:0x3446Dd70B2D52A6Bf4a5a192D9b0A161295aB7F9", "SUDO", "sudoswap", "SUDO", NULL, 1675101587, NULL);
Expand Down
4 changes: 0 additions & 4 deletions updates/21/asset_collections_mappings_updates.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ INSERT INTO multiasset_mappings(collection_id, asset) VALUES (36, "eip155:137/er
*
INSERT INTO multiasset_mappings(collection_id, asset) VALUES (36, "eip155:8453/erc20:0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA");
*
INSERT INTO multiasset_mappings(collection_id, asset) VALUES (36, "eip155:42161/erc20:0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8");
*
INSERT INTO multiasset_mappings(collection_id, asset) VALUES (36, "eip155:10/erc20:0x7F5c764cBc14f9669B88837ca1490cCa17c31607");
*
INSERT INTO multiasset_mappings(collection_id, asset) VALUES (36, "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831");
*
INSERT INTO multiasset_mappings(collection_id, asset) VALUES (36, "eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85");
Expand Down
2 changes: 2 additions & 0 deletions updates/21/updates.sql
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,6 @@ INSERT INTO assets(identifier, name, type) VALUES("eip155:10/erc20:0xCB8FA9a76b8
INSERT INTO assets(identifier, name, type) VALUES("eip155:8453/erc20:0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA", "USD Base Coin", "C"); INSERT INTO evm_tokens(identifier, token_kind, chain, address, decimals, protocol) VALUES("eip155:8453/erc20:0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA", "A", 8453, "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA", 6, NULL); INSERT INTO common_asset_details(identifier, symbol, coingecko, cryptocompare, forked, started, swapped_for) VALUES("eip155:8453/erc20:0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA", "USDbC", "usd-coin", "USDC", NULL, 1690914161, NULL);
*
INSERT INTO assets(identifier, name, type) VALUES("eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "USD Coin", "C"); INSERT INTO evm_tokens(identifier, token_kind, chain, address, decimals, protocol) VALUES("eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "A", 42161, "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", 6, NULL); INSERT INTO common_asset_details(identifier, symbol, coingecko, cryptocompare, forked, started, swapped_for) VALUES("eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "USDC", "usd-coin", "USDC", NULL, 1667248932, NULL);
*
INSERT INTO assets(identifier, name, type) VALUES("eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", "USD Coin", "C"); INSERT INTO evm_tokens(identifier, token_kind, chain, address, decimals, protocol) VALUES("eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", "A", 10, "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", 6, ""); INSERT INTO common_asset_details(identifier, symbol, coingecko, cryptocompare, forked, started, swapped_for) VALUES("eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85", "USDC", "usd-coin", "usdc", NULL, 1716200197, NULL);
*
2 changes: 0 additions & 2 deletions updates/22/asset_collections_mappings_updates.sql
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ INSERT INTO multiasset_mappings(collection_id, asset) VALUES (248, "eip155:1/erc
*
INSERT INTO multiasset_mappings(collection_id, asset) VALUES (248, "eip155:100/erc20:0x1509706a6c66CA549ff0cB464de88231DDBe213B");
*
INSERT INTO multiasset_mappings(collection_id, asset) VALUES (23, "eip155:10/erc20:0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb");
*
INSERT INTO multiasset_mappings(collection_id, asset) VALUES (250, "eip155:1/erc20:0x62D0A8458eD7719FDAF978fe5929C6D342B0bFcE");
*
INSERT INTO multiasset_mappings(collection_id, asset) VALUES (250, "eip155:56/erc20:0x62D0A8458eD7719FDAF978fe5929C6D342B0bFcE");
Expand Down
2 changes: 1 addition & 1 deletion updates/24/asset_collections_mappings_updates.sql
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ INSERT INTO multiasset_mappings(collection_id, asset) VALUES (299, "eip155:53435
*
INSERT INTO multiasset_mappings(collection_id, asset) VALUES (222, "eip155:534352/erc20:0x53878B874283351D26d206FA512aEcE1Bef6C0dD");
*
INSERT INTO multiasset_mappings(collection_id, asset) VALUES (300, "eip155:1/erc20:0xdd974D5C2e2928deA5F71b9825b8b646686BD200");
INSERT INTO multiasset_mappings(collection_id, asset) VALUES (300, "eip155:1/erc20:0xdeFA4e8a7bcBA345F687a2f1456F5Edd9CE97202");
*
INSERT INTO multiasset_mappings(collection_id, asset) VALUES (300, "eip155:534352/erc20:0x608ef9A3BffE206B86c3108218003b3cfBf99c84");
*
Expand Down
Loading

0 comments on commit 7cd79e4

Please sign in to comment.