Skip to content

Commit 99993b5

Browse files
Add Requirement for asset::type_asset Property (cosmos#5410)
* Add validation for type_asset * Add requirement fdor type_asset to schema * Add missing contracts * fix
1 parent dd216b6 commit 99993b5

File tree

319 files changed

+1760
-939
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

319 files changed

+1760
-939
lines changed

.github/workflows/utility/validate_data.mjs

+42
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,45 @@ function arraysEqual(arr1, arr2) {
395395
return true;
396396
}
397397

398+
function checkTypeAsset(chain_name, asset) {
399+
400+
let type_asset = "ics20";
401+
if (asset.base.startsWith("ibc/") && asset.type_asset !== type_asset) {
402+
throw new Error(`Type_asset not specified as ${type_asset}: ${chain_name}, ${asset.base}, ${asset.symbol}.`);
403+
}
404+
405+
if (
406+
asset.base.startsWith("cw20")
407+
) {
408+
if (chain_name.startsWith("secret")) {
409+
type_asset = "snip20";
410+
if (asset.type_asset !== type_asset && asset.type_asset !== "snip25") {
411+
throw new Error(`Type_asset not specified as ${type_asset}: ${chain_name}, ${asset.base}, ${asset.symbol}.`);
412+
}
413+
} else {
414+
type_asset = "cw20";
415+
if (asset.type_asset !== "cw20") {
416+
throw new Error(`Type_asset not specified as ${type_asset}: ${chain_name}, ${asset.base}, ${asset.symbol}.`);
417+
}
418+
}
419+
}
420+
421+
type_asset = "erc20";
422+
if (
423+
asset.base.startsWith("0x") &&
424+
!asset.base.includes("::") &&
425+
!asset.base.includes("00000") &&
426+
asset.type_asset !== type_asset
427+
) {
428+
throw new Error(`Type_asset not specified as ${type_asset}: ${chain_name}, ${asset.base}, ${asset.symbol}.`);
429+
}
430+
431+
if (!asset.type_asset) {
432+
throw new Error(`Type_asset not specified: ${chain_name}, ${asset.base}, ${asset.symbol}.`);
433+
}
434+
435+
}
436+
398437

399438
export function validate_chain_files() {
400439

@@ -426,6 +465,9 @@ export function validate_chain_files() {
426465

427466
//iterate each asset
428467
chainAssets?.forEach((asset) => {
468+
469+
//require type_asset
470+
checkTypeAsset(chain_name, asset);
429471

430472
//check denom units
431473
checkDenomUnits(asset);

8ball/assetlist.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"primary_color_hex": "#dbdbdb"
3131
}
3232
}
33-
]
33+
],
34+
"type_asset": "sdk.coin"
3435
}
3536
]
3637
}

_non-cosmos/picasso/assetlist.json

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
"exponent": 12
163163
}
164164
],
165+
"type_asset": "substrate",
165166
"base": "2125",
166167
"name": "Tinkernet",
167168
"display": "TNKR",

_non-cosmos/tinkernet/assetlist.json

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"exponent": 12
2020
}
2121
],
22+
"type_asset": "substrate",
2223
"base": "Planck",
2324
"name": "Tinkernet",
2425
"display": "TNKR",

acrechain/assetlist.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"socials": {
3636
"website": "https://arable.finance/",
3737
"twitter": "https://twitter.com/ArableProtocol"
38-
}
38+
},
39+
"type_asset": "sdk.coin"
3940
},
4041
{
4142
"description": "Overcollateralized stable coin for Arable derivatives v1",
@@ -70,7 +71,8 @@
7071
"socials": {
7172
"website": "https://arable.finance/",
7273
"twitter": "https://twitter.com/ArableProtocol"
73-
}
74+
},
75+
"type_asset": "sdk.coin"
7476
},
7577
{
7678
"description": "Ciento Exchange Token",
@@ -100,7 +102,8 @@
100102
"primary_color_hex": "#ecc53b"
101103
}
102104
}
103-
]
105+
],
106+
"type_asset": "sdk.coin"
104107
}
105108
]
106109
}

agoric/assetlist.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"socials": {
3737
"website": "https://agoric.com/",
3838
"twitter": "https://twitter.com/agoric"
39-
}
39+
},
40+
"type_asset": "sdk.coin"
4041
},
4142
{
4243
"description": "IST is the stable token used by the Agoric chain for execution fees and commerce.",
@@ -67,7 +68,8 @@
6768
"primary_color_hex": "#d485e2"
6869
}
6970
}
70-
]
71+
],
72+
"type_asset": "sdk.coin"
7173
}
7274
]
7375
}

aioz/assetlist.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"socials": {
4040
"website": "https://aioz.network/",
4141
"twitter": "https://twitter.com/AIOZNetwork"
42-
}
42+
},
43+
"type_asset": "sdk.coin"
4344
}
4445
]
4546
}

akash/assetlist.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"socials": {
3737
"website": "https://akash.network/",
3838
"twitter": "https://twitter.com/akashnet_"
39-
}
39+
},
40+
"type_asset": "sdk.coin"
4041
},
4142
{
4243
"description": "Tether USDt on Akash",

akiro/assetlist.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"primary_color_hex": "#f7f0e1"
3131
}
3232
}
33-
]
33+
],
34+
"type_asset": "sdk.coin"
3435
}
3536
]
3637
}

althea/assetlist.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
{
2929
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/althea/images/althea.svg"
3030
}
31-
]
31+
],
32+
"type_asset": "sdk.coin"
3233
}
3334
]
3435
}

andromeda/assetlist.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"primary_color_hex": "#040404"
3030
}
3131
}
32-
]
32+
],
33+
"type_asset": "sdk.coin"
3334
}
3435
]
3536
}

andromeda1/assetlist.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"primary_color_hex": "#040404"
3030
}
3131
}
32-
]
32+
],
33+
"type_asset": "sdk.coin"
3334
}
3435
]
3536
}

archway/assetlist.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"socials": {
4141
"website": "https://archway.io/",
4242
"twitter": "https://twitter.com/archwayHQ"
43-
}
43+
},
44+
"type_asset": "sdk.coin"
4445
},
4546
{
4647
"description": "ERIS liquid staked ARCH",
@@ -342,4 +343,4 @@
342343
]
343344
}
344345
]
345-
}
346+
}

arkh/assetlist.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"socials": {
3535
"website": "https://arkhadian.io/",
3636
"twitter": "https://twitter.com/ArkhadianSas"
37-
}
37+
},
38+
"type_asset": "sdk.coin"
3839
}
3940
]
4041
}

assetlist.schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"type": "object",
3333
"required": [
3434
"denom_units",
35+
"type_asset",
3536
"base",
3637
"display",
3738
"name",

assetmantle/assetlist.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"socials": {
3636
"website": "https://www.assetmantle.one/",
3737
"twitter": "https://twitter.com/AssetMantle"
38-
}
38+
},
39+
"type_asset": "sdk.coin"
3940
}
4041
]
4142
}

aura/assetlist.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"primary_color_hex": "#a7c8d4"
3232
}
3333
}
34-
]
34+
],
35+
"type_asset": "sdk.coin"
3536
}
3637
]
3738
}

aura1/assetlist.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"primary_color_hex": "#a7c8d4"
4242
}
4343
}
44-
]
44+
],
45+
"type_asset": "sdk.coin"
4546
}
4647
]
4748
}

0 commit comments

Comments
 (0)