-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* proto * change name to banksyd * describe for proto * describe for proto * add middleware module * temp ibc func * update genesis and msg server * Onrecvpacket implementation based on Vuong's idea (#88) * init setup test * Add workflow * Add more test and fix bug relevant go.mod * update makefile * ChainCongfig.Images must be >1 * uidgid * ignore go.work and go.work.sum * add push wasm test * add push wasm test workflow * use notional-labs/interchaintest to custom command push wasm * use feat/hyperspace * use new version * request body too large * use v7.0.4 * update push_wasm test * update ibc test * latest * use v7.0.5 * use v7.0.5 * use 7.0.6 * update UidGid to pass permission * increase timeout * v7.0.7 * onrecvpacket implementation * use v7.0.8 * use v7.0.8 * correct logic * go mod tidy * Mint native coin and escrow ibc token * move onrecvpacket code to relay file * add test and mock for test * go mod tidy * test helper * test-helper * bump test_helpers * use 7.1.0 * wait some block * change uidgid 1025:1025 * not mintfund * revert uidgid * add protogen * query proto * query proto * grpc query * grpc query * cli * ibctesting * relay test * module * module * go.mod * update testcase: working middleware flow * remove redundant mock for test * go mod tidy * redundant fmt import * remove redundant println * refactor relay test * use 7.1.1 * ibcmiddleware stack * Onrecvpacket refactor * use v7.1.2 * OnTimeoutPacket implementation * Onrecvpacket implementation fix * fix relay_test.go * using custom simapp * OnTimeoutPacket implementation * go mod tidy and resolve conflict * Review on recv packet (#107) * update genesis and msg server * add secondary index, check IBCdenom in recv packet --------- Co-authored-by: ducnt87 <ntd1312000@gmail.com> Co-authored-by: phamminh0811 <1phamminh0811@gmail.com> Co-authored-by: vuong <56973102+vuong177@users.noreply.github.com> * refactor app.go * proto fix: move to use cosmos/gogoproto * fix: conflic in go dependency --------- Co-authored-by: Lặc <67097720+expertdicer@users.noreply.github.com> Co-authored-by: ducnt87 <ntd1312000@gmail.com> Co-authored-by: phamminh0811 <1phamminh0811@gmail.com>
- Loading branch information
1 parent
aa95529
commit 816f3af
Showing
88 changed files
with
12,683 additions
and
28 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,60 @@ | ||
name: Interchain Tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test-start-cosmos-chain: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- run: make ictest-start-cosmos | ||
|
||
test-start-polkadot-chain: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- run: make ictest-start-polkadot | ||
|
||
test-ibc-transfer: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- run: make ictest-ibc | ||
|
||
test-push-wasm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- run: make ictest-push-wasm |
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,98 @@ | ||
package helpers | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"testing" | ||
"time" | ||
|
||
dbm "github.com/cometbft/cometbft-db" | ||
abci "github.com/cometbft/cometbft/abci/types" | ||
"github.com/cometbft/cometbft/libs/log" | ||
tmrand "github.com/cometbft/cometbft/libs/rand" | ||
abcitypes1 "github.com/cometbft/cometbft/proto/tendermint/types" | ||
tmproto "github.com/cometbft/cometbft/proto/tendermint/types" | ||
tmtypes "github.com/cometbft/cometbft/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
banksy "github.com/notional-labs/banksy/v2/app" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
// SimAppChainID hardcoded chainID for simulation | ||
const ( | ||
SimAppChainID = "fee-app" | ||
) | ||
|
||
// DefaultConsensusParams defines the default Tendermint consensus params used | ||
// in feeapp testing. | ||
var DefaultConsensusParams = &abcitypes1.ConsensusParams{ | ||
Block: &abcitypes1.BlockParams{ | ||
MaxBytes: 200000, | ||
MaxGas: 2000000, | ||
}, | ||
Evidence: &tmproto.EvidenceParams{ | ||
MaxAgeNumBlocks: 302400, | ||
MaxAgeDuration: 504 * time.Hour, // 3 weeks is the max duration | ||
MaxBytes: 10000, | ||
}, | ||
Validator: &tmproto.ValidatorParams{ | ||
PubKeyTypes: []string{ | ||
tmtypes.ABCIPubKeyTypeEd25519, | ||
}, | ||
}, | ||
} | ||
|
||
type EmptyAppOptions struct{} | ||
|
||
func (EmptyAppOptions) Get(o string) interface{} { return nil } | ||
|
||
func NewContextForApp(app banksy.BanksyApp) sdk.Context { | ||
ctx := app.BaseApp.NewContext(false, tmproto.Header{ | ||
ChainID: fmt.Sprintf("test-chain-%s", tmrand.Str(4)), | ||
Height: 1, | ||
}) | ||
return ctx | ||
} | ||
|
||
func Setup(t *testing.T, isCheckTx bool, invCheckPeriod uint) *banksy.BanksyApp { | ||
t.Helper() | ||
|
||
app, genesisState := setup(!isCheckTx, invCheckPeriod) | ||
if !isCheckTx { | ||
// InitChain must be called to stop deliverState from being nil | ||
stateBytes, err := json.MarshalIndent(genesisState, "", " ") | ||
require.NoError(t, err) | ||
|
||
// Initialize the chain | ||
app.InitChain( | ||
abci.RequestInitChain{ | ||
Validators: []abci.ValidatorUpdate{}, | ||
ConsensusParams: DefaultConsensusParams, | ||
AppStateBytes: stateBytes, | ||
}, | ||
) | ||
} | ||
|
||
return app | ||
} | ||
|
||
func setup(withGenesis bool, invCheckPeriod uint) (*banksy.BanksyApp, banksy.GenesisState) { | ||
db := dbm.NewMemDB() | ||
encCdc := banksy.MakeEncodingConfig() | ||
app := banksy.NewBanksyApp( | ||
log.NewNopLogger(), | ||
db, | ||
nil, | ||
true, | ||
map[int64]bool{}, | ||
banksy.DefaultNodeHome, | ||
invCheckPeriod, | ||
encCdc, | ||
EmptyAppOptions{}, | ||
) | ||
if withGenesis { | ||
return app, banksy.NewDefaultGenesisState() | ||
} | ||
|
||
return app, banksy.GenesisState{} | ||
} |
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,2 @@ | ||
# testing package for ibc | ||
Customized version of cosmos-sdk x/ibc/testing and CosmWasm wasmd x/wasm/ibctesting |
Oops, something went wrong.