-
Notifications
You must be signed in to change notification settings - Fork 834
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests(e2e): Osmosis e2e tests (#2029)
* cosmoswasm artifacts * first pass * run make format * add comments * run make format * fix lint * fix wrong params * lint code * lint code * refactor utils func * update osmosis ver * update compile contracts script * enable osmosis outpost * update bins & add contract patch * remove unnecessary dump to file * update app.go with bank keeper in availablePrecompiles * refactor * update test setup for contract v1 * remove unnecessary changes * make format * fix lint issues * fix lint issues * add channel patch * update comment * fix lint issues * fix lint issues * Apply suggestions from code review Co-authored-by: stepit <48993133+0xstepit@users.noreply.github.com> * address review comments * fix onFailDelivery unit test * fix gosec issues * Update precompiles/outposts/osmosis/types.go --------- Co-authored-by: facs95 <facs95@users.noreply.github.com> Co-authored-by: tom <tomasguerraalda@hotmail.com> Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com> Co-authored-by: stepit <48993133+0xstepit@users.noreply.github.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
- Loading branch information
1 parent
cfad1ee
commit 8a890e2
Showing
17 changed files
with
672 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Compiling CosmWasm contracts" | ||
|
||
# For the osmosis outpost we're using the v1 of the | ||
# crosschain swap contract. This is available in v15.x | ||
OSMOSIS_VERSION=v15.2.0 | ||
# For this script to work properly | ||
# We need to copy the contents of the cosmwasm folder of the | ||
# Osmosis repo (https://github.com/osmosis-labs/osmosis/tree/v20.2.1/cosmwasm) | ||
# into the ./tests/nix_tests/cosmwasm folder | ||
|
||
git clone -b $OSMOSIS_VERSION --single-branch https://github.com/osmosis-labs/osmosis.git /tmp/osmosis | ||
|
||
cp -r /tmp/osmosis/cosmwasm/* ./tests/nix_tests/cosmwasm | ||
rm -rf /tmp/osmosis | ||
|
||
cd ./tests/nix_tests/cosmwasm || exit | ||
# This command compiles the contracts for x86-64 (amd64) arch | ||
docker run --rm -v "$(pwd)":/code \ | ||
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/target \ | ||
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ | ||
cosmwasm/workspace-optimizer:0.15.0 | ||
|
||
# Remove all files and subdirectories except 'artifacts' | ||
# where the compiled contracts are located | ||
find . -mindepth 1 -maxdepth 1 ! -name 'artifacts' -exec rm -r {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/x/evm/keeper/precompiles.go b/x/evm/keeper/precompiles.go | ||
index b0aa3202..39668025 100644 | ||
--- a/x/evm/keeper/precompiles.go | ||
+++ b/x/evm/keeper/precompiles.go | ||
@@ -88,8 +88,10 @@ func AvailablePrecompiles( | ||
panic(fmt.Errorf("failed to instantiate stride outpost: %w", err)) | ||
} | ||
|
||
+ // Update the channel for the corresponding one in the | ||
+ // Nix testing setup | ||
osmosisOutpost, err := osmosisoutpost.NewPrecompile( | ||
- transfertypes.PortID, "channel-215", | ||
+ transfertypes.PortID, "channel-0", | ||
osmosisoutpost.XCSContractTestnet, | ||
authzKeeper, bankKeeper, transferKeeper, stakingKeeper, erc20Keeper, channelKeeper, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ pkgs ? import ../../../nix { } }: | ||
let evmosd = (pkgs.callPackage ../../../. { }); | ||
in | ||
evmosd.overrideAttrs (oldAttrs: { | ||
# Patch the evmos binary to: | ||
# - allow to register WEVMOS token pair | ||
# - use the CrossChainSwap contract address in the testing setup | ||
# - update the corresponding IBC channel to match the tests setup | ||
patches = oldAttrs.patches or [ ] ++ [ | ||
./allow-wevmos-register.patch | ||
./xcs-osmosis-contract.patch | ||
./osmosis-channel.patch | ||
]; | ||
}) | ||
|
Oops, something went wrong.