Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamer-zq committed Jul 1, 2024
1 parent 042f58b commit d081713
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 201 deletions.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,37 @@ IRISnet Modules

**Note**: This repository is meant to house modules that are created outside of the [IRIS Hub](https://github.com/irisnet/irishub) repository.

**Note**: Requires [Go 1.18+](https://golang.org/dl/)
**Note**: Requires [Go 1.19+](https://golang.org/dl/)

## Version Matrix

The version matrix below shows which versions of the IRISnet Modules, modules and libraries are compatible with each other.

### Module Dependencies

Module Dependencies are the modules that a application may depend on and which version of the Cosmos SDK they are compatible with.

| modules | versions | Cosmos SDK |
| --------------------------------- | -------- | ---------- |
| mods.irisnet.org/api | main | v0.47.x |
| | v1.0.0 | v0.47.x |
| mods.irisnet.org/simapp | main | v0.47.x |
| | v1.0.0 | v0.47.x |
| mods.irisnet.org/modules/coinswap | main | v0.47.x |
| | v1.0.0 | v0.47.x |
| mods.irisnet.org/modules/htlc | main | v0.47.x |
| | v1.0.0 | v0.47.x |
| mods.irisnet.org/modules/mt | main | v0.47.x |
| | v1.0.0 | v0.47.x |
| mods.irisnet.org/modules/nft | main | v0.47.x |
| | v1.0.0 | v0.47.x |
| mods.irisnet.org/modules/oracle | main | v0.47.x |
| | v1.0.0 | v0.47.x |
| mods.irisnet.org/modules/random | main | v0.47.x |
| | v1.0.0 | v0.47.x |
| mods.irisnet.org/modules/record | main | v0.47.x |
| | v1.0.0 | v0.47.x |
| mods.irisnet.org/modules/service | main | v0.47.x |
| | v1.0.0 | v0.47.x |
| mods.irisnet.org/modules/token | main | v0.47.x |
| | v1.0.0 | v0.47.x |
13 changes: 2 additions & 11 deletions e2e/coinswap/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,10 @@ type QueryTestSuite struct {

// SetupSuite creates a new network for integration tests
func (s *QueryTestSuite) SetupSuite() {
depInjectOptions := simapp.DepinjectOptions{
Config: e2e.AppConfig,
Providers: []interface{}{
e2e.ProvideEVMKeeper(),
e2e.ProvideICS20Keeper(),
},
}
sdk.SetCoinDenomRegex(func() string {
sdk.SetCoinDenomRegex(func() string {
return `[a-zA-Z][a-zA-Z0-9/\-]{2,127}`
})

s.T().Log("setting up integration test suite")
s.Network = simapp.SetupNetwork(s.T(),depInjectOptions)
s.TestSuite.SetupSuite()
}

// TestCoinswap tests all query command in the nft module
Expand Down
16 changes: 2 additions & 14 deletions e2e/farm/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
farmcli "mods.irisnet.org/modules/farm/client/cli"
farmtypes "mods.irisnet.org/modules/farm/types"
tokentypes "mods.irisnet.org/modules/token/types/v1"
"mods.irisnet.org/simapp"
)

// QueryTestSuite is a suite of end-to-end tests for the farm module
Expand All @@ -26,21 +25,10 @@ type QueryTestSuite struct {

// SetupSuite creates a new network for integration tests
func (s *QueryTestSuite) SetupSuite() {
s.T().Log("setting up integration test suite")

depInjectOptions := simapp.DepinjectOptions{
Config: e2e.AppConfig,
Providers: []interface{}{
e2e.ProvideEVMKeeper(),
e2e.ProvideICS20Keeper(),
},
}

s.T().Log("setting up integration test suite")
s.Network = simapp.SetupNetwork(s.T(),depInjectOptions)
sdk.SetCoinDenomRegex(func() string {
return `[a-zA-Z][a-zA-Z0-9/\-]{2,127}`
})
s.TestSuite.SetupSuite()
}

// TestQueryCmd tests all query command in the farm module
Expand All @@ -55,7 +43,7 @@ func (s *QueryTestSuite) TestQueryCmd() {

creator := val.Address
description := "iris-atom farm pool"
startHeight := s.latestHeight() + 1
startHeight := s.latestHeight() + 2
rewardPerBlock := sdk.NewCoins(sdk.NewCoin(s.BondDenom, sdk.NewInt(10)))
lpTokenDenom := "lpt-1"
totalReward := sdk.NewCoins(sdk.NewCoin(s.BondDenom, sdk.NewInt(1000)))
Expand Down
2 changes: 1 addition & 1 deletion e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ require (
github.com/cometbft/cometbft v0.37.4
github.com/cosmos/cosmos-sdk v0.47.9
github.com/cosmos/gogoproto v1.4.10
github.com/ethereum/go-ethereum v1.10.26
github.com/stretchr/testify v1.8.4
google.golang.org/protobuf v1.32.0
mods.irisnet.org/api v1.0.0-beta
Expand Down Expand Up @@ -77,6 +76,7 @@ require (
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
github.com/ethereum/go-ethereum v1.10.26 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/getsentry/sentry-go v0.23.0 // indirect
Expand Down
5 changes: 3 additions & 2 deletions e2e/htlc/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"mods.irisnet.org/e2e"
htlccli "mods.irisnet.org/modules/htlc/client/cli"
htlctypes "mods.irisnet.org/modules/htlc/types"
"mods.irisnet.org/modules/token/keeper"
"mods.irisnet.org/simapp"
)

Expand Down Expand Up @@ -63,8 +64,8 @@ func (s *TxTestSuite) SetupSuite() {
depInjectOptions := simapp.DepinjectOptions{
Config: e2e.AppConfig,
Providers: []interface{}{
e2e.ProvideEVMKeeper(),
e2e.ProvideICS20Keeper(),
keeper.ProvideMockEVM(),
keeper.ProvideMockICS20(),
},
}

Expand Down
170 changes: 0 additions & 170 deletions e2e/mock.go

This file was deleted.

5 changes: 3 additions & 2 deletions e2e/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/cosmos/cosmos-sdk/testutil/network"
"github.com/stretchr/testify/suite"

"mods.irisnet.org/modules/token/keeper"
"mods.irisnet.org/simapp"
)

Expand All @@ -24,8 +25,8 @@ func (s *TestSuite) SetupSuite() {
depInjectOptions := simapp.DepinjectOptions{
Config: AppConfig,
Providers: []interface{}{
ProvideEVMKeeper(),
ProvideICS20Keeper(),
keeper.ProvideMockEVM(),
keeper.ProvideMockICS20(),
},
}
if s.modifyConfigFn == nil {
Expand Down

0 comments on commit d081713

Please sign in to comment.