Skip to content

Commit e76b4b4

Browse files
bcsainjuibrizsabin
andauthored
feat: added framework for remote chan tests and TC for token transfer … (#832)
* add: added framework for remote chan tests and TC for token transfer to-and-from ibc-centauri * fix: added test wallets and configs for e2e * fix: added test cases to cover stake transfer from centauri to icon * fix: increased timeouts and add sha256sum of latest light client wasm * added test keys for relayer for deevnet * feat: added testcase for icon-archway and back via centauri hopchain * chore: refactorings and adjust timeouts * chore: added sample config * chore: added sample config file to run in devnet with configured connection * chore: removed extra logging * chore: added codes in makefile to run hopchain tests * chore: made receivers configurable and updated docs * chore: updated docs for old xcall tests and new ones * fix: fixed case of wallet of chain * fix: fixed case of gh actions issue * fix: remove old test * fix: fixed PR comments --------- Co-authored-by: ibrizsabin <sabin.chitrakar@ibriz.ai> Co-authored-by: ibrizsabin <101165234+ibrizsabin@users.noreply.github.com>
1 parent 19e3f02 commit e76b4b4

File tree

70 files changed

+4529
-127
lines changed

Some content is hidden

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

70 files changed

+4529
-127
lines changed

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ e2e:
8484
@echo "Running e2e tests..."
8585
go test -v ./test/e2e -testify.m TestE2E_all
8686

87+
e2e-hopchain:
88+
@echo "Running hopchain e2e tests..."
89+
go test -v ./test/e2e-hopchain -testify.m TestE2E_hopchain
90+
8791
e2e-demo-setup:
8892
@echo "Configuring e2e demo..."
8993
export PRESERVE_DOCKER=true && \

contracts/cosmwasm-vm/cw-icon-light-client/src/context.rs

-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,6 @@ mod tests {
539539
let mut contract = CwContext::new(deps.as_mut(), mock_env());
540540

541541
contract.insert_config(&config).unwrap();
542-
543542
contract
544543
.ensure_ibc_host(&Addr::unchecked("regular_host"))
545544
.unwrap()

contracts/cosmwasm-vm/cw-light-client-common/src/light_client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,4 +235,4 @@ impl<C: IContext> ILightClient for IconClient<C> {
235235

236236
Ok(())
237237
}
238-
}
238+
}

docs/e2e-integration-test-setup.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ To run the demo, the following software needs to be installed.
6565
```bash
6666
git clone https://github.com/archway-network/archway/
6767
cd archway
68-
docker build -f Dockerfile.deprecated -t archway . --build-arg arch=aarch64
68+
git checkout v0.5.1
69+
docker build -f Dockerfile.deprecated -t archwaynetwork/archwayd:v0.5.1 . --build-arg arch=aarch64
6970
cd ..
7071
```
7172

@@ -132,7 +133,18 @@ go test -v ./test/e2e -timeout 0
132133
go test -v ./test/integration -timeout 0
133134
```
134135

135-
#### 3. Set Up the Demo Test Environment (Optional)
136+
#### 5. Set Up the Hpchain Test Environment (Optional)
137+
- To execute the end-to-end hopchain tests:
138+
```bash
139+
export TEST_CONFIG_PATH=/home/User/IBC-integration/test/testsuite/sample-config-ics20.yaml;
140+
make e2e-hopchain
141+
```
142+
ℹ️ The hopchain tests expects remote chain deployments with respective keys for each chain in the expected folders and synced with remote chains. To use existing relay config, the config should be placed at /home/User/IBC-integration/test/relayer/data/config/config.yaml and the parameters **ics20_app** should be populated with ics20_app deployed address and the flag **use_existing_config** should be true. To create new connection and channels, the param should be set to false and ics20_app value should be empty. The test case assumes following receiver address to be specified in config which might reqiure some funds to be available.
143+
144+
Necessary configured keys should exist at appropriate location for chain/relayer at /home/User/IBC-integration/test/chains/{chain_name}/data and test/relayer/data/keys/{chain_id}
145+
146+
147+
#### 5. Set Up the Demo Test Environment (Optional)
136148

137149
If necessary, establish the e2e demo test environment by executing the following command:
138150

@@ -142,10 +154,10 @@ make e2e-demo-setup
142154

143155
During the setup process, distinct configuration files are generated in the `test/e2e-demo/ibc-config` directory. These files include contract addresses, along with wallets containing mnemonic/private keys. These keys are essential for conducting subsequent tests.
144156

145-
#### 4. Clean Up the Demo Test Environment (Optional)
157+
#### 6. Clean Up the Demo Test Environment (Optional)
146158

147159
Upon completion of the testing process, if you've set up the e2e demo environment, you can execute the following command to perform a cleanup:
148160

149161
```bash
150162
make e2e-demo-clean
151-
```
163+
```

scripts/execute-test.sh

+8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ e2e_test() {
3939
go test -v ./test/e2e -timeout 0 -count=1
4040
}
4141

