Skip to content

Commit

Permalink
layer to centauri
Browse files Browse the repository at this point in the history
  • Loading branch information
GNaD13 committed Oct 26, 2023
1 parent ea20497 commit a835d31
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 44 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ comma := ,
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))

# process linker flags
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=layer \
-X github.com/cosmos/cosmos-sdk/version.AppName=layerd \
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=centauri \
-X github.com/cosmos/cosmos-sdk/version.AppName=centaurid \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"
Expand All @@ -86,10 +86,10 @@ endif
all: install

install: go.sum
go install -mod=readonly $(BUILD_FLAGS) ./cmd/layerd
go install -mod=readonly $(BUILD_FLAGS) ./cmd/centaurid

build:
go build $(BUILD_FLAGS) -o bin/layerd ./cmd/layerd
go build $(BUILD_FLAGS) -o bin/centaurid ./cmd/centaurid

docker-build-debug:
@DOCKER_BUILDKIT=1 docker build -t layer:debug -f Dockerfile .
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ import (
)

const (
Name = "layer"
Name = "centauri"
dirName = "banksy"
ForkHeight = 244008
)
Expand Down
2 changes: 1 addition & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ import (

const (
AccountAddressPrefix = "composable"
authorityAddress = "layer10556m38z4x6pqalr9rl5ytf3cff8q46nz002d6" // convert from: centauri10556m38z4x6pqalr9rl5ytf3cff8q46nk85k9m
authorityAddress = "centauri10556m38z4x6pqalr9rl5ytf3cff8q46nk85k9m" // convert from: centauri10556m38z4x6pqalr9rl5ytf3cff8q46nk85k9m
)

type AppKeepers struct {
Expand Down
32 changes: 0 additions & 32 deletions app/upgrades/v6/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ import (

"github.com/notional-labs/composable/v6/app/keepers"
"github.com/notional-labs/composable/v6/app/upgrades"

bech32authmigration "github.com/notional-labs/composable/v6/bech32-migration/auth"
bech32govmigration "github.com/notional-labs/composable/v6/bech32-migration/gov"
bech32slashingmigration "github.com/notional-labs/composable/v6/bech32-migration/slashing"
bech32stakingmigration "github.com/notional-labs/composable/v6/bech32-migration/staking"

authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/notional-labs/composable/v6/bech32-migration/utils"
)

func CreateUpgradeHandler(
Expand All @@ -31,26 +19,6 @@ func CreateUpgradeHandler(
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
// Migration prefix
ctx.Logger().Info("First step: Migrate addresses stored in bech32 form to use new prefix")
keys := keepers.GetKVStoreKey()
bech32stakingmigration.MigrateAddressBech32(ctx, keys[stakingtypes.StoreKey], cdc)
bech32slashingmigration.MigrateAddressBech32(ctx, keys[slashingtypes.StoreKey], cdc)
bech32govmigration.MigrateAddressBech32(ctx, keys[govtypes.StoreKey], cdc)
bech32authmigration.MigrateAddressBech32(ctx, keys[authtypes.StoreKey], cdc)

// allowed relayer address
tfmdk := keepers.TransferMiddlewareKeeper
tfmdk.IterateAllowRlyAddress(ctx, func(rlyAddress string) bool {
// Delete old address
tfmdk.DeleteAllowRlyAddress(ctx, rlyAddress)

// add new address
newRlyAddress := utils.ConvertAccAddr(rlyAddress)
tfmdk.SetAllowRlyAddress(ctx, newRlyAddress)
return false
})

return mm.RunMigrations(ctx, configurator, vm)
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const (
// Bech32Prefix defines the Bech32 prefix used for EthAccounts
Bech32Prefix = "layer"
Bech32Prefix = "centauri"

// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
Bech32PrefixAccAddr = Bech32Prefix
Expand Down Expand Up @@ -40,8 +40,8 @@ func SetupConfig() {
SetAddressPrefixes(config)
config.Seal()

version.AppName = "layer"
version.Name = "layerd"
version.AppName = "centauri"
version.Name = "centaurid"
}

// SetBech32Prefixes sets the global prefixes to be used when serializing addresses and public keys to Bech32 strings.
Expand Down
4 changes: 2 additions & 2 deletions cmd/layerd/main.go → cmd/centaurid/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"

"github.com/notional-labs/composable/v6/app"
cmd "github.com/notional-labs/composable/v6/cmd/layerd/cmd"
cmdcfg "github.com/notional-labs/composable/v6/cmd/layerd/config"
cmd "github.com/notional-labs/composable/v6/cmd/centaurid/cmd"
cmdcfg "github.com/notional-labs/composable/v6/cmd/centaurid/config"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion x/transfermiddleware/ibc_ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
customibctesting "github.com/notional-labs/composable/v6/app/ibctesting"
)

var govAuthorityAddress = "layer10556m38z4x6pqalr9rl5ytf3cff8q46nz002d6" // convert from: centauri10556m38z4x6pqalr9rl5ytf3cff8q46nk85k9m
var govAuthorityAddress = "centauri10556m38z4x6pqalr9rl5ytf3cff8q46nk85k9m" // convert from: centauri10556m38z4x6pqalr9rl5ytf3cff8q46nk85k9m

type TransferTestSuite struct {
suite.Suite
Expand Down

0 comments on commit a835d31

Please sign in to comment.