Skip to content

Commit

Permalink
add devnets
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Jan 19, 2024
1 parent 46d0bc7 commit d5c4784
Show file tree
Hide file tree
Showing 27 changed files with 43 additions and 22 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/utility/chain_registry.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const chainRegistryRoot = "../../..";
const networkTypeToDirectoryNameMap = new Map();
networkTypeToDirectoryNameMap.set("mainnet", "");
networkTypeToDirectoryNameMap.set("testnet", "testnets");
networkTypeToDirectoryNameMap.set("devnet", "devnets");
const networkTypes = Array.from(networkTypeToDirectoryNameMap.keys());

const domainToDirectoryNameMap = new Map();
Expand All @@ -34,9 +35,9 @@ export const nonChainDirectories = [
".vs",
"_IBC",
"_memo_keys",
"_non-cosmos",
"_template",
"testnets",
"devnets",
".gitignore",
"assetlist.schema.json",
"chain.schema.json",
Expand Down Expand Up @@ -77,6 +78,7 @@ export const bech32ConfigSuffixMap = new Map([
const networkTypeToDirectoryMap = new Map();
networkTypeToDirectoryMap.set("mainnet", "");
networkTypeToDirectoryMap.set("testnet", "testnets");
networkTypeToDirectoryMap.set("devnet", "devnets");
for (const [networkType, directory] of networkTypeToDirectoryMap.entries()) {
networkTypeToDirectoryMap.set(networkType, path.join(chainRegistryRoot, directory));
}
Expand Down
24 changes: 19 additions & 5 deletions .github/workflows/utility/test_ibcdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@

mypathMainnets = join(getcwd(),"_IBC")
mypathTestnets = join(getcwd(),"testnets","_IBC")
mypathDevnets = join(getcwd(),"devnets","_IBC")
ibcData_files_mainnet = [f for f in listdir(mypathMainnets) if isfile(join(mypathMainnets, f))]
ibcData_files_testnet = [f for f in listdir(mypathTestnets) if isfile(join(mypathTestnets, f))]
ibcData_files = ibcData_files_mainnet + ibcData_files_testnet
ibcData_files_devnet = [f for f in listdir(mypathDevnets) if isfile(join(mypathDevnets, f))]
ibcData_files = ibcData_files_mainnet + ibcData_files_testnet + ibcData_files_devnet

@pytest.mark.parametrize("input", ibcData_files)
def test_fileName(input):
Expand Down Expand Up @@ -53,15 +55,27 @@ def test_chainNameMatchFileNameTestnets(input):
chain_2 = str(json_file["chain_2"]["chain_name"]).lower()
assert fileName_chain1 == chain_1 and fileName_chain2 == chain_2

@pytest.mark.parametrize("input", ibcData_files_devnet)
def test_chainNameMatchFileNameDevnets(input):
# validates for testnet connections that the chain-name for chain-1 and chain-2 inside the json file match the order used in the file name.
pattern = re.compile(r'(.*)-(.*).json$')
m = pattern.match(input)
fileName_chain1 = m.group(1).lower()
fileName_chain2 = m.group(2).lower()
with open(join(mypathDevnets,input), "r") as read_file:
json_file = json.load(read_file)
chain_1 = str(json_file["chain_1"]["chain_name"]).lower()
chain_2 = str(json_file["chain_2"]["chain_name"]).lower()
assert fileName_chain1 == chain_1 and fileName_chain2 == chain_2

@pytest.mark.parametrize("input", ibcData_files)
# validates that the chain-name's used exist as root folders on the chain-registry
def test_existstsOnChainReg(input):
pattern = re.compile(r'(.*)-(.*).json$')
m = pattern.match(input)
chain1 = m.group(1).lower()
chain2 = m.group(2).lower()
non_cosmos = join('_non-cosmos')
testnets = join('testnets')
nc_testnets = join('testnets','_non-cosmos')
assert ((isdir(join(getcwd(),chain1)) or isdir(join(getcwd(),non_cosmos,chain1)) or isdir(join(getcwd(),testnets,chain1)) or isdir(join(getcwd(),nc_testnets,chain1))) and
(isdir(join(getcwd(),chain2)) or isdir(join(getcwd(),non_cosmos,chain2)) or isdir(join(getcwd(),testnets,chain1)) or isdir(join(getcwd(),nc_testnets,chain2))))
devnets = join('devnets')
assert ((isdir(join(getcwd(),chain1)) or isdir(join(getcwd(),testnets,chain1)) or isdir(join(getcwd(), devnets,chain1))) and
(isdir(join(getcwd(),chain2)) or isdir(join(getcwd(),testnets,chain2)) or isdir(join(getcwd(),devnets,chain2))))
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"devnets"
]
}
8 changes: 4 additions & 4 deletions assetlist.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@
"png": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/)[a-z0-9]+/images/.+\\.png$"
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/|devnets/)[a-z0-9]+/images/.+\\.png$"
},
"svg": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/)[a-z0-9]+/images/.+\\.svg$"
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/|devnets/)[a-z0-9]+/images/.+\\.svg$"
}
},
"additionalProperties": false
Expand All @@ -140,12 +140,12 @@
"png": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/)[a-z0-9]+/images/.+\\.png$"
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/|devnets/)[a-z0-9]+/images/.+\\.png$"
},
"svg": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/)[a-z0-9]+/images/.+\\.svg$"
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/|devnets/)[a-z0-9]+/images/.+\\.svg$"
},
"theme": {
"type": "object",
Expand Down
8 changes: 4 additions & 4 deletions chain.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,12 @@
"png": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/)[a-z0-9]+/images/.+\\.png$"
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/|devnets/)[a-z0-9]+/images/.+\\.png$"
},
"svg": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/)[a-z0-9]+/images/.+\\.svg$"
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/|devnets/)[a-z0-9]+/images/.+\\.svg$"
},
"theme": {
"type": "object",
Expand Down Expand Up @@ -486,12 +486,12 @@
"png": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/)[a-z0-9]+/images/.+\\.png$"
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/|devnets/)[a-z0-9]+/images/.+\\.png$"
},
"svg": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/)[a-z0-9]+/images/.+\\.svg$"
"pattern": "^https://raw\\.githubusercontent\\.com/initia/initia-registry/master/(|testnets/|devnets/)[a-z0-9]+/images/.+\\.svg$"
}
},
"additionalProperties": false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "../ibc_data.schema.json",
"$schema": "../../ibc_data.schema.json",
"chain_1": {
"chain_name": "mahalo",
"client_id": "07-tendermint-0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "../ibc_data.schema.json",
"$schema": "../../ibc_data.schema.json",
"chain_1": {
"chain_name": "mahalo",
"client_id": "07-tendermint-1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "../assetlist.schema.json",
"$schema": "../../assetlist.schema.json",
"chain_name": "initia",
"assets": [
{
Expand Down
2 changes: 1 addition & 1 deletion testnets/mahalo/chain.json → devnets/mahalo/chain.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "../chain.schema.json",
"$schema": "../../chain.schema.json",
"chain_name": "initia",
"chain_id": "mahalo-1",
"website": "https://initia.xyz",
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "../assetlist.schema.json",
"$schema": "../../assetlist.schema.json",
"chain_name": "minimove",
"assets": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "../chain.schema.json",
"$schema": "../../chain.schema.json",
"chain_name": "minimove",
"chain_id": "minimove-1",
"website": "https://initia.xyz",
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "../assetlist.schema.json",
"$schema": "../../assetlist.schema.json",
"chain_name": "miniwasm",
"assets": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "../chain.schema.json",
"$schema": "../../chain.schema.json",
"chain_name": "miniwasm",
"chain_id": "miniwasm-1",
"website": "https://initia.xyz",
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit d5c4784

Please sign in to comment.