diff --git a/app/apptesting/test_suite.go b/app/apptesting/test_suite.go index 31577885b..6264a7883 100644 --- a/app/apptesting/test_suite.go +++ b/app/apptesting/test_suite.go @@ -56,7 +56,7 @@ func (s *KeeperTestHelper) CreateRollappByName(name string) { InitialSequencer: "*", Alias: strings.ToLower(rand.Str(7)), VmType: rollapptypes.Rollapp_EVM, - GenesisInfo: rollapptypes.GenesisInfo{ + GenesisInfo: &rollapptypes.GenesisInfo{ Bech32Prefix: strings.ToLower(rand.Str(3)), GenesisChecksum: "1234567890abcdefg", InitialSupply: sdk.NewInt(1000), diff --git a/ibctesting/utils_test.go b/ibctesting/utils_test.go index ff5545653..49d21d38d 100644 --- a/ibctesting/utils_test.go +++ b/ibctesting/utils_test.go @@ -135,7 +135,7 @@ func (s *utilSuite) createRollapp(transfersEnabled bool, channelID *string) { Telegram: "https://t.me/rolly", X: "https://x.dymension.xyz", }, - rollapptypes.GenesisInfo{ + &rollapptypes.GenesisInfo{ GenesisChecksum: "somechecksum", Bech32Prefix: "eth", NativeDenom: &rollapptypes.DenomMetadata{ diff --git a/proto/dymensionxyz/dymension/rollapp/tx.proto b/proto/dymensionxyz/dymension/rollapp/tx.proto index 00633ef4b..bf5f4fe17 100644 --- a/proto/dymensionxyz/dymension/rollapp/tx.proto +++ b/proto/dymensionxyz/dymension/rollapp/tx.proto @@ -37,7 +37,7 @@ message MsgCreateRollapp { // metadata is the rollapp metadata RollappMetadata metadata = 13; // genesis_info is the genesis information - GenesisInfo genesis_info = 14 [(gogoproto.nullable) = false ]; + GenesisInfo genesis_info = 14 [(gogoproto.nullable) = true ]; // vm_type is the type of rollapp machine: EVM or WASM Rollapp.VMType vm_type = 15; } @@ -59,7 +59,7 @@ message MsgUpdateRollappInformation { // metadata is the rollapp metadata RollappMetadata metadata = 5 [(gogoproto.nullable) = true ]; // genesis_info is the genesis information - GenesisInfo genesis_info = 6 [(gogoproto.nullable) = false ]; + GenesisInfo genesis_info = 6 [(gogoproto.nullable) = true ]; } message MsgUpdateRollappInformationResponse { diff --git a/x/denommetadata/ibc_middleware.go b/x/denommetadata/ibc_middleware.go index b9276c1dc..dcbd7c4c2 100644 --- a/x/denommetadata/ibc_middleware.go +++ b/x/denommetadata/ibc_middleware.go @@ -90,6 +90,10 @@ func (im IBCModule) OnRecvPacket( return uevent.NewErrorAcknowledgement(ctx, gerrc.ErrNotFound) } + if im.keeper.HasDenomMetadata(ctx, ibcDenom) { + return im.IBCModule.OnRecvPacket(ctx, packet, relayer) + } + dm.Base = ibcDenom dm.DenomUnits[0].Denom = dm.Base diff --git a/x/denommetadata/ibc_middleware_test.go b/x/denommetadata/ibc_middleware_test.go index b9ed3e6ca..60798e5d9 100644 --- a/x/denommetadata/ibc_middleware_test.go +++ b/x/denommetadata/ibc_middleware_test.go @@ -596,7 +596,7 @@ func (m *mockIBCModule) OnRecvPacket(_ sdk.Context, p channeltypes.Packet, _ sdk return emptyResult } -func (m *mockIBCModule) OnAcknowledgementPacket(_ sdk.Context, _ channeltypes.Packet, ack []byte, _ sdk.AccAddress) error { +func (m *mockIBCModule) OnAcknowledgementPacket(sdk.Context, channeltypes.Packet, []byte, sdk.AccAddress) error { return nil } @@ -604,7 +604,11 @@ type mockDenomMetadataKeeper struct { hasDenomMetaData, created bool } -func (m *mockDenomMetadataKeeper) CreateDenomMetadata(ctx sdk.Context, metadata banktypes.Metadata) error { +func (m *mockDenomMetadataKeeper) HasDenomMetadata(sdk.Context, string) bool { + return true +} + +func (m *mockDenomMetadataKeeper) CreateDenomMetadata(sdk.Context, banktypes.Metadata) error { m.created = true return nil } diff --git a/x/denommetadata/types/expected_keepers.go b/x/denommetadata/types/expected_keepers.go index 374281ce1..3fb289268 100644 --- a/x/denommetadata/types/expected_keepers.go +++ b/x/denommetadata/types/expected_keepers.go @@ -3,6 +3,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/types" + rollapptypes "github.com/dymensionxyz/dymension/v3/x/rollapp/types" ) @@ -14,6 +15,7 @@ type BankKeeper interface { type DenomMetadataKeeper interface { CreateDenomMetadata(ctx sdk.Context, metadata types.Metadata) error + HasDenomMetadata(ctx sdk.Context, base string) bool } type RollappKeeper interface { diff --git a/x/incentives/client/cli/query_test.go b/x/incentives/client/cli/query_test.go index f61aeb62d..1f6e907ef 100644 --- a/x/incentives/client/cli/query_test.go +++ b/x/incentives/client/cli/query_test.go @@ -34,7 +34,7 @@ func (suite *QueryTestSuite) CreateDefaultRollapp() string { RollappId: urand.RollappID(), Alias: strings.ToLower(tmrand.Str(7)), VmType: rollapptypes.Rollapp_EVM, - GenesisInfo: rollapptypes.GenesisInfo{ + GenesisInfo: &rollapptypes.GenesisInfo{ Bech32Prefix: strings.ToLower(tmrand.Str(3)), }, } diff --git a/x/incentives/keeper/suite_test.go b/x/incentives/keeper/suite_test.go index 2cd38ea61..0863f1d14 100644 --- a/x/incentives/keeper/suite_test.go +++ b/x/incentives/keeper/suite_test.go @@ -212,7 +212,7 @@ func (suite *KeeperTestSuite) CreateDefaultRollapp(addr sdk.AccAddress) string { InitialSequencer: addr.String(), Alias: strings.ToLower(tmrand.Str(7)), VmType: rollapptypes.Rollapp_EVM, - GenesisInfo: rollapptypes.GenesisInfo{ + GenesisInfo: &rollapptypes.GenesisInfo{ Bech32Prefix: strings.ToLower(tmrand.Str(3)), GenesisChecksum: "checksum", NativeDenom: &rollapptypes.DenomMetadata{ diff --git a/x/rollapp/client/cli/tx_create_rollapp.go b/x/rollapp/client/cli/tx_create_rollapp.go index 0d6ada235..550348ed9 100644 --- a/x/rollapp/client/cli/tx_create_rollapp.go +++ b/x/rollapp/client/cli/tx_create_rollapp.go @@ -69,44 +69,43 @@ func CmdCreateRollapp() *cobra.Command { return cmd } -func parseGenesisInfo(cmd *cobra.Command) (types.GenesisInfo, error) { +func parseGenesisInfo(cmd *cobra.Command) (*types.GenesisInfo, error) { var ( - genesisInfo types.GenesisInfo + genesisInfo = &types.GenesisInfo{} err error ok bool ) genesisInfo.GenesisChecksum, err = cmd.Flags().GetString(FlagGenesisChecksum) if err != nil { - return types.GenesisInfo{}, err + return nil, err } genesisInfo.Bech32Prefix, err = cmd.Flags().GetString(FlagBech32Prefix) if err != nil { - return types.GenesisInfo{}, err + return nil, err } nativeDenomFlag, err := cmd.Flags().GetString(FlagNativeDenom) if err != nil { - return types.GenesisInfo{}, err + return nil, err } if nativeDenomFlag != "" { - genesisInfo.NativeDenom = new(types.DenomMetadata) - if err = utils.ParseJsonFromFile(nativeDenomFlag, genesisInfo.NativeDenom); err != nil { - return types.GenesisInfo{}, err + if err = utils.ParseJsonFromFile(nativeDenomFlag, &genesisInfo.NativeDenom); err != nil { + return nil, err } } initialSupplyFlag, err := cmd.Flags().GetString(FlagInitialSupply) if err != nil { - return types.GenesisInfo{}, err + return nil, err } if initialSupplyFlag != "" { genesisInfo.InitialSupply, ok = sdk.NewIntFromString(initialSupplyFlag) if !ok { - return types.GenesisInfo{}, fmt.Errorf("invalid initial supply: %s", initialSupplyFlag) + return nil, fmt.Errorf("invalid initial supply: %s", initialSupplyFlag) } } diff --git a/x/rollapp/keeper/msg_server_create_rollapp_test.go b/x/rollapp/keeper/msg_server_create_rollapp_test.go index 4ee861a61..300b52c9b 100644 --- a/x/rollapp/keeper/msg_server_create_rollapp_test.go +++ b/x/rollapp/keeper/msg_server_create_rollapp_test.go @@ -351,7 +351,7 @@ func (suite *RollappTestSuite) createRollappWithCreatorAndVerify( InitialSequencer: rollapp.GetInitialSequencer(), VmType: types.Rollapp_EVM, Metadata: rollapp.GetMetadata(), - GenesisInfo: rollapp.GetGenesisInfo(), + GenesisInfo: *rollapp.GetGenesisInfo(), } // create rollapp createResponse, err := suite.msgServer.CreateRollapp(goCtx, &rollapp) @@ -383,7 +383,7 @@ var mockRollappMetadata = types.RollappMetadata{ X: "https://x.dymension.xyz", } -var mockGenesisInfo = types.GenesisInfo{ +var mockGenesisInfo = &types.GenesisInfo{ Bech32Prefix: "rol", GenesisChecksum: "checksum", NativeDenom: &types.DenomMetadata{ diff --git a/x/rollapp/keeper/msg_server_transfer_ownership_test.go b/x/rollapp/keeper/msg_server_transfer_ownership_test.go index 2efb3bc51..e66013284 100644 --- a/x/rollapp/keeper/msg_server_transfer_ownership_test.go +++ b/x/rollapp/keeper/msg_server_transfer_ownership_test.go @@ -25,7 +25,7 @@ func (suite *RollappTestSuite) TestTransferOwnership() { expRollapp: types.Rollapp{ Owner: bob, RollappId: rollappId, - GenesisInfo: mockGenesisInfo, + GenesisInfo: *mockGenesisInfo, }, }, { name: "Transfer rollapp ownership: failed, rollapp not found", diff --git a/x/rollapp/keeper/msg_server_update_rollapp_test.go b/x/rollapp/keeper/msg_server_update_rollapp_test.go index 1a66b8282..a6ed4f798 100644 --- a/x/rollapp/keeper/msg_server_update_rollapp_test.go +++ b/x/rollapp/keeper/msg_server_update_rollapp_test.go @@ -33,7 +33,7 @@ func (suite *RollappTestSuite) TestUpdateRollapp() { RollappId: rollappId, InitialSequencer: initialSequencerAddress, Metadata: &mockRollappMetadata, - GenesisInfo: types.GenesisInfo{ + GenesisInfo: &types.GenesisInfo{ Bech32Prefix: "new", GenesisChecksum: "new_checksum", InitialSupply: sdk.NewInt(1000), @@ -103,7 +103,7 @@ func (suite *RollappTestSuite) TestUpdateRollapp() { RollappId: rollappId, InitialSequencer: "", Metadata: nil, - GenesisInfo: types.GenesisInfo{ + GenesisInfo: &types.GenesisInfo{ GenesisChecksum: "new_checksum", }, }, @@ -114,7 +114,7 @@ func (suite *RollappTestSuite) TestUpdateRollapp() { update: &types.MsgUpdateRollappInformation{ Owner: alice, RollappId: rollappId, - GenesisInfo: types.GenesisInfo{ + GenesisInfo: &types.GenesisInfo{ Bech32Prefix: "new", }, }, @@ -125,7 +125,7 @@ func (suite *RollappTestSuite) TestUpdateRollapp() { update: &types.MsgUpdateRollappInformation{ Owner: alice, RollappId: rollappId, - GenesisInfo: types.GenesisInfo{ + GenesisInfo: &types.GenesisInfo{ NativeDenom: &types.DenomMetadata{ Display: "DEN", Base: "aden", @@ -140,7 +140,7 @@ func (suite *RollappTestSuite) TestUpdateRollapp() { update: &types.MsgUpdateRollappInformation{ Owner: alice, RollappId: rollappId, - GenesisInfo: types.GenesisInfo{ + GenesisInfo: &types.GenesisInfo{ InitialSupply: sdk.NewInt(1000), }, }, @@ -176,6 +176,38 @@ func (suite *RollappTestSuite) TestUpdateRollapp() { }, }, }, + }, { + name: "Update rollapp: success - unsealed, update rollapp without genesis info", + update: &types.MsgUpdateRollappInformation{ + Owner: alice, + RollappId: rollappId, + Metadata: &mockRollappMetadata, + }, + rollappLaunched: false, + genInfoSealed: false, + expError: nil, + expRollapp: types.Rollapp{ + RollappId: rollappId, + Owner: alice, + InitialSequencer: "", + ChannelId: "", + Frozen: false, + RegisteredDenoms: nil, + Launched: false, + VmType: types.Rollapp_EVM, + Metadata: &mockRollappMetadata, + GenesisInfo: types.GenesisInfo{ + Bech32Prefix: "old", + GenesisChecksum: "old", + InitialSupply: sdk.NewInt(1000), + NativeDenom: types.DenomMetadata{ + Display: "OLD", + Base: "aold", + Exponent: 18, + }, + Sealed: false, + }, + }, }, } @@ -236,7 +268,7 @@ func (suite *RollappTestSuite) TestCreateAndUpdateRollapp() { InitialSequencer: "", Alias: "default", VmType: types.Rollapp_EVM, - GenesisInfo: types.GenesisInfo{ + GenesisInfo: &types.GenesisInfo{ Bech32Prefix: "rol", GenesisChecksum: "checksum", InitialSupply: sdk.NewInt(1000), @@ -263,7 +295,7 @@ func (suite *RollappTestSuite) TestCreateAndUpdateRollapp() { Owner: alice, RollappId: rollappId, InitialSequencer: addrInit, - GenesisInfo: types.GenesisInfo{GenesisChecksum: "checksum1"}, + GenesisInfo: &types.GenesisInfo{GenesisChecksum: "checksum1"}, }) suite.Require().NoError(err) diff --git a/x/rollapp/keeper/msg_server_update_state_test.go b/x/rollapp/keeper/msg_server_update_state_test.go index fa0a774ad..8b92d05d1 100644 --- a/x/rollapp/keeper/msg_server_update_state_test.go +++ b/x/rollapp/keeper/msg_server_update_state_test.go @@ -131,7 +131,7 @@ func (suite *RollappTestSuite) TestUpdateStateErrLogicUnpermissioned() { RollappId: rollappID, Owner: alice, InitialSequencer: sample.AccAddress(), - GenesisInfo: mockGenesisInfo, + GenesisInfo: *mockGenesisInfo, } suite.App.RollappKeeper.SetRollapp(suite.Ctx, rollapp) diff --git a/x/rollapp/keeper/rollapp.go b/x/rollapp/keeper/rollapp.go index 85ff6e8ac..a6b71651c 100644 --- a/x/rollapp/keeper/rollapp.go +++ b/x/rollapp/keeper/rollapp.go @@ -39,20 +39,22 @@ func (k Keeper) CheckAndUpdateRollappFields(ctx sdk.Context, update *types.MsgUp current.InitialSequencer = update.InitialSequencer } - if update.GenesisInfo.GenesisChecksum != "" { - current.GenesisInfo.GenesisChecksum = update.GenesisInfo.GenesisChecksum - } + if update.GenesisInfo != nil { + if update.GenesisInfo.GenesisChecksum != "" { + current.GenesisInfo.GenesisChecksum = update.GenesisInfo.GenesisChecksum + } - if update.GenesisInfo.Bech32Prefix != "" { - current.GenesisInfo.Bech32Prefix = update.GenesisInfo.Bech32Prefix - } + if update.GenesisInfo.Bech32Prefix != "" { + current.GenesisInfo.Bech32Prefix = update.GenesisInfo.Bech32Prefix + } - if update.GenesisInfo.NativeDenom != nil { - current.GenesisInfo.NativeDenom = update.GenesisInfo.NativeDenom - } + if update.GenesisInfo.NativeDenom != nil { + current.GenesisInfo.NativeDenom = update.GenesisInfo.NativeDenom + } - if !update.GenesisInfo.InitialSupply.IsNil() { - current.GenesisInfo.InitialSupply = update.GenesisInfo.InitialSupply + if !update.GenesisInfo.InitialSupply.IsNil() { + current.GenesisInfo.InitialSupply = update.GenesisInfo.InitialSupply + } } if update.Metadata != nil && !update.Metadata.IsEmpty() { diff --git a/x/rollapp/simulation/create_rollapp.go b/x/rollapp/simulation/create_rollapp.go index 997559856..0ba44f879 100644 --- a/x/rollapp/simulation/create_rollapp.go +++ b/x/rollapp/simulation/create_rollapp.go @@ -41,7 +41,7 @@ func SimulateMsgCreateRollapp(ak simulationtypes.AccountKeeper, bk simulationtyp Telegram: "https://t.me/rolly", X: "https://x.dymension.xyz", }, - GenesisInfo: types.GenesisInfo{ + GenesisInfo: &types.GenesisInfo{ GenesisChecksum: "checksum", Bech32Prefix: "bech", NativeDenom: &types.DenomMetadata{ diff --git a/x/rollapp/types/message_create_rollapp.go b/x/rollapp/types/message_create_rollapp.go index 109a95058..96a792fbf 100644 --- a/x/rollapp/types/message_create_rollapp.go +++ b/x/rollapp/types/message_create_rollapp.go @@ -15,7 +15,7 @@ func NewMsgCreateRollapp( alias string, vmType Rollapp_VMType, metadata *RollappMetadata, - genesisInfo GenesisInfo, + genesisInfo *GenesisInfo, ) *MsgCreateRollapp { return &MsgCreateRollapp{ Creator: creator, @@ -50,14 +50,18 @@ func (msg *MsgCreateRollapp) GetSignBytes() []byte { } func (msg *MsgCreateRollapp) GetRollapp() Rollapp { + genInfo := GenesisInfo{} + if msg.GenesisInfo != nil { + genInfo = *msg.GenesisInfo + } return NewRollapp( msg.Creator, msg.RollappId, msg.InitialSequencer, msg.VmType, msg.Metadata, - msg.GenesisInfo, - false, + genInfo, + true, ) } diff --git a/x/rollapp/types/message_create_rollapp_test.go b/x/rollapp/types/message_create_rollapp_test.go index 882b47b3a..9b919e1ae 100644 --- a/x/rollapp/types/message_create_rollapp_test.go +++ b/x/rollapp/types/message_create_rollapp_test.go @@ -28,7 +28,7 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) { InitialSequencer: sample.AccAddress(), Alias: "Rollapp", VmType: Rollapp_EVM, - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: "checksum", NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -55,7 +55,7 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) { RollappId: " ", Alias: "Rollapp", VmType: Rollapp_EVM, - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: "checksum", NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -72,7 +72,7 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) { RollappId: "dym_100-1", Alias: "Rollapp", VmType: Rollapp_EVM, - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: "checksum", NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -89,7 +89,7 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) { RollappId: "dym_100-1", Alias: "Rollapp", VmType: Rollapp_EVM, - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: "checksum", NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -105,7 +105,7 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) { RollappId: "dym_100-1", Alias: "Rollapp", VmType: Rollapp_EVM, - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: "checksum", NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -122,7 +122,7 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) { RollappId: "dym_100-1", Alias: "Rollapp", VmType: Rollapp_WASM, - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: "checksum", NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -139,7 +139,7 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) { RollappId: "dym_100-1", Alias: "Rollapp", VmType: Rollapp_WASM, - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: "checksum", NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -158,7 +158,7 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) { RollappId: "dym_100-1", Alias: "Rollapp", VmType: Rollapp_EVM, - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: "checksum", NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -175,7 +175,7 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) { RollappId: "dym_100-1", Alias: "Rollapp", VmType: Rollapp_EVM, - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: "DYM", GenesisChecksum: "checksum", NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -192,7 +192,7 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) { RollappId: "dym_100-1", Alias: "alias", VmType: Rollapp_EVM, - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: "checksum", NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -214,7 +214,7 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) { RollappId: "dym_100-1", Alias: "alias", VmType: Rollapp_EVM, - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: strings.Repeat("a", maxGenesisChecksumLength+1), NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -231,7 +231,7 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) { RollappId: "dym_100-1", Alias: "alias", VmType: Rollapp_EVM, - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: "checksum", NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -251,7 +251,7 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) { RollappId: "dym_100-1", Alias: "alias", VmType: Rollapp_EVM, - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: "checksum", NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, diff --git a/x/rollapp/types/message_update_rollapp.go b/x/rollapp/types/message_update_rollapp.go index 73e3f47b0..0e277a119 100644 --- a/x/rollapp/types/message_update_rollapp.go +++ b/x/rollapp/types/message_update_rollapp.go @@ -17,7 +17,7 @@ func NewMsgUpdateRollappInformation( rollappId, initSequencer string, metadata *RollappMetadata, - genesisInfo GenesisInfo, + genesisInfo *GenesisInfo, ) *MsgUpdateRollappInformation { return &MsgUpdateRollappInformation{ Owner: creator, @@ -57,13 +57,15 @@ func (msg *MsgUpdateRollappInformation) ValidateBasic() error { } } - if len(msg.GenesisInfo.GenesisChecksum) > maxGenesisChecksumLength { - return ErrInvalidGenesisChecksum - } + if msg.GenesisInfo != nil { + if len(msg.GenesisInfo.GenesisChecksum) > maxGenesisChecksumLength { + return ErrInvalidGenesisChecksum + } - if msg.GenesisInfo.Bech32Prefix != "" { - if err := validateBech32Prefix(msg.GenesisInfo.Bech32Prefix); err != nil { - return errorsmod.Wrap(errors.Join(err, gerrc.ErrInvalidArgument), "bech32 prefix") + if msg.GenesisInfo.Bech32Prefix != "" { + if err := validateBech32Prefix(msg.GenesisInfo.Bech32Prefix); err != nil { + return errorsmod.Wrap(errors.Join(err, gerrc.ErrInvalidArgument), "bech32 prefix") + } } } @@ -81,6 +83,9 @@ func (msg *MsgUpdateRollappInformation) UpdatingImmutableValues() bool { } func (msg *MsgUpdateRollappInformation) UpdatingGenesisInfo() bool { + if msg.GenesisInfo == nil { + return false + } return msg.GenesisInfo.GenesisChecksum != "" || msg.GenesisInfo.Bech32Prefix != "" || msg.GenesisInfo.NativeDenom != nil || diff --git a/x/rollapp/types/message_update_rollapp_test.go b/x/rollapp/types/message_update_rollapp_test.go index 245db358d..ec8490427 100644 --- a/x/rollapp/types/message_update_rollapp_test.go +++ b/x/rollapp/types/message_update_rollapp_test.go @@ -22,7 +22,7 @@ func TestMsgUpdateRollappInformation_ValidateBasic(t *testing.T) { Owner: sample.AccAddress(), RollappId: "dym_100-1", InitialSequencer: sample.AccAddress(), - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: "checksum", NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -51,7 +51,7 @@ func TestMsgUpdateRollappInformation_ValidateBasic(t *testing.T) { Owner: sample.AccAddress(), InitialSequencer: "invalid_address", RollappId: "dym_100-1", - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: "checksum", NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -66,7 +66,7 @@ func TestMsgUpdateRollappInformation_ValidateBasic(t *testing.T) { Owner: sample.AccAddress(), InitialSequencer: sample.AccAddress(), RollappId: "dym_100-1", - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: "checksum", NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -86,7 +86,7 @@ func TestMsgUpdateRollappInformation_ValidateBasic(t *testing.T) { Owner: sample.AccAddress(), InitialSequencer: sample.AccAddress(), RollappId: "dym_100-1", - GenesisInfo: GenesisInfo{ + GenesisInfo: &GenesisInfo{ Bech32Prefix: bech32Prefix, GenesisChecksum: strings.Repeat("a", maxGenesisChecksumLength+1), NativeDenom: &DenomMetadata{Display: "DEN", Base: "aden", Exponent: 18}, @@ -95,6 +95,16 @@ func TestMsgUpdateRollappInformation_ValidateBasic(t *testing.T) { }, err: ErrInvalidGenesisChecksum, }, + { + name: "valid: updating without genesis info", + msg: MsgUpdateRollappInformation{ + Owner: sample.AccAddress(), + InitialSequencer: sample.AccAddress(), + RollappId: "dym_100-1", + GenesisInfo: nil, + }, + err: nil, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/rollapp/types/tx.pb.go b/x/rollapp/types/tx.pb.go index f37d5a9aa..8e7d043a2 100644 --- a/x/rollapp/types/tx.pb.go +++ b/x/rollapp/types/tx.pb.go @@ -44,7 +44,7 @@ type MsgCreateRollapp struct { // metadata is the rollapp metadata Metadata *RollappMetadata `protobuf:"bytes,13,opt,name=metadata,proto3" json:"metadata,omitempty"` // genesis_info is the genesis information - GenesisInfo GenesisInfo `protobuf:"bytes,14,opt,name=genesis_info,json=genesisInfo,proto3" json:"genesis_info"` + GenesisInfo *GenesisInfo `protobuf:"bytes,14,opt,name=genesis_info,json=genesisInfo,proto3" json:"genesis_info,omitempty"` // vm_type is the type of rollapp machine: EVM or WASM VmType Rollapp_VMType `protobuf:"varint,15,opt,name=vm_type,json=vmType,proto3,enum=dymensionxyz.dymension.rollapp.Rollapp_VMType" json:"vm_type,omitempty"` } @@ -117,11 +117,11 @@ func (m *MsgCreateRollapp) GetMetadata() *RollappMetadata { return nil } -func (m *MsgCreateRollapp) GetGenesisInfo() GenesisInfo { +func (m *MsgCreateRollapp) GetGenesisInfo() *GenesisInfo { if m != nil { return m.GenesisInfo } - return GenesisInfo{} + return nil } func (m *MsgCreateRollapp) GetVmType() Rollapp_VMType { @@ -180,7 +180,7 @@ type MsgUpdateRollappInformation struct { // metadata is the rollapp metadata Metadata *RollappMetadata `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` // genesis_info is the genesis information - GenesisInfo GenesisInfo `protobuf:"bytes,6,opt,name=genesis_info,json=genesisInfo,proto3" json:"genesis_info"` + GenesisInfo *GenesisInfo `protobuf:"bytes,6,opt,name=genesis_info,json=genesisInfo,proto3" json:"genesis_info,omitempty"` } func (m *MsgUpdateRollappInformation) Reset() { *m = MsgUpdateRollappInformation{} } @@ -244,11 +244,11 @@ func (m *MsgUpdateRollappInformation) GetMetadata() *RollappMetadata { return nil } -func (m *MsgUpdateRollappInformation) GetGenesisInfo() GenesisInfo { +func (m *MsgUpdateRollappInformation) GetGenesisInfo() *GenesisInfo { if m != nil { return m.GenesisInfo } - return GenesisInfo{} + return nil } type MsgUpdateRollappInformationResponse struct { @@ -929,7 +929,7 @@ func init() { } var fileDescriptor_1a86300fb8647ecb = []byte{ - // 947 bytes of a gzipped FileDescriptorProto + // 948 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4d, 0x6f, 0xe3, 0x44, 0x18, 0xae, 0x93, 0x34, 0x1f, 0x6f, 0xd2, 0x92, 0x0e, 0x55, 0xb1, 0xb2, 0x4b, 0x88, 0xb2, 0x42, 0x14, 0x76, 0xb1, 0xd9, 0x6e, 0x41, 0xa8, 0x70, 0x69, 0xb7, 0xd2, 0xee, 0x82, 0xc2, 0x82, 0xb7, @@ -950,46 +950,46 @@ var fileDescriptor_1a86300fb8647ecb = []byte{ 0xbc, 0x41, 0x1f, 0x43, 0x39, 0x29, 0x5c, 0x5f, 0x69, 0x69, 0x9b, 0xd5, 0x2d, 0xd3, 0x58, 0x2c, 0x83, 0x21, 0xcb, 0xee, 0x48, 0x37, 0x4b, 0x05, 0x40, 0x07, 0x50, 0x73, 0x31, 0xc1, 0xcc, 0x63, 0x5d, 0x8f, 0x1c, 0x51, 0x7d, 0x55, 0x04, 0xbc, 0x9b, 0x16, 0xf0, 0x51, 0xec, 0xf3, 0x84, 0x1c, - 0xd1, 0xbd, 0xc2, 0xf3, 0xbf, 0x5e, 0x5b, 0xb2, 0xaa, 0xee, 0xd8, 0x84, 0x1e, 0x41, 0x69, 0xe8, - 0x77, 0xf9, 0x28, 0xc0, 0xfa, 0x4b, 0x2d, 0x6d, 0x73, 0x75, 0xcb, 0xc8, 0x58, 0xa1, 0xf1, 0x45, - 0xe7, 0x60, 0x14, 0x60, 0xab, 0x38, 0xf4, 0xa3, 0xe7, 0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 0x6d, 0x7a, 0x2c, 0x6d, 0x67, 0x88, 0x36, 0xe5, 0xd5, 0xf8, + 0xf0, 0x26, 0x5e, 0xaa, 0x92, 0x23, 0x28, 0xca, 0x89, 0xf3, 0x66, 0x86, 0x38, 0x31, 0xb4, 0x71, + 0x3f, 0x33, 0x54, 0xe5, 0xa1, 0x50, 0x19, 0xdf, 0xfd, 0x7b, 0x99, 0x69, 0x8b, 0xb2, 0x6d, 0x5f, + 0x07, 0x3d, 0x99, 0x70, 0x7c, 0xf3, 0xb2, 0x24, 0x54, 0xe8, 0x4c, 0x09, 0xa7, 0xae, 0xdb, 0xde, + 0x27, 0xcf, 0xcf, 0x9b, 0xda, 0xd9, 0x79, 0x53, 0xfb, 0xfb, 0xbc, 0xa9, 0xfd, 0x74, 0xd1, 0x5c, + 0x3a, 0xbb, 0x68, 0x2e, 0xfd, 0x71, 0xd1, 0x5c, 0xfa, 0x72, 0xdb, 0xf5, 0xf8, 0xf1, 0xe0, 0xd0, + 0xe8, 0x51, 0xdf, 0x9c, 0xf3, 0x47, 0x3c, 0x7c, 0x60, 0x9e, 0x8e, 0xff, 0xee, 0x47, 0x01, 0x66, + 0x87, 0x45, 0xf1, 0xfb, 0xfb, 0xe0, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x02, 0x98, 0xec, 0x1b, + 0x0c, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1313,16 +1313,18 @@ func (m *MsgCreateRollapp) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x78 } - { - size, err := m.GenesisInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.GenesisInfo != nil { + { + size, err := m.GenesisInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x72 } - i-- - dAtA[i] = 0x72 if m.Metadata != nil { { size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) @@ -1409,16 +1411,18 @@ func (m *MsgUpdateRollappInformation) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l - { - size, err := m.GenesisInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.GenesisInfo != nil { + { + size, err := m.GenesisInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 } - i-- - dAtA[i] = 0x32 if m.Metadata != nil { { size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) @@ -1935,8 +1939,10 @@ func (m *MsgCreateRollapp) Size() (n int) { l = m.Metadata.Size() n += 1 + l + sovTx(uint64(l)) } - l = m.GenesisInfo.Size() - n += 1 + l + sovTx(uint64(l)) + if m.GenesisInfo != nil { + l = m.GenesisInfo.Size() + n += 1 + l + sovTx(uint64(l)) + } if m.VmType != 0 { n += 1 + sovTx(uint64(m.VmType)) } @@ -1974,8 +1980,10 @@ func (m *MsgUpdateRollappInformation) Size() (n int) { l = m.Metadata.Size() n += 1 + l + sovTx(uint64(l)) } - l = m.GenesisInfo.Size() - n += 1 + l + sovTx(uint64(l)) + if m.GenesisInfo != nil { + l = m.GenesisInfo.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2409,6 +2417,9 @@ func (m *MsgCreateRollapp) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.GenesisInfo == nil { + m.GenesisInfo = &GenesisInfo{} + } if err := m.GenesisInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2693,6 +2704,9 @@ func (m *MsgUpdateRollappInformation) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.GenesisInfo == nil { + m.GenesisInfo = &GenesisInfo{} + } if err := m.GenesisInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err }