From 66bf7cf90cbb4b7c14d0b9f49ea9c7b2fc8d1a36 Mon Sep 17 00:00:00 2001 From: farbanas Date: Wed, 5 Jul 2023 12:01:20 +0200 Subject: [PATCH] rename imports from wasmd to nyxd --- Makefile | 4 ++-- app/app.go | 25 +++++++++++++------------ app/encoding.go | 2 +- app/test_access.go | 2 +- benchmarks/app_test.go | 2 +- cmd/nyxd/main.go | 15 +++------------ cmd/nyxd/root.go | 5 +++-- tests/e2e/ibc_fees_test.go | 2 +- 8 files changed, 25 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index 6971bc68..2ea76c75 100644 --- a/Makefile +++ b/Makefile @@ -58,10 +58,10 @@ VERSION ?= $(shell echo $(shell git describe --tags) | sed 's/^v//') ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=${NYX_APP_NAME} \ -X github.com/cosmos/cosmos-sdk/version.AppName=${NYX_APP_NAME} \ - -X github.com/CosmWasm/wasmd/app.NodeDir=.${NYX_APP_NAME} \ + -X github.com/nymtech/nyxd/app.NodeDir=.${NYX_APP_NAME} \ -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ - -X github.com/CosmWasm/wasmd/app.Bech32Prefix=${BECH32_PREFIX} \ + -X github.com/nymtech/nyxd/app.Bech32Prefix=${BECH32_PREFIX} \ -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" ifeq ($(WITH_CLEVELDB),yes) diff --git a/app/app.go b/app/app.go index 41e220fe..8fb46d42 100644 --- a/app/app.go +++ b/app/app.go @@ -112,12 +112,13 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - wasmappparams "github.com/CosmWasm/wasmd/app/params" "github.com/CosmWasm/wasmd/x/wasm" wasmclient "github.com/CosmWasm/wasmd/x/wasm/client" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + wasmappparams "github.com/nymtech/nyxd/app/params" + // unnamed import of statik for swagger UI support _ "github.com/cosmos/cosmos-sdk/client/docs/statik" ) @@ -126,8 +127,8 @@ const appName = "WasmApp" // We pull these out so we can set them with LDFLAGS in the Makefile var ( - NodeDir = ".wasmd" - Bech32Prefix = "wasm" + NodeDir = ".nyxd" + Bech32Prefix = "nyx" // If EnabledSpecificProposals is "", and this is "true", then enable all x/wasm proposals. // If EnabledSpecificProposals is "", and this is not "true", then disable all x/wasm proposals. @@ -290,14 +291,6 @@ type WasmApp struct { configurator module.Configurator } -// overrideWasmVariables overrides the wasm variables to: -// - allow for larger wasm files -func overrideWasmVariables() { - // Override Wasm size limitation from WASMD. - wasmtypes.MaxWasmSize = 3 * 1024 * 1024 - wasmtypes.MaxProposalWasmSize = wasmtypes.MaxWasmSize -} - // NewWasmApp returns a reference to an initialized WasmApp. func NewWasmApp( logger log.Logger, @@ -313,7 +306,7 @@ func NewWasmApp( wasmOpts []wasm.Option, baseAppOptions ...func(*baseapp.BaseApp), ) *WasmApp { - overrideWasmVariables() + OverrideWasmVariables() appCodec, legacyAmino := encodingConfig.Marshaler, encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry @@ -1018,3 +1011,11 @@ func (app *WasmApp) registerStoreUpgrades(upgradeInfo storetypes.UpgradeInfo) { app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) } } + +// overrideWasmVariables overrides the wasm variables to: +// - allow for larger wasm files +func OverrideWasmVariables() { + // Override Wasm size limitation from WASMD. + wasmtypes.MaxWasmSize = 1256 * 1024 // Set MaxWasmSize to 1.2MB + wasmtypes.MaxProposalWasmSize = wasmtypes.MaxWasmSize +} diff --git a/app/encoding.go b/app/encoding.go index 5416f77a..8d0f6d2f 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -3,7 +3,7 @@ package app import ( "github.com/cosmos/cosmos-sdk/std" - "github.com/CosmWasm/wasmd/app/params" + "github.com/nymtech/nyxd/app/params" ) // MakeEncodingConfig creates a new EncodingConfig with all modules registered diff --git a/app/test_access.go b/app/test_access.go index 51b8bb99..71c43285 100644 --- a/app/test_access.go +++ b/app/test_access.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" - "github.com/CosmWasm/wasmd/app/params" + "github.com/nymtech/nyxd/app/params" "github.com/cosmos/cosmos-sdk/codec" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" diff --git a/benchmarks/app_test.go b/benchmarks/app_test.go index 88773e6b..5c175e74 100644 --- a/benchmarks/app_test.go +++ b/benchmarks/app_test.go @@ -21,9 +21,9 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/CosmWasm/wasmd/app" "github.com/CosmWasm/wasmd/x/wasm" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/nymtech/nyxd/app" ) func setup(db dbm.DB, withGenesis bool, invCheckPeriod uint, opts ...wasm.Option) (*app.WasmApp, app.GenesisState) { diff --git a/cmd/nyxd/main.go b/cmd/nyxd/main.go index 289764a5..93ad89ed 100644 --- a/cmd/nyxd/main.go +++ b/cmd/nyxd/main.go @@ -3,15 +3,14 @@ package main import ( "os" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - - "github.com/CosmWasm/wasmd/app" + + "github.com/nymtech/nyxd/app" ) func main() { - overrideWasmVariables() + app.OverrideWasmVariables() rootCmd, _ := NewRootCmd() if err := svrcmd.Execute(rootCmd, app.DefaultNodeHome); err != nil { @@ -24,11 +23,3 @@ func main() { } } } - -// overrideWasmVariables overrides the wasm variables to: -// - allow for larger wasm files -func overrideWasmVariables() { - // Override Wasm size limitation from WASMD. - wasmtypes.MaxWasmSize = 3 * 1024 * 1024 - wasmtypes.MaxProposalWasmSize = wasmtypes.MaxWasmSize -} diff --git a/cmd/nyxd/root.go b/cmd/nyxd/root.go index c392c49a..95cf51f9 100644 --- a/cmd/nyxd/root.go +++ b/cmd/nyxd/root.go @@ -31,11 +31,12 @@ import ( "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" - "github.com/CosmWasm/wasmd/app" - "github.com/CosmWasm/wasmd/app/params" "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + + "github.com/nymtech/nyxd/app" + "github.com/nymtech/nyxd/app/params" ) // NewRootCmd creates a new root command for wasmd. It is called once in the diff --git a/tests/e2e/ibc_fees_test.go b/tests/e2e/ibc_fees_test.go index fa315ffe..76ad6699 100644 --- a/tests/e2e/ibc_fees_test.go +++ b/tests/e2e/ibc_fees_test.go @@ -17,9 +17,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/CosmWasm/wasmd/app" wasmibctesting "github.com/CosmWasm/wasmd/x/wasm/ibctesting" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/nymtech/nyxd/app" ) func TestIBCFeesTransfer(t *testing.T) {