Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Aug 29, 2024
1 parent 23c2e31 commit af4eed6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions integration_tests/configs/genesis_token_mapping.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ config {
denom: 'gravity0x0000000000000000000000000000000000000000',
contract: '0x68542BD12B41F5D51D6282Ec7D91D7d0D78E4503',
},
{
denom: 'ibc/6B5A664BF0AF4F71B2F0BAA33141E2F1321242FBD5D19762F541EC971ACB0865',
contract: '0x0000000000000000000000000000000000000000',
},
],
auto_contracts: [
{
Expand Down
16 changes: 16 additions & 0 deletions integration_tests/test_exported_genesis.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import json
import urllib.parse
from pathlib import Path

import pytest
import requests
from pystarport import ports

from .network import setup_custom_cronos
from .utils import ADDRS, CONTRACTS
Expand Down Expand Up @@ -34,3 +37,16 @@ def test_exported_token_mapping(custom_cronos):
)
assert rsp["contract"] == "0x68542BD12B41F5D51D6282Ec7D91D7d0D78E4503"
assert rsp["auto_contract"] == "0x68542BD12B41F5D51D6282Ec7D91D7d0D78E4503"
denom = "ibc/6B5A664BF0AF4F71B2F0BAA33141E2F1321242FBD5D19762F541EC971ACB0865"
rsp = cli.query_contract_by_denom(denom)
expected = {
"contract": "0x0000000000000000000000000000000000000000",
"auto_contract": "",
}
assert rsp == expected
port = ports.api_port(custom_cronos.base_port(0))
param = urllib.parse.quote(denom, safe="")
param = urllib.parse.quote(param, safe="")
url = f"http://127.0.0.1:{port}/cronos/v1/contract_by_denom/{param}"
rsp = requests.get(url).json()
assert rsp == expected

0 comments on commit af4eed6

Please sign in to comment.