42+
e2e_hopchain() {
43+
echo "Running e2e hopchain test..."
44+
go test -v ./test/e2e-hopchain -timeout 0 -count=1
45+
}
46+
4247
e2e_demo() {
4348
echo "Configuring e2e demo..."
4449
export PRESERVE_DOCKER=true && go test -v ./test/e2e-demo -testify.m TestSetup
@@ -117,6 +122,9 @@ case "$test" in
117122
"e2e")
118123
e2e_test
119124
;;
125+
"e2e-hopchain")
126+
e2e_hopchain
127+
;;
120128
"e2e-demo")
121129
e2e_demo
122130
;;
+263
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
# This is a TOML config file.
2+
# For more information, see https://github.com/toml-lang/toml
3+
4+
###############################################################################
5+
### Base Configuration ###
6+
###############################################################################
7+
8+
# The minimum gas prices a validator is willing to accept for processing a
9+
# transaction. A transaction's fees must meet the minimum of any denomination
10+
# specified in this config (e.g. 0.25token1,0.0001token2).
11+
minimum-gas-prices = ""
12+
13+
# default: the last 362880 states are kept, pruning at 10 block intervals
14+
# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node)
15+
# everything: 2 latest states will be kept; pruning at 10 block intervals.
16+
# custom: allow pruning options to be manually specified through 'pruning-keep-recent', and 'pruning-interval'
17+
pruning = "default"
18+
19+
# These are applied if and only if the pruning strategy is custom.
20+
pruning-keep-recent = "0"
21+
pruning-interval = "0"
22+
23+
# HaltHeight contains a non-zero block height at which a node will gracefully
24+
# halt and shutdown that can be used to assist upgrades and testing.
25+
#
26+
# Note: Commitment of state will be attempted on the corresponding block.
27+
halt-height = 0
28+
29+
# HaltTime contains a non-zero minimum block time (in Unix seconds) at which
30+
# a node will gracefully halt and shutdown that can be used to assist upgrades
31+
# and testing.
32+
#
33+
# Note: Commitment of state will be attempted on the corresponding block.
34+
halt-time = 0
35+
36+
# MinRetainBlocks defines the minimum block height offset from the current
37+
# block being committed, such that all blocks past this offset are pruned
38+
# from Tendermint. It is used as part of the process of determining the
39+
# ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates
40+
# that no blocks should be pruned.
41+
#
42+
# This configuration value is only responsible for pruning Tendermint blocks.
43+
# It has no bearing on application state pruning which is determined by the
44+
# "pruning-*" configurations.
45+
#
46+
# Note: Tendermint block pruning is dependant on this parameter in conunction
47+
# with the unbonding (safety threshold) period, state pruning and state sync
48+
# snapshot parameters to determine the correct minimum value of
49+
# ResponseCommit.RetainHeight.
50+
min-retain-blocks = 0
51+
52+
# InterBlockCache enables inter-block caching.
53+
inter-block-cache = true
54+
55+
# IndexEvents defines the set of events in the form {eventType}.{attributeKey},
56+
# which informs Tendermint what to index. If empty, all events will be indexed.
57+
#
58+
# Example:
59+
# ["message.sender", "message.recipient"]
60+
index-events = []
61+
62+
# IavlCacheSize set the size of the iavl tree cache (in number of nodes).
63+
iavl-cache-size = 781250
64+
65+
# IAVLDisableFastNode enables or disables the fast node feature of IAVL.
66+
# Default is false.
67+
iavl-disable-fastnode = false
68+
69+
# IAVLLazyLoading enable/disable the lazy loading of iavl store.
70+
# Default is false.
71+
iavl-lazy-loading = false
72+
73+
# AppDBBackend defines the database backend type to use for the application and snapshots DBs.
74+
# An empty string indicates that a fallback will be used.
75+
# The fallback is the db_backend value set in Tendermint's config.toml.
76+
app-db-backend = ""
77+
78+
###############################################################################
79+
### Telemetry Configuration ###
80+
###############################################################################
81+
82+
[telemetry]
83+
84+
# Prefixed with keys to separate services.
85+
service-name = ""
86+
87+
# Enabled enables the application telemetry functionality. When enabled,
88+
# an in-memory sink is also enabled by default. Operators may also enabled
89+
# other sinks such as Prometheus.
90+
enabled = false
91+
92+
# Enable prefixing gauge values with hostname.
93+
enable-hostname = false
94+
95+
# Enable adding hostname to labels.
96+
enable-hostname-label = false
97+
98+
# Enable adding service to labels.
99+
enable-service-label = false
100+
101+
# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink.
102+
prometheus-retention-time = 0
103+
104+
# GlobalLabels defines a global set of name/value label tuples applied to all
105+
# metrics emitted using the wrapper functions defined in telemetry package.
106+
#
107+
# Example:
108+
# [["chain_id", "cosmoshub-1"]]
109+
global-labels = [
110+
]
111+
112+
###############################################################################
113+
### API Configuration ###
114+
###############################################################################
115+
116+
[api]
117+
118+
# Enable defines if the API server should be enabled.
119+
enable = false
120+
121+
# Swagger defines if swagger documentation should automatically be registered.
122+
swagger = false
123+
124+
# Address defines the API server to listen on.
125+
address = "tcp://localhost:1317"
126+
127+
# MaxOpenConnections defines the number of maximum open connections.
128+
max-open-connections = 1000
129+
130+
# RPCReadTimeout defines the Tendermint RPC read timeout (in seconds).
131+
rpc-read-timeout = 10
132+
133+
# RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds).
134+
rpc-write-timeout = 0
135+
136+
# RPCMaxBodyBytes defines the Tendermint maximum request body (in bytes).
137+
rpc-max-body-bytes = 1000000
138+
139+
# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk).
140+
enabled-unsafe-cors = false
141+
142+
###############################################################################
143+
### Rosetta Configuration ###
144+
###############################################################################
145+
146+
[rosetta]
147+
148+
# Enable defines if the Rosetta API server should be enabled.
149+
enable = false
150+
151+
# Address defines the Rosetta API server to listen on.
152+
address = ":8080"
153+
154+
# Network defines the name of the blockchain that will be returned by Rosetta.
155+
blockchain = "app"
156+
157+
# Network defines the name of the network that will be returned by Rosetta.
158+
network = "network"
159+
160+
# Retries defines the number of retries when connecting to the node before failing.
161+
retries = 3
162+
163+
# Offline defines if Rosetta server should run in offline mode.
164+
offline = false
165+
166+
# EnableDefaultSuggestedFee defines if the server should suggest fee by default.
167+
# If 'construction/medata' is called without gas limit and gas price,
168+
# suggested fee based on gas-to-suggest and denom-to-suggest will be given.
169+
enable-fee-suggestion = false
170+
171+
# GasToSuggest defines gas limit when calculating the fee
172+
gas-to-suggest = 200000
173+
174+
# DenomToSuggest defines the defult denom for fee suggestion.
175+
# Price must be in minimum-gas-prices.
176+
denom-to-suggest = "uatom"
177+
178+
###############################################################################
179+
### gRPC Configuration ###
180+
###############################################################################
181+
182+
[grpc]
183+
184+
# Enable defines if the gRPC server should be enabled.
185+
enable = true
186+
187+
# Address defines the gRPC server address to bind to.
188+
address = "localhost:9090"
189+
190+
# MaxRecvMsgSize defines the max message size in bytes the server can receive.
191+
# The default value is 10MB.
192+
max-recv-msg-size = "10485760"
193+
194+
# MaxSendMsgSize defines the max message size in bytes the server can send.
195+
# The default value is math.MaxInt32.
196+
max-send-msg-size = "2147483647"
197+
198+
###############################################################################
199+
### gRPC Web Configuration ###
200+
###############################################################################
201+
202+
[grpc-web]
203+
204+
# GRPCWebEnable defines if the gRPC-web should be enabled.
205+
# NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op.
206+
enable = true
207+
208+
# Address defines the gRPC-web server address to bind to.
209+
address = "localhost:9091"
210+
211+
# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk).
212+
enable-unsafe-cors = false
213+
214+
###############################################################################
215+
### State Sync Configuration ###
216+
###############################################################################
217+
218+
# State sync snapshots allow other nodes to rapidly join the network without replaying historical
219+
# blocks, instead downloading and applying a snapshot of the application state at a given height.
220+
[state-sync]
221+
222+
# snapshot-interval specifies the block interval at which local state sync snapshots are
223+
# taken (0 to disable).
224+
snapshot-interval = 0
225+
226+
# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all).
227+
snapshot-keep-recent = 2
228+
229+
###############################################################################
230+
### Store / State Streaming ###
231+
###############################################################################
232+
233+
[store]
234+
streamers = []
235+
236+
[streamers]
237+
[streamers.file]
238+
keys = ["*", ]
239+
write_dir = ""
240+
prefix = ""
241+
242+
# output-metadata specifies if output the metadata file which includes the abci request/responses
243+
# during processing the block.
244+
output-metadata = "true"
245+
246+
# stop-node-on-error specifies if propagate the file streamer errors to consensus state machine.
247+
stop-node-on-error = "true"
248+
249+
# fsync specifies if call fsync after writing the files.
250+
fsync = "false"
251+
252+
###############################################################################
253+
### Mempool ###
254+
###############################################################################
255+
256+
[mempool]
257+
# Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool.
258+
# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool.
259+
# Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount.
260+
#
261+
# Note, this configuration only applies to SDK built-in app-side mempool
262+
# implementations.
263+
max-txs = 5000
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This is a TOML config file.
2+
# For more information, see https://github.com/toml-lang/toml
3+
4+
###############################################################################
5+
### Client Configuration ###
6+
###############################################################################
7+
8+
# The network chain ID
9+
chain-id = "localnet-1"
10+
# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory)
11+
keyring-backend = "os"
12+
# CLI output format (text|json)
13+
output = "text"
14+
# <host>:<port> to Tendermint RPC interface for this chain
15+
node = "tcp://localhost:26657"
16+
# Transaction broadcasting mode (sync|async)
17+
broadcast-mode = "sync"

0 commit comments

Comments
 (0)