Skip to content

Commit

Permalink
fix(sequencer): change metadata gas_price Int to string (#1670)
Browse files Browse the repository at this point in the history
  • Loading branch information
zale144 authored Dec 19, 2024
1 parent f9d073a commit 9f14dac
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 75 deletions.
4 changes: 1 addition & 3 deletions app/upgrades/v4/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,6 @@ func ConvertOldRollappToNew(oldRollapp rollapptypes.Rollapp) rollapptypes.Rollap
}
}

var defaultGasPrice, _ = sdk.NewIntFromString("10000000000")

func ConvertOldSequencerToNew(old sequencertypes.Sequencer) sequencertypes.Sequencer {
return sequencertypes.Sequencer{
Address: old.Address,
Expand All @@ -440,7 +438,7 @@ func ConvertOldSequencerToNew(old sequencertypes.Sequencer) sequencertypes.Seque
},
ExtraData: nil,
Snapshots: []*sequencertypes.SnapshotInfo{},
GasPrice: &defaultGasPrice,
GasPrice: "10000000000",
FeeDenom: nil,
},
}
Expand Down
2 changes: 1 addition & 1 deletion proto/dymensionxyz/dymension/sequencer/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ message SequencerMetadata {
// snapshots of the sequencer
repeated SnapshotInfo snapshots = 14;
// gas_price defines the value for each gas unit
string gas_price = 15 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"];
string gas_price = 15;
// fee_denom is the base denom for fees
DenomMetadata fee_denom = 16;
}
Expand Down
3 changes: 1 addition & 2 deletions x/eibc/types/demand_order.pb.go

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

2 changes: 1 addition & 1 deletion x/eibc/types/tx.pb.go

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

3 changes: 1 addition & 2 deletions x/rollapp/keeper/msg_server_update_rollapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/dymensionxyz/gerr-cosmos/gerrc"
"github.com/dymensionxyz/sdk-utils/utils/ucoin"
"github.com/dymensionxyz/sdk-utils/utils/uptr"

"github.com/dymensionxyz/dymension/v3/x/rollapp/types"
sequencertypes "github.com/dymensionxyz/dymension/v3/x/sequencer/types"
Expand Down Expand Up @@ -833,7 +832,7 @@ func (s *RollappTestSuite) TestCreateAndUpdateRollapp() {
Checksum: "checksum",
},
},
GasPrice: uptr.To(sdk.NewInt(100)),
GasPrice: "100",
}
_, err = s.seqMsgServer.UpdateSequencerInformation(s.Ctx, &sequencertypes.MsgUpdateSequencerInformation{
Creator: addrInit,
Expand Down
5 changes: 2 additions & 3 deletions x/sequencer/keeper/msg_server_update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/dymensionxyz/sdk-utils/utils/uptr"

rollapptypes "github.com/dymensionxyz/dymension/v3/x/rollapp/types"
"github.com/dymensionxyz/dymension/v3/x/sequencer/types"
Expand Down Expand Up @@ -51,7 +50,7 @@ func (s *SequencerTestSuite) TestUpdateSequencer() {
Checksum: "checksum",
},
},
GasPrice: uptr.To(sdk.NewInt(100)),
GasPrice: "100",
},
},
expError: nil,
Expand Down Expand Up @@ -81,7 +80,7 @@ func (s *SequencerTestSuite) TestUpdateSequencer() {
Checksum: "checksum",
},
},
GasPrice: uptr.To(sdk.NewInt(100)),
GasPrice: "100",
},
Status: 0,
Tokens: nil,
Expand Down
107 changes: 51 additions & 56 deletions x/sequencer/types/metadata.pb.go

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

6 changes: 2 additions & 4 deletions x/sequencer/types/msg_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
"github.com/dymensionxyz/gerr-cosmos/gerrc"
"github.com/dymensionxyz/sdk-utils/utils/uptr"

cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/dymensionxyz/gerr-cosmos/gerrc"
"github.com/stretchr/testify/require"

"github.com/dymensionxyz/dymension/v3/testutil/sample"
Expand Down Expand Up @@ -88,7 +86,7 @@ func TestMsgCreateSequencer_ValidateBasic(t *testing.T) {
Checksum: "checksum",
},
},
GasPrice: uptr.To(sdk.NewInt(100)),
GasPrice: "100",
FeeDenom: &DenomMetadata{
Display: "DEN",
Base: "aden",
Expand Down
4 changes: 1 addition & 3 deletions x/sequencer/types/msg_update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"strings"
"testing"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/dymensionxyz/sdk-utils/utils/uptr"
"github.com/stretchr/testify/require"

"github.com/dymensionxyz/dymension/v3/testutil/sample"
Expand Down Expand Up @@ -43,7 +41,7 @@ func TestMsgUpdateSequencerInformation_ValidateBasic(t *testing.T) {
Checksum: "checksum",
},
},
GasPrice: uptr.To(sdk.NewInt(100)),
GasPrice: "100",
},
},
}, {
Expand Down

0 comments on commit 9f14dac

Please sign in to comment.