forked from cosmos/ibc-go
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR #141: Adding github workflows for CoCo, along with testnet c…
…hains * Adding github workflows for coco * Adding CoCo & FreeFlix chains details * updating node details.
- Loading branch information
1 parent
31efb44
commit 498f1c3
Showing
10 changed files
with
166 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: TESTING - coco to ibc integration | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
name: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Install and setup go | ||
- name: Set up Go 1.14 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.14 | ||
id: go | ||
|
||
# checkout relayer | ||
- name: checkout relayer | ||
uses: actions/checkout@v2 | ||
|
||
# build cache | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
# run tests | ||
- name: run coco tests | ||
run: TEST_DEBUG=true make test-coco |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ coverage.out | |
release.tar.gz | ||
.env | ||
nchainz/ | ||
.idea/ |
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,97 @@ | ||
package test | ||
|
||
import ( | ||
"testing" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/iqlusioninc/relayer/relayer" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
var ( | ||
cocoChains = []testChain{ | ||
{"coco-post-chain", cocoTestConfig}, | ||
{"ibc", gaiaTestConfig}, | ||
} | ||
) | ||
|
||
func TestCoCo_CoCoToFFtStreamingRelayer(t *testing.T) { | ||
chains := spinUpTestChains(t, cocoChains...) | ||
|
||
var ( | ||
src = chains.MustGet("coco-post-chain") | ||
dst = chains.MustGet("ibc") | ||
testDenomSrc = "mdm" | ||
testDenomDst = "samoleans" | ||
testCoinSrc = sdk.NewCoin(testDenomSrc, sdk.NewInt(1000)) | ||
twoTestCoinSrc = sdk.NewCoin(testDenomSrc, sdk.NewInt(2000)) | ||
testCoinDst = sdk.NewCoin(testDenomDst, sdk.NewInt(1000)) | ||
twoTestCoinDst = sdk.NewCoin(testDenomDst, sdk.NewInt(2000)) | ||
) | ||
|
||
path, err := genTestPathAndSet(src, dst, "transfer", "transfer") | ||
require.NoError(t, err) | ||
|
||
// query initial balances to compare against at the end | ||
srcExpected, err := src.QueryBalance(src.Key) | ||
require.NoError(t, err) | ||
dstExpected, err := dst.QueryBalance(dst.Key) | ||
require.NoError(t, err) | ||
|
||
// create path | ||
require.NoError(t, src.CreateClients(dst)) | ||
testClientPair(t, src, dst) | ||
require.NoError(t, src.CreateConnection(dst, src.GetTimeout())) | ||
testConnectionPair(t, src, dst) | ||
require.NoError(t, src.CreateChannel(dst, true, src.GetTimeout())) | ||
testChannelPair(t, src, dst) | ||
|
||
// send a couple of transfers to the queue on src | ||
require.NoError(t, src.SendTransferMsg(dst, testCoinSrc, dst.MustGetAddress(), true)) | ||
require.NoError(t, src.SendTransferMsg(dst, testCoinSrc, dst.MustGetAddress(), true)) | ||
|
||
// send a couple of transfers to the queue on dst | ||
require.NoError(t, dst.SendTransferMsg(src, testCoinDst, src.MustGetAddress(), true)) | ||
require.NoError(t, dst.SendTransferMsg(src, testCoinDst, src.MustGetAddress(), true)) | ||
|
||
// Wait for message inclusion in both chains | ||
require.NoError(t, dst.WaitForNBlocks(1)) | ||
|
||
// start the relayer process in it's own goroutine | ||
rlyDone, err := relayer.RunStrategy(src, dst, path.MustGetStrategy(), path.Ordered()) | ||
require.NoError(t, err) | ||
|
||
// send those tokens from dst back to dst and src back to src | ||
require.NoError(t, src.SendTransferMsg(dst, twoTestCoinDst, dst.MustGetAddress(), false)) | ||
require.NoError(t, dst.SendTransferMsg(src, twoTestCoinSrc, src.MustGetAddress(), false)) | ||
|
||
// wait for packet processing | ||
require.NoError(t, dst.WaitForNBlocks(4)) | ||
|
||
// kill relayer routine | ||
rlyDone() | ||
|
||
// check balance on src against expected | ||
srcGot, err := src.QueryBalance(src.Key) | ||
require.NoError(t, err) | ||
require.Equal(t, srcExpected.AmountOf(testDenomSrc).Int64(), srcGot.AmountOf(testDenomSrc).Int64()) | ||
|
||
// check balance on dst against expected | ||
dstGot, err := dst.QueryBalance(dst.Key) | ||
require.NoError(t, err) | ||
require.Equal(t, dstExpected.AmountOf(testDenomDst).Int64(), dstGot.AmountOf(testDenomDst).Int64()) | ||
|
||
// Test the full transfer command as well | ||
require.NoError(t, src.SendTransferBothSides(dst, testCoinSrc, dst.MustGetAddress(), true)) | ||
require.NoError(t, dst.SendTransferBothSides(src, testCoinSrc, src.MustGetAddress(), false)) | ||
|
||
// check balance on src against expected | ||
srcGot, err = src.QueryBalance(src.Key) | ||
require.NoError(t, err) | ||
require.Equal(t, srcExpected.AmountOf(testDenomSrc).Int64(), srcGot.AmountOf(testDenomSrc).Int64()) | ||
|
||
// check balance on dst against expected | ||
dstGot, err = dst.QueryBalance(dst.Key) | ||
require.NoError(t, err) | ||
require.Equal(t, dstExpected.AmountOf(testDenomDst).Int64(), dstGot.AmountOf(testDenomDst).Int64()) | ||
} |
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 @@ | ||
{"key":"faucet","chain-id":"coco-post-chain","rpc-addr":"http://51.178.119.163:26657","account-prefix":"cosmic","gas":200000,"gas-prices":"0.025coco","default-denom":"coco","trusting-period":"330h"} |
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 @@ | ||
{"key":"faucet","chain-id":"freeflix-media-hub","rpc-addr":"http://51.178.119.162:26657","account-prefix":"freeflix","gas":200000,"gas-prices":"0.025fmt","default-denom":"fmt","trusting-period":"330h"} |