From 5881e3e1f7bd488d33dcebb0b8f1569787d42387 Mon Sep 17 00:00:00 2001 From: artpav <19916123+artemijspavlovs@users.noreply.github.com> Date: Fri, 20 Dec 2024 10:19:30 +0200 Subject: [PATCH] fix(sequencer): change metadata gas_price Int to string (#1290) --- .../dymension/sequencer/metadata.proto | 2 +- .../dymension/sequencer/metadata.pb.go | 101 +++++++++--------- 2 files changed, 49 insertions(+), 54 deletions(-) diff --git a/proto/types/dymensionxyz/dymension/sequencer/metadata.proto b/proto/types/dymensionxyz/dymension/sequencer/metadata.proto index 02d4d0c7c..a77d93587 100644 --- a/proto/types/dymensionxyz/dymension/sequencer/metadata.proto +++ b/proto/types/dymensionxyz/dymension/sequencer/metadata.proto @@ -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; } message ContactDetails { diff --git a/types/pb/dymensionxyz/dymension/sequencer/metadata.pb.go b/types/pb/dymensionxyz/dymension/sequencer/metadata.pb.go index fb35f4f5a..6ef9ebe84 100644 --- a/types/pb/dymensionxyz/dymension/sequencer/metadata.pb.go +++ b/types/pb/dymensionxyz/dymension/sequencer/metadata.pb.go @@ -5,7 +5,6 @@ package sequencer import ( fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" @@ -49,7 +48,7 @@ type SequencerMetadata struct { // snapshots of the sequencer Snapshots []*SnapshotInfo `protobuf:"bytes,14,rep,name=snapshots,proto3" json:"snapshots,omitempty"` // gas_price defines the value for each gas unit - GasPrice *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,15,opt,name=gas_price,json=gasPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"gas_price,omitempty"` + GasPrice string `protobuf:"bytes,15,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"` } func (m *SequencerMetadata) Reset() { *m = SequencerMetadata{} } @@ -162,6 +161,13 @@ func (m *SequencerMetadata) GetSnapshots() []*SnapshotInfo { return nil } +func (m *SequencerMetadata) GetGasPrice() string { + if m != nil { + return m.GasPrice + } + return "" +} + type ContactDetails struct { // website URL Website string `protobuf:"bytes,11,opt,name=website,proto3" json:"website,omitempty"` @@ -299,41 +305,39 @@ func init() { } var fileDescriptor_6045a4988478e768 = []byte{ - // 539 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xc1, 0x6e, 0xd3, 0x4a, - 0x14, 0xad, 0xdb, 0x34, 0xb1, 0xc7, 0x69, 0xfa, 0x9e, 0x85, 0xd0, 0x50, 0x84, 0x31, 0x59, 0xa0, - 0x08, 0x09, 0x1b, 0x05, 0xf1, 0x01, 0x94, 0x4a, 0x50, 0x04, 0x12, 0x72, 0xe8, 0x02, 0x36, 0x96, - 0xe3, 0x5c, 0x1c, 0x2b, 0xb6, 0x67, 0x98, 0x3b, 0x29, 0x09, 0x5f, 0xc1, 0x82, 0x8f, 0x62, 0xd9, - 0x25, 0x62, 0x81, 0x50, 0xf2, 0x23, 0x68, 0xc6, 0x76, 0x9a, 0xb2, 0xc9, 0xca, 0x3e, 0xe7, 0xde, - 0x73, 0x66, 0xe6, 0xdc, 0x19, 0xf2, 0x4c, 0x2e, 0x39, 0x60, 0x30, 0x59, 0x16, 0x50, 0x62, 0xc6, - 0xca, 0xc5, 0xf2, 0xeb, 0x35, 0x08, 0x10, 0x3e, 0xcf, 0xa1, 0x4c, 0x40, 0x04, 0x05, 0xc8, 0x78, - 0x12, 0xcb, 0xd8, 0xe7, 0x82, 0x49, 0xe6, 0x78, 0xdb, 0x02, 0x7f, 0x03, 0xfc, 0x8d, 0xe0, 0xe4, - 0x56, 0xca, 0x52, 0xa6, 0x9b, 0x03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 0xf7, 0x7e, 0xae, 0xdd, 0xbd, 0x8f, 0xaf, 0xb6, 0xe2, 0xf8, 0xf7, 0x85, 0x65, - 0xa5, 0xac, 0x02, 0x09, 0xf8, 0x78, 0xe7, 0xf3, 0x1b, 0xb7, 0xf5, 0xf3, 0x79, 0xfa, 0x37, 0x00, - 0x00, 0xff, 0xff, 0xef, 0x23, 0x73, 0xc5, 0xaf, 0x03, 0x00, 0x00, + // 506 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x8d, 0x9b, 0x34, 0xb1, 0xd7, 0x69, 0x0a, 0x16, 0x42, 0x4b, 0x11, 0x96, 0xc9, 0x29, 0x27, + 0x07, 0x05, 0xf1, 0x01, 0x40, 0x0f, 0x80, 0x40, 0x42, 0x0e, 0x3d, 0xc0, 0xc5, 0xda, 0x38, 0x83, + 0xb3, 0xaa, 0xed, 0x5d, 0x76, 0x37, 0xc5, 0xe1, 0x2b, 0xf8, 0x2c, 0x8e, 0x3d, 0x72, 0x44, 0xc9, + 0x85, 0xcf, 0x40, 0xbb, 0x6b, 0xa7, 0xad, 0x38, 0xe4, 0xb6, 0xef, 0xcd, 0xbc, 0x99, 0xf1, 0x1b, + 0x0f, 0x7a, 0xa1, 0x36, 0x1c, 0xe4, 0x74, 0xb9, 0x29, 0xa1, 0x92, 0x94, 0x55, 0xf5, 0xe6, 0xc7, + 0x0d, 0x98, 0x4a, 0xf8, 0xb6, 0x86, 0x2a, 0x03, 0x31, 0x2d, 0x41, 0x91, 0x25, 0x51, 0x24, 0xe6, + 0x82, 0x29, 0x16, 0x44, 0xb7, 0x05, 0xf1, 0x1e, 0xc4, 0x7b, 0xc1, 0xd9, 0x83, 0x9c, 0xe5, 0xcc, + 0x24, 0x4f, 0xf5, 0xcb, 0xea, 0xc6, 0x7f, 0xbb, 0xe8, 0xfe, 0xbc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df, 0x83, 0x03, 0x00, 0x00, } func (m *SequencerMetadata) Marshal() (dAtA []byte, err error) { @@ -356,15 +360,10 @@ func (m *SequencerMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.GasPrice != nil { - { - size := m.GasPrice.Size() - i -= size - if _, err := m.GasPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintMetadata(dAtA, i, uint64(size)) - } + if len(m.GasPrice) > 0 { + i -= len(m.GasPrice) + copy(dAtA[i:], m.GasPrice) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.GasPrice))) i-- dAtA[i] = 0x7a } @@ -629,8 +628,8 @@ func (m *SequencerMetadata) Size() (n int) { n += 1 + l + sovMetadata(uint64(l)) } } - if m.GasPrice != nil { - l = m.GasPrice.Size() + l = len(m.GasPrice) + if l > 0 { n += 1 + l + sovMetadata(uint64(l)) } return n @@ -1102,11 +1101,7 @@ func (m *SequencerMetadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int - m.GasPrice = &v - if err := m.GasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.GasPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex