Skip to content

Commit

Permalink
fix(rollapp): change logo_data_uri to logo_url (#1133)
Browse files Browse the repository at this point in the history
  • Loading branch information
zale144 authored Aug 25, 2024
1 parent fe9ba14 commit d1218ca
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 148 deletions.
2 changes: 1 addition & 1 deletion app/apptesting/test_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (s *KeeperTestHelper) CreateRollappByName(name string) {
Metadata: &rollapptypes.RollappMetadata{
Website: "https://dymension.xyz",
Description: "Sample description",
LogoDataUri: "data:image/png;base64,c2lzZQ==",
LogoUrl: "https://dymension.xyz/logo.png",
Telegram: "https://t.me/rolly",
X: "https://x.dymension.xyz",
},
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v4/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func ConvertOldRollappToNew(oldRollapp rollapptypes.Rollapp) rollapptypes.Rollap
Metadata: &rollapptypes.RollappMetadata{
Website: "",
Description: "",
LogoDataUri: "",
LogoUrl: "",
Telegram: "",
X: "",
GenesisUrl: "",
Expand Down
75 changes: 14 additions & 61 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3459,16 +3459,9 @@ paths:
title: >-
description is the rollapp description. should be
limited to 512 chars
logo_data_uri:
logo_url:
type: string
title: >-
logo_data_uri is a base64 rep with a URI prefix to the
rollapp logo. Size limited
token_logo_data_uri:
type: string
title: >-
token_logo_data_uri is a URI to the native token logo.
Size limited
title: logo_url is the rollapp logo url
telegram:
type: string
title: telegram is the rollapp telegram link
Expand Down Expand Up @@ -3937,16 +3930,9 @@ paths:
title: >-
description is the rollapp description. should
be limited to 512 chars
logo_data_uri:
type: string
title: >-
logo_data_uri is a base64 rep with a URI prefix
to the rollapp logo. Size limited
token_logo_data_uri:
logo_url:
type: string
title: >-
token_logo_data_uri is a URI to the native token
logo. Size limited
title: logo_url is the rollapp logo url
telegram:
type: string
title: telegram is the rollapp telegram link
Expand Down Expand Up @@ -4298,16 +4284,9 @@ paths:
title: >-
description is the rollapp description. should be
limited to 512 chars
logo_data_uri:
type: string
title: >-
logo_data_uri is a base64 rep with a URI prefix to the
rollapp logo. Size limited
token_logo_data_uri:
logo_url:
type: string
title: >-
token_logo_data_uri is a URI to the native token logo.
Size limited
title: logo_url is the rollapp logo url
telegram:
type: string
title: telegram is the rollapp telegram link
Expand Down Expand Up @@ -60834,16 +60813,9 @@ definitions:
title: >-
description is the rollapp description. should be
limited to 512 chars
logo_data_uri:
type: string
title: >-
logo_data_uri is a base64 rep with a URI prefix to the
rollapp logo. Size limited
token_logo_data_uri:
logo_url:
type: string
title: >-
token_logo_data_uri is a URI to the native token logo.
Size limited
title: logo_url is the rollapp logo url
telegram:
type: string
title: telegram is the rollapp telegram link
Expand Down Expand Up @@ -61136,16 +61108,9 @@ definitions:
title: >-
description is the rollapp description. should be limited to
512 chars
logo_data_uri:
logo_url:
type: string
title: >-
logo_data_uri is a base64 rep with a URI prefix to the rollapp
logo. Size limited
token_logo_data_uri:
type: string
title: >-
token_logo_data_uri is a URI to the native token logo. Size
limited
title: logo_url is the rollapp logo url
telegram:
type: string
title: telegram is the rollapp telegram link
Expand Down Expand Up @@ -61483,16 +61448,9 @@ definitions:
title: >-
description is the rollapp description. should be limited to 512
chars
logo_data_uri:
logo_url:
type: string
title: >-
logo_data_uri is a base64 rep with a URI prefix to the rollapp
logo. Size limited
token_logo_data_uri:
type: string
title: >-
token_logo_data_uri is a URI to the native token logo. Size
limited
title: logo_url is the rollapp logo url
telegram:
type: string
title: telegram is the rollapp telegram link
Expand Down Expand Up @@ -61592,14 +61550,9 @@ definitions:
description:
type: string
title: description is the rollapp description. should be limited to 512 chars
logo_data_uri:
type: string
title: >-
logo_data_uri is a base64 rep with a URI prefix to the rollapp logo.
Size limited
token_logo_data_uri:
logo_url:
type: string
title: token_logo_data_uri is a URI to the native token logo. Size limited
title: logo_url is the rollapp logo url
telegram:
type: string
title: telegram is the rollapp telegram link
Expand Down
2 changes: 1 addition & 1 deletion ibctesting/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (s *utilSuite) createRollapp(transfersEnabled bool, channelID *string) {
&rollapptypes.RollappMetadata{
Website: "http://example.com",
Description: "Some description",
LogoDataUri: "data:image/png;base64,c2lzZQ==",
LogoUrl: "https://dymension.xyz/logo.png",
Telegram: "https://t.me/rolly",
X: "https://x.dymension.xyz",
},
Expand Down
4 changes: 2 additions & 2 deletions proto/dymensionxyz/dymension/rollapp/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ message RollappMetadata {
string website = 1;
// description is the rollapp description. should be limited to 512 chars
string description = 2;
// logo_data_uri is a base64 rep with a URI prefix to the rollapp logo. Size limited
string logo_data_uri = 3;
// logo_url is the rollapp logo url
string logo_url = 3;
// telegram is the rollapp telegram link
string telegram = 4;
// x is the rollapp twitter link
Expand Down
2 changes: 1 addition & 1 deletion x/rollapp/keeper/msg_server_create_rollapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ func (suite *RollappTestSuite) createRollappWithCreatorAndVerify(
var mockRollappMetadata = types.RollappMetadata{
Website: "https://dymension.xyz",
Description: "Sample description",
LogoDataUri: "data:image/png;base64,c2lzZQ==",
LogoUrl: "https://dymension.xyz/logo.png",
Telegram: "https://t.me/rolly",
X: "https://x.dymension.xyz",
}
2 changes: 1 addition & 1 deletion x/rollapp/keeper/msg_server_update_rollapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (suite *RollappTestSuite) TestUpdateRollapp() {
Metadata: &types.RollappMetadata{
Website: "",
Description: "",
LogoDataUri: "",
LogoUrl: "",
Telegram: "",
X: "",
},
Expand Down
2 changes: 1 addition & 1 deletion x/rollapp/simulation/create_rollapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func SimulateMsgCreateRollapp(ak simulationtypes.AccountKeeper, bk simulationtyp
Metadata: &types.RollappMetadata{
Website: "https://dymension.xyz",
Description: "Sample description",
LogoDataUri: "data:image/png;base64,c2lzZQ==",
LogoUrl: "https://dymension.xyz/logo.png",
Telegram: "https://t.me/rolly",
X: "https://x.dymension.xyz",
},
Expand Down
2 changes: 0 additions & 2 deletions x/rollapp/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ var (
ErrInvalidAlias = errorsmod.Wrap(gerrc.ErrInvalidArgument, "alias")
ErrInvalidURL = errorsmod.Wrap(gerrc.ErrInvalidArgument, "invalid url")
ErrInvalidDescription = errorsmod.Wrap(gerrc.ErrInvalidArgument, "description")
ErrInvalidLogoURI = errorsmod.Wrap(gerrc.ErrInvalidArgument, "logo uri")
ErrInvalidTokenLogoURI = errorsmod.Wrap(gerrc.ErrInvalidArgument, "token logo uri")
ErrInvalidMetadata = errorsmod.Wrap(gerrc.ErrInvalidArgument, "metadata")
ErrImmutableFieldUpdateAfterSealed = errorsmod.Wrap(gerrc.ErrInvalidArgument, "update immutable field after rollapp sealed")
ErrUnauthorizedSigner = errorsmod.Wrap(gerrc.ErrPermissionDenied, "unauthorized signer")
Expand Down
8 changes: 4 additions & 4 deletions x/rollapp/types/message_create_rollapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) {
Metadata: &RollappMetadata{
Website: "https://dymension.xyz",
Description: "Sample description",
LogoDataUri: "data:image/png;base64,c2lzZQ==",
LogoUrl: "https://dymension.xyz/logo.png",
Telegram: "https://t.me/rolly",
X: "https://x.dymension.xyz",
},
Expand Down Expand Up @@ -144,7 +144,7 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) {
err: gerrc.ErrInvalidArgument,
},
{
name: "invalid metadata: invalid logo data uri",
name: "invalid metadata: invalid logo url",
msg: MsgCreateRollapp{
Creator: sample.AccAddress(),
Bech32Prefix: bech32Prefix,
Expand All @@ -156,10 +156,10 @@ func TestMsgCreateRollapp_ValidateBasic(t *testing.T) {
Metadata: &RollappMetadata{
Website: "https://dymension.xyz",
Description: "Sample description",
LogoDataUri: "invalid_uri",
LogoUrl: string(rune(0x7f)),
},
},
err: ErrInvalidLogoURI,
err: ErrInvalidURL,
},
{
name: "invalid genesis checksum: too long",
Expand Down
8 changes: 4 additions & 4 deletions x/rollapp/types/message_update_rollapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestMsgUpdateRollappInformation_ValidateBasic(t *testing.T) {
Metadata: &RollappMetadata{
Website: "https://dymension.xyz",
Description: "Sample description",
LogoDataUri: "data:image/png;base64,c2lzZQ==",
LogoUrl: "https://dymension.xyz/logo.png",
Telegram: "https://t.me/rolly",
X: "https://x.dymension.xyz",
},
Expand All @@ -42,7 +42,7 @@ func TestMsgUpdateRollappInformation_ValidateBasic(t *testing.T) {
err: ErrInvalidInitialSequencer,
},
{
name: "invalid metadata: invalid logo data uri",
name: "invalid metadata: invalid logo url",
msg: MsgUpdateRollappInformation{
Owner: sample.AccAddress(),
InitialSequencer: sample.AccAddress(),
Expand All @@ -51,10 +51,10 @@ func TestMsgUpdateRollappInformation_ValidateBasic(t *testing.T) {
Metadata: &RollappMetadata{
Website: "https://dymension.xyz",
Description: "Sample description",
LogoDataUri: "invalid_uri",
LogoUrl: string(rune(0x7f)),
},
},
err: ErrInvalidLogoURI,
err: ErrInvalidURL,
},
{
name: "invalid genesis checksum: too long",
Expand Down
63 changes: 31 additions & 32 deletions x/rollapp/types/metadata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d1218ca

Please sign in to comment.