Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terra localnet #405

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
76358d4
Init setup for e2e-test
phamminh0811 Jan 3, 2024
91f347f
Add chain to e2e
phamminh0811 Jan 3, 2024
253e2c2
add io to e2e
DongLieu Jan 3, 2024
554eb69
Add local.Dockerfile to build e2e
phamminh0811 Jan 6, 2024
8164fdc
add localterra and fix local dockerfile workdir
expertdicer Jan 8, 2024
e916648
add localrelayer setup
expertdicer Jan 8, 2024
95572ca
support both amd64 and arm64 in local Dockerfile and add right hd-pat…
expertdicer Jan 9, 2024
4a560ea
change to ubuntu 23.04
expertdicer Jan 9, 2024
a367697
remove faucet and add delay in hermes start
expertdicer Jan 10, 2024
ba19b6d
bytecodes and scripts for ibc-hooks
expertdicer Jan 10, 2024
d9cb3c1
update readme
expertdicer Jan 10, 2024
7dc6a45
fix ibc hooks test scripts and counter bytecode
expertdicer Jan 10, 2024
cc11f33
add local terra c chain
expertdicer Jan 10, 2024
685769c
add apptesting
expertdicer Jan 11, 2024
01b53bf
fix app to compatible with ibctesting.TestChain
expertdicer Jan 11, 2024
9ba2410
ibc-hooks scripts test
expertdicer Jan 11, 2024
2f468ea
update localrelayer
expertdicer Jan 13, 2024
6c1346f
add ibctesting
expertdicer Jan 13, 2024
c8d00ed
scripts for pfm test
expertdicer Jan 13, 2024
afb4ae0
fix pfm and pfm subspace
expertdicer Jan 13, 2024
ca0ed06
minor fix
expertdicer Jan 14, 2024
16a8096
forward middleware module setup
expertdicer Jan 14, 2024
05bf1df
go mod tidy
expertdicer Jan 14, 2024
f056561
ibchooks testutil
expertdicer Jan 14, 2024
bb59cd6
remove redundant e2e tests
expertdicer Jan 15, 2024
2bb70c7
rm e2e.mk
expertdicer Jan 15, 2024
5d4b21d
Remove e2e cmd in Makefile
expertdicer Jan 15, 2024
a1a075d
lint
expertdicer Jan 15, 2024
fb33efe
remove apptesting
expertdicer Jan 15, 2024
3b6990b
remove terratesting and changes in app.go
expertdicer Jan 15, 2024
14fbf2c
remove test_helpers and mod tidy
expertdicer Jan 15, 2024
19d574c
merge main
phamminh0811 Jan 29, 2024
c403fe8
remove not related test
phamminh0811 Jan 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,20 @@ localnet-stop:
rm -rf build/node*
rm -rf build/gentxs

localnet-keys:
. scripts/localterra/scripts/add_keys.sh

localnet-init: localnet-clean localnet-build

localnet-clean:
@rm -rfI $(HOME)/.terrad-local/

localnet-build:
@DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f scripts/localterra/docker-compose.yml build

localnet-starts:
@STATE="" docker-compose -f scripts/localterra/docker-compose.yml up

.PHONY: localnet-start localnet-stop

###############################################################################
Expand Down
8 changes: 7 additions & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package keepers
import (
"path/filepath"

forward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6/router"
forwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6/router/keeper"
forwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6/router/types"
icacontrollerkeeper "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller/keeper"
Expand Down Expand Up @@ -108,6 +109,7 @@ type AppKeepers struct {
Ics20WasmHooks *ibchooks.WasmHooks
IBCHooksWrapper *ibchooks.ICS4Middleware
TransferStack ibctransfer.IBCModule
ForwardModule forward.AppModule

// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
Expand Down Expand Up @@ -375,14 +377,16 @@ func NewAppKeepers(
appCodec,
appKeepers.keys[ibctransfertypes.StoreKey],
appKeepers.GetSubspace(ibctransfertypes.ModuleName),
appKeepers.IBCHooksWrapper,
StrathCole marked this conversation as resolved.
Show resolved Hide resolved
&appKeepers.ForwardKeeper,
appKeepers.IBCKeeper.ChannelKeeper,
&appKeepers.IBCKeeper.PortKeeper,
appKeepers.AccountKeeper,
appKeepers.BankKeeper,
scopedTransferKeeper,
)

appKeepers.ForwardKeeper.SetTransferKeeper(appKeepers.TransferKeeper)

wasmConfig, err := wasm.ReadWasmConfig(appOpts)
if err != nil {
panic("error while reading wasm config: " + err.Error())
Expand Down Expand Up @@ -471,6 +475,7 @@ func NewAppKeepers(
appKeepers.ScopedIBCFeeKeeper = scopedIBCFeeKeeper
appKeepers.ScopedWasmKeeper = scopedWasmKeeper

appKeepers.ForwardModule = forward.NewAppModule(&appKeepers.ForwardKeeper)
// Create static IBC router, add transfer route, then set and seal it
ibcRouter := appKeepers.newIBCRouter()
appKeepers.IBCKeeper.SetRouter(ibcRouter)
Expand Down Expand Up @@ -505,6 +510,7 @@ func initParamsKeeper(
paramsKeeper.Subspace(wasmtypes.ModuleName)
paramsKeeper.Subspace(dyncommtypes.ModuleName)
paramsKeeper.Subspace(ibchooktypes.ModuleName)
paramsKeeper.Subspace(forwardtypes.ModuleName).WithKeyTable(forwardtypes.ParamKeyTable())

return paramsKeeper
}
Expand Down
8 changes: 8 additions & 0 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ import (
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
forward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6/router"
forwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6/router/types"

terraappparams "github.com/classic-terra/core/v2/app/params"

Expand Down Expand Up @@ -117,6 +119,7 @@ var (
customfeegrant.AppModuleBasic{},
ibc.AppModuleBasic{},
ica.AppModuleBasic{},
forward.AppModuleBasic{},
customupgrade.AppModuleBasic{},
customevidence.AppModuleBasic{},
transfer.AppModuleBasic{},
Expand Down Expand Up @@ -192,6 +195,7 @@ func appModules(
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
dyncomm.NewAppModule(appCodec, app.DyncommKeeper, app.StakingKeeper),
ibchooks.NewAppModule(app.AccountKeeper),
app.ForwardModule,
}
}

Expand Down Expand Up @@ -224,6 +228,7 @@ func simulationModules(
treasury.NewAppModule(appCodec, app.TreasuryKeeper),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
dyncomm.NewAppModule(appCodec, app.DyncommKeeper, app.StakingKeeper),
app.ForwardModule,
}
}

Expand All @@ -248,6 +253,7 @@ func orderBeginBlockers() []string {
ibchost.ModuleName,
ibctransfertypes.ModuleName,
icatypes.ModuleName,
forwardtypes.ModuleName,
ibcfeetypes.ModuleName,
ibchooktypes.ModuleName,
// Terra Classic modules
Expand Down Expand Up @@ -280,6 +286,7 @@ func orderEndBlockers() []string {
ibchost.ModuleName,
ibctransfertypes.ModuleName,
icatypes.ModuleName,
forwardtypes.ModuleName,
ibcfeetypes.ModuleName,
ibchooktypes.ModuleName,
// Terra Classic modules
Expand Down Expand Up @@ -312,6 +319,7 @@ func orderInitGenesis() []string {
ibchost.ModuleName,
ibctransfertypes.ModuleName,
icatypes.ModuleName,
forwardtypes.ModuleName,
ibcfeetypes.ModuleName,
ibchooktypes.ModuleName,
// Terra Classic modules
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/runc v1.1.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand Down
Loading
Loading