Skip to content

Commit

Permalink
rename imports from wasmd to nyxd
Browse files Browse the repository at this point in the history
  • Loading branch information
farbanas committed Jul 5, 2023
1 parent 483e021 commit 66bf7cf
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 32 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
25 changes: 13 additions & 12 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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.
Expand Down Expand Up @@ -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,
Expand All @@ -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

Expand Down Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/test_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
15 changes: 3 additions & 12 deletions cmd/nyxd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
5 changes: 3 additions & 2 deletions cmd/nyxd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/ibc_fees_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 66bf7cf

Please sign in to comment.