Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ build/
tests/systemtests/binaries
tests/systemtests/testnet
.testnets

# Environments
*.env
.envrc
.venv
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@
[submodule "tests/evm-tools-compatibility/foundry/lib/forge-std"]
path = tests/evm-tools-compatibility/foundry/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "tests/integration_tests/contracts/openzeppelin-contracts-upgradeable"]
path = tests/integration_tests/contracts/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable.git
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ lint-fix:
lint-fix-contracts:
solhint --fix contracts/**/*.sol

lint-py:
flake8 --show-source --count --statistics \
--format="::error file=%(path)s,line=%(row)d,col=%(col)d::%(path)s:%(row)d:%(col)d: %(code)s %(text)s" \
--exclude=tests/integration_tests/contracts \
tests/integration_tests/

.PHONY: lint lint-fix lint-contracts lint-go lint-python

format: format-go format-python format-shell
Expand Down
4 changes: 4 additions & 0 deletions tests/integration_tests/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length = 88
extend-ignore = E203
exclude = .git,__pycache__,./integration_tests/contracts
Empty file.
15 changes: 15 additions & 0 deletions tests/integration_tests/configs/accounts.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
local config = import 'default.jsonnet';
local chain = (import 'chains.jsonnet')[std.extVar('CHAIN_CONFIG')];

config {
'evm-canary-net-1'+: {
accounts: super.accounts[:std.length(super.accounts) - 1] + [
{
'coin-type': 60,
name: 'user' + i,
coins: '100000000000000000' + chain.evm_denom,
}
for i in std.range(0, 5)
],
},
}
34 changes: 34 additions & 0 deletions tests/integration_tests/configs/chains.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
evmd: {
'account-prefix': 'cosmos',
evm_denom: 'atest',
cmd: 'evmd',
evm_chain_id: 262144,
bank: {
denom_metadata: [{
description: 'Native 18-decimal denom metadata for Cosmos EVM chain',
denom_units: [
{
denom: 'atest',
exponent: 0,
},
{
denom: 'test',
exponent: 18,
},
],
base: 'atest',
display: 'test',
name: 'Cosmos EVM',
symbol: 'ATOM',
}],
},
evm: {},
feemarket: {
params: {
base_fee: '1000000000',
min_gas_price: '1000000000',
},
},
},
}
188 changes: 188 additions & 0 deletions tests/integration_tests/configs/default.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
local chain = (import 'chains.jsonnet')[std.extVar('CHAIN_CONFIG')];
local gas_price = 1000000000;

{
dotenv: '../../scripts/.env',
'evm-canary-net-1': {
cmd: chain.cmd,
'start-flags': '--trace',
config: {
mempool: {
version: 'v1',
},
},
'app-config': {
evm: {
'evm-chain-id': chain.evm_chain_id,
},
grpc: {
'skip-check-header': true,
},
'minimum-gas-prices': '0' + chain.evm_denom,
'index-events': ['ethereum_tx.ethereumTxHash'],
'iavl-lazy-loading': true,
'json-rpc': {
enable: true,
address: '127.0.0.1:{EVMRPC_PORT}',
'ws-address': '127.0.0.1:{EVMRPC_PORT_WS}',
api: 'eth,net,web3,debug,txpool',
'feehistory-cap': 100,
'block-range-cap': 10000,
'logs-cap': 10000,
'gas-cap': 30000000,
'allow-unprotected-txs': true,
},
mempool: {
'max-txs': 5000,
},
},
validators: [{
'coin-type': 60,
coins: '100000000000000000000' + chain.evm_denom,
staked: '10000000000000000000' + chain.evm_denom,
gas_prices: gas_price + chain.evm_denom,
mnemonic: '${VALIDATOR1_MNEMONIC}',
}, {
'coin-type': 60,
coins: '100000000000000000000' + chain.evm_denom,
staked: '10000000000000000000' + chain.evm_denom,
gas_prices: gas_price + chain.evm_denom,
mnemonic: '${VALIDATOR2_MNEMONIC}',
config: {
db_backend: 'pebbledb',
},
'app-config': {
'app-db-backend': 'pebbledb',
},
}, {
'coin-type': 60,
coins: '100000000000000000000' + chain.evm_denom,
staked: '10000000000000000000' + chain.evm_denom,
gas_prices: gas_price + chain.evm_denom,
mnemonic: '${VALIDATOR3_MNEMONIC}',
config: {
db_backend: 'goleveldb',
},
'app-config': {
'app-db-backend': 'goleveldb',
},
}],
accounts: [{
'coin-type': 60,
name: 'community',
coins: '100000000000000000000' + chain.evm_denom + ',1000000000000atoken',
mnemonic: '${COMMUNITY_MNEMONIC}',
}, {
'coin-type': 60,
name: 'signer1',
coins: '100000000000000000000' + chain.evm_denom,
mnemonic: '${SIGNER1_MNEMONIC}',
}, {
'coin-type': 60,
name: 'signer2',
coins: '100000000000000000000' + chain.evm_denom,
mnemonic: '${SIGNER2_MNEMONIC}',
}, {
'coin-type': 60,
name: 'reserve',
coins: '100000000000000000000' + chain.evm_denom,
mnemonic: '${RESERVE_MNEMONIC}',
vesting: '60s',
}],
genesis: {
consensus: {
params: {
block: {
max_bytes: '1048576',
max_gas: '81500000',
},
abci: {
vote_extensions_enable_height: '1',
},
},
},
app_state: {
evm: chain.evm {
params+: {
evm_denom: chain.evm_denom,
active_static_precompiles: [
'0x0000000000000000000000000000000000000800',
'0x0000000000000000000000000000000000000801',
'0x0000000000000000000000000000000000000805',
'0x0000000000000000000000000000000000000807',
],
},
},
erc20: {
native_precompiles: [
'0x4200000000000000000000000000000000000006',
],
token_pairs: [{
erc20_address: '0x4200000000000000000000000000000000000006',
denom: chain.evm_denom,
enabled: true,
contract_owner: 1,
}],
},
feemarket: chain.feemarket {
params+: {
min_gas_multiplier: '0',
},
},
gov: {
params: {
expedited_voting_period: '1s',
voting_period: '10s',
max_deposit_period: '10s',
min_deposit: [
{
denom: chain.evm_denom,
amount: '1',
},
],
expedited_min_deposit: [
{
denom: chain.evm_denom,
amount: '2',
},
],
},
},
crisis: {
constant_fee: {
denom: chain.evm_denom,
},
},
mint: {
params: {
mint_denom: chain.evm_denom,
},
},
staking: {
params: {
bond_denom: chain.evm_denom,
unbonding_time: '10s',
},
},
bank: chain.bank {
denom_metadata+: [{
denom_units+: [
{
denom: 'atoken',
exponent: 0,
},
{
denom: 'token',
exponent: 18,
},
],
base: 'atoken',
display: 'token',
name: 'Test Coin',
symbol: 'ATOKEN',
}],
},
},
},
},
}
16 changes: 16 additions & 0 deletions tests/integration_tests/configs/enable-indexer.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
local config = import 'default.jsonnet';

config {
'evm-canary-net-1'+: {
config+: {
tx_index+: {
indexer: 'null',
},
},
'app-config'+: {
'json-rpc'+: {
'enable-indexer': true,
},
},
},
}
12 changes: 12 additions & 0 deletions tests/integration_tests/configs/exploit.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
local config = import 'default.jsonnet';

config {
'evm-canary-net-1'+: {
'app-config'+: {
'json-rpc'+: {
'batch-request-limit': 2,
'batch-response-max-size': 7188483, // memory_byte_size - 1
},
},
},
}
17 changes: 17 additions & 0 deletions tests/integration_tests/configs/fee-history.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
local config = import 'default.jsonnet';

config {
'evm-canary-net-1'+: {
genesis+: {
app_state+: {
feemarket+: {
params+: {
elasticity_multiplier: 3,
base_fee_change_denominator: 100000000,
// min_gas_price: '0.000000000000000000', # TODO: remove after basefee fix
},
},
},
},
},
}
12 changes: 12 additions & 0 deletions tests/integration_tests/configs/hw.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
local config = import 'default.jsonnet';
local chain = (import 'chains.jsonnet')[std.extVar('CHAIN_CONFIG')];

config {
'evm-canary-net-1'+: {
hw_account: {
name: 'hw',
coins: '8000000000000000000' + chain.evm_denom,
'coin-type': 118,
},
},
}
36 changes: 36 additions & 0 deletions tests/integration_tests/configs/ibc.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
local config = import 'default.jsonnet';
local rly_chain = import 'rly_chain.jsonnet';
local rly_common = import 'rly_common.jsonnet';
local chain = (import 'chains.jsonnet')[std.extVar('CHAIN_CONFIG')];
local basic = config['evm-canary-net-1'];
local ibc_common = import 'ibc_common.jsonnet';

config {
'evm-canary-net-1'+: ibc_common {
key_name: 'signer2',
'account-prefix': chain['account-prefix'],
},
'evm-canary-net-2'+: basic + ibc_common {
key_name: 'signer1',
'account-prefix': chain['account-prefix'],
validators: [validator {
base_port: 26800 + i * 10,
} for i in std.range(0, std.length(super.validators) - 1) for validator in [super.validators[i]]],
},
relayer: rly_common {
chains: [
rly_chain {
id: 'evm-canary-net-1',
gas_price+: {
denom: chain.evm_denom,
},
},
rly_chain {
id: 'evm-canary-net-2',
gas_price+: {
denom: chain.evm_denom,
},
},
],
},
}
22 changes: 22 additions & 0 deletions tests/integration_tests/configs/ibc_common.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
'coin-type': 60,
'app-config'+: {
'index-events': super['index-events'] + ['message.action'],
},
genesis+: {
app_state+: {
feemarket+: {
params+: {
no_base_fee: true,
base_fee: '0',
min_gas_price: '0',
},
},
staking+: {
params+: {
unbonding_time: '1814400s',
},
},
},
},
}
Loading
Loading