From ecfda24c0750fd9e2f3cd1f6620fce0adc21aeef Mon Sep 17 00:00:00 2001 From: leonz789 Date: Wed, 17 Apr 2024 18:26:17 +0800 Subject: [PATCH] text(oracle-proto): proto lint, PriceWithTimeAndRound->PriceTimeRound --- proto/exocore/oracle/price.proto | 2 +- proto/exocore/oracle/prices.proto | 2 +- x/oracle/genesis_test.go | 4 +- x/oracle/keeper/aggregator/aggregator.go | 4 +- .../keeper/msg_server_create_price_test.go | 2 +- x/oracle/keeper/msg_server_test.go | 4 +- x/oracle/keeper/prices.go | 14 +-- x/oracle/keeper/prices_test.go | 4 +- x/oracle/keeper/testdata/helper.go | 6 +- x/oracle/module.go | 2 +- x/oracle/types/key_prices.go | 2 +- x/oracle/types/price.pb.go | 99 +++++++++---------- x/oracle/types/prices.pb.go | 27 +++-- 13 files changed, 85 insertions(+), 87 deletions(-) diff --git a/proto/exocore/oracle/price.proto b/proto/exocore/oracle/price.proto index c138d9481..043192f2c 100644 --- a/proto/exocore/oracle/price.proto +++ b/proto/exocore/oracle/price.proto @@ -33,7 +33,7 @@ message PriceSource{ } // price with its specified timestamp and roundid(if from deteministic source) -message PriceWithTimeAndRound { +message PriceTimeRound { // price string price = 1; // decimal of the corresponding price diff --git a/proto/exocore/oracle/prices.proto b/proto/exocore/oracle/prices.proto index 177ecd644..8fed04fc7 100644 --- a/proto/exocore/oracle/prices.proto +++ b/proto/exocore/oracle/prices.proto @@ -13,5 +13,5 @@ message Prices { // next round id of the price to be updated uint64 next_round_id = 2 [(gogoproto.customname) = "NextRoundID"]; // price list of all history round prices for the token - repeated PriceWithTimeAndRound price_list = 3; + repeated PriceTimeRound price_list = 3; } diff --git a/x/oracle/genesis_test.go b/x/oracle/genesis_test.go index 5fe565032..8293f96e8 100644 --- a/x/oracle/genesis_test.go +++ b/x/oracle/genesis_test.go @@ -17,7 +17,7 @@ func TestGenesis(t *testing.T) { PricesList: []types.Prices{ { TokenID: 1, - PriceList: []*types.PriceWithTimeAndRound{ + PriceList: []*types.PriceTimeRound{ { Price: "100", Decimal: 1, @@ -29,7 +29,7 @@ func TestGenesis(t *testing.T) { }, { TokenID: 2, - PriceList: []*types.PriceWithTimeAndRound{ + PriceList: []*types.PriceTimeRound{ { Price: "109", Decimal: 1, diff --git a/x/oracle/keeper/aggregator/aggregator.go b/x/oracle/keeper/aggregator/aggregator.go index 1eb57564c..e291a2384 100644 --- a/x/oracle/keeper/aggregator/aggregator.go +++ b/x/oracle/keeper/aggregator/aggregator.go @@ -13,7 +13,7 @@ import ( type PriceItemKV struct { TokenID uint64 - PriceTR types.PriceWithTimeAndRound + PriceTR types.PriceTimeRound } type roundInfo struct { @@ -124,7 +124,7 @@ func (agc *AggregatorContext) FillPrice(msg *types.MsgCreatePrice) (*PriceItemKV if finalPrice := feederWorker.aggregate(); finalPrice != nil { agc.rounds[msg.FeederID].status = 2 feederWorker.seal() - return &PriceItemKV{agc.params.GetTokenFeeder(msg.FeederID).TokenID, types.PriceWithTimeAndRound{ + return &PriceItemKV{agc.params.GetTokenFeeder(msg.FeederID).TokenID, types.PriceTimeRound{ Price: finalPrice.String(), Decimal: agc.params.GetTokenInfo(msg.FeederID).Decimal, // TODO: check the format diff --git a/x/oracle/keeper/msg_server_create_price_test.go b/x/oracle/keeper/msg_server_create_price_test.go index 5dc876197..f36e00648 100644 --- a/x/oracle/keeper/msg_server_create_price_test.go +++ b/x/oracle/keeper/msg_server_create_price_test.go @@ -115,7 +115,7 @@ var _ = Describe("MsgCreatePrice", func() { Expect(prices[0]).Should(BeEquivalentTo(types.Prices{ TokenID: 1, NextRoundID: 2, - PriceList: []*types.PriceWithTimeAndRound{ + PriceList: []*types.PriceTimeRound{ { Price: testdata.PTD2.Price, Decimal: testdata.PTD2.Decimal, diff --git a/x/oracle/keeper/msg_server_test.go b/x/oracle/keeper/msg_server_test.go index d9ada0eec..a3ff1ca70 100644 --- a/x/oracle/keeper/msg_server_test.go +++ b/x/oracle/keeper/msg_server_test.go @@ -52,7 +52,7 @@ func (suite *KeeperSuite) TestCreatePriceSingleBlock() { suite.Exactly(types.Prices{ TokenID: 1, NextRoundID: 2, - PriceList: []*types.PriceWithTimeAndRound{ + PriceList: []*types.PriceTimeRound{ {}, { Price: testdata.PTD2.Price, @@ -111,7 +111,7 @@ func (suite *KeeperSuite) TestCreatePriceTwoBlock() { suite.Exactly(types.Prices{ TokenID: 1, NextRoundID: 2, - PriceList: []*types.PriceWithTimeAndRound{ + PriceList: []*types.PriceTimeRound{ {}, { Price: testdata.PTD1.Price, diff --git a/x/oracle/keeper/prices.go b/x/oracle/keeper/prices.go index 0f46085fd..804357d8e 100644 --- a/x/oracle/keeper/prices.go +++ b/x/oracle/keeper/prices.go @@ -28,12 +28,12 @@ func (k Keeper) GetPrices( val.TokenID = tokenID val.NextRoundID = nextRoundID - val.PriceList = make([]*types.PriceWithTimeAndRound, nextRoundID) + val.PriceList = make([]*types.PriceTimeRound, nextRoundID) // 0 roundId is reserved, expect the roundid corresponds to the slice index - val.PriceList[0] = &types.PriceWithTimeAndRound{} + val.PriceList[0] = &types.PriceTimeRound{} for i := uint64(1); i < nextRoundID; i++ { b := store.Get(types.PricesRoundKey(i)) - val.PriceList[i] = &types.PriceWithTimeAndRound{} + val.PriceList[i] = &types.PriceTimeRound{} if b != nil { // should always be true since we don't delete prices from history round k.cdc.MustUnmarshal(b, val.PriceList[i]) @@ -80,7 +80,7 @@ func (k Keeper) GetAllPrices(ctx sdk.Context) (list []types.Prices) { if nextRoundID { price.NextRoundID = binary.BigEndian.Uint64(iterator.Value()) } else { - var val types.PriceWithTimeAndRound + var val types.PriceTimeRound k.cdc.MustUnmarshal(iterator.Value(), &val) price.PriceList = append(price.PriceList, &val) } @@ -91,7 +91,7 @@ func (k Keeper) GetAllPrices(ctx sdk.Context) (list []types.Prices) { return list } -func (k Keeper) AppendPriceTR(ctx sdk.Context, tokenID uint64, priceTR types.PriceWithTimeAndRound) { +func (k Keeper) AppendPriceTR(ctx sdk.Context, tokenID uint64, priceTR types.PriceTimeRound) { nextRoundID := k.GetNextRoundID(ctx, tokenID) if nextRoundID != priceTR.RoundID { return @@ -103,7 +103,7 @@ func (k Keeper) AppendPriceTR(ctx sdk.Context, tokenID uint64, priceTR types.Pri } // func(k Keeper) SetPriceTR(ctx sdk.Context, tokenID int32, priceTR){} -func (k Keeper) GetPriceTRRoundID(ctx sdk.Context, tokenID uint64, roundID uint64) (price types.PriceWithTimeAndRound, found bool) { +func (k Keeper) GetPriceTRRoundID(ctx sdk.Context, tokenID uint64, roundID uint64) (price types.PriceTimeRound, found bool) { store := k.getPriceTRStore(ctx, tokenID) b := store.Get(types.PricesRoundKey(roundID)) @@ -116,7 +116,7 @@ func (k Keeper) GetPriceTRRoundID(ctx sdk.Context, tokenID uint64, roundID uint6 return } -func (k Keeper) GetPriceTRLatest(ctx sdk.Context, tokenID uint64) (price types.PriceWithTimeAndRound, found bool) { +func (k Keeper) GetPriceTRLatest(ctx sdk.Context, tokenID uint64) (price types.PriceTimeRound, found bool) { // store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.PricesKeyPrefix)) // store = prefix.NewStore(store, types.PricesKey(tokenID)) store := k.getPriceTRStore(ctx, tokenID) diff --git a/x/oracle/keeper/prices_test.go b/x/oracle/keeper/prices_test.go index 55100a97b..099dd38ce 100644 --- a/x/oracle/keeper/prices_test.go +++ b/x/oracle/keeper/prices_test.go @@ -23,7 +23,7 @@ func createNPrices(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.Prices items[i] = types.Prices{ TokenID: uint64(i + 1), NextRoundID: 2, - PriceList: []*types.PriceWithTimeAndRound{ + PriceList: []*types.PriceTimeRound{ testdata.PTR1, testdata.PTR2, testdata.PTR3, @@ -42,7 +42,7 @@ func TestPricesGet(t *testing.T) { rst, found := keeper.GetPrices(ctx, 1) require.True(t, found) pRes := testdata.P1 - pRes.PriceList = append([]*types.PriceWithTimeAndRound{{}}, testdata.P1.PriceList...) + pRes.PriceList = append([]*types.PriceTimeRound{{}}, testdata.P1.PriceList...) require.Equal(t, pRes, rst) // items := createNPrices(keeper, ctx, 10) // diff --git a/x/oracle/keeper/testdata/helper.go b/x/oracle/keeper/testdata/helper.go index 5c8215e84..b45ec4553 100644 --- a/x/oracle/keeper/testdata/helper.go +++ b/x/oracle/keeper/testdata/helper.go @@ -18,8 +18,8 @@ func newPS(sourceID uint64, prices ...*types.PriceTimeDetID) *types.PriceSource } } -func newPTR(price string, roundID uint64) *types.PriceWithTimeAndRound { - return &types.PriceWithTimeAndRound{ +func newPTR(price string, roundID uint64) *types.PriceTimeRound { + return &types.PriceTimeRound{ Price: price, Decimal: 18, Timestamp: "", @@ -27,7 +27,7 @@ func newPTR(price string, roundID uint64) *types.PriceWithTimeAndRound { } } -func newPrices(tokenID uint64, nextRoundID uint64, pList ...*types.PriceWithTimeAndRound) types.Prices { +func newPrices(tokenID uint64, nextRoundID uint64, pList ...*types.PriceTimeRound) types.Prices { return types.Prices{ TokenID: tokenID, NextRoundID: nextRoundID, diff --git a/x/oracle/module.go b/x/oracle/module.go index 0da886852..6638310f7 100644 --- a/x/oracle/module.go +++ b/x/oracle/module.go @@ -197,7 +197,7 @@ func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Val ) } else { nextRoundID := am.keeper.GetNextRoundID(ctx, tokenID) - am.keeper.AppendPriceTR(ctx, tokenID, types.PriceWithTimeAndRound{ + am.keeper.AppendPriceTR(ctx, tokenID, types.PriceTimeRound{ RoundID: nextRoundID, }) logInfo += fmt.Sprintf(", roundID:%d, price:-", nextRoundID) diff --git a/x/oracle/types/key_prices.go b/x/oracle/types/key_prices.go index 1d0b0173e..a140fd619 100644 --- a/x/oracle/types/key_prices.go +++ b/x/oracle/types/key_prices.go @@ -26,7 +26,7 @@ func PricesKey( return key } -// PricesRoundKey returns the store key to retrieve a PriceWithTimeAndRound from the index fields +// PricesRoundKey returns the store key to retrieve a PriceTimeRound from the index fields func PricesRoundKey( roundID uint64, ) []byte { diff --git a/x/oracle/types/price.pb.go b/x/oracle/types/price.pb.go index e80d33d61..71a24037c 100644 --- a/x/oracle/types/price.pb.go +++ b/x/oracle/types/price.pb.go @@ -165,7 +165,7 @@ func (m *PriceSource) GetDesc() string { } // price with its specified timestamp and roundid(if from deteministic source) -type PriceWithTimeAndRound struct { +type PriceTimeRound struct { // price Price string `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"` // decimal of the corresponding price @@ -176,18 +176,18 @@ type PriceWithTimeAndRound struct { RoundID uint64 `protobuf:"varint,4,opt,name=round_id,json=roundId,proto3" json:"round_id,omitempty"` } -func (m *PriceWithTimeAndRound) Reset() { *m = PriceWithTimeAndRound{} } -func (m *PriceWithTimeAndRound) String() string { return proto.CompactTextString(m) } -func (*PriceWithTimeAndRound) ProtoMessage() {} -func (*PriceWithTimeAndRound) Descriptor() ([]byte, []int) { +func (m *PriceTimeRound) Reset() { *m = PriceTimeRound{} } +func (m *PriceTimeRound) String() string { return proto.CompactTextString(m) } +func (*PriceTimeRound) ProtoMessage() {} +func (*PriceTimeRound) Descriptor() ([]byte, []int) { return fileDescriptor_6755466c800b64fc, []int{2} } -func (m *PriceWithTimeAndRound) XXX_Unmarshal(b []byte) error { +func (m *PriceTimeRound) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *PriceWithTimeAndRound) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *PriceTimeRound) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_PriceWithTimeAndRound.Marshal(b, m, deterministic) + return xxx_messageInfo_PriceTimeRound.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -197,40 +197,40 @@ func (m *PriceWithTimeAndRound) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *PriceWithTimeAndRound) XXX_Merge(src proto.Message) { - xxx_messageInfo_PriceWithTimeAndRound.Merge(m, src) +func (m *PriceTimeRound) XXX_Merge(src proto.Message) { + xxx_messageInfo_PriceTimeRound.Merge(m, src) } -func (m *PriceWithTimeAndRound) XXX_Size() int { +func (m *PriceTimeRound) XXX_Size() int { return m.Size() } -func (m *PriceWithTimeAndRound) XXX_DiscardUnknown() { - xxx_messageInfo_PriceWithTimeAndRound.DiscardUnknown(m) +func (m *PriceTimeRound) XXX_DiscardUnknown() { + xxx_messageInfo_PriceTimeRound.DiscardUnknown(m) } -var xxx_messageInfo_PriceWithTimeAndRound proto.InternalMessageInfo +var xxx_messageInfo_PriceTimeRound proto.InternalMessageInfo -func (m *PriceWithTimeAndRound) GetPrice() string { +func (m *PriceTimeRound) GetPrice() string { if m != nil { return m.Price } return "" } -func (m *PriceWithTimeAndRound) GetDecimal() int32 { +func (m *PriceTimeRound) GetDecimal() int32 { if m != nil { return m.Decimal } return 0 } -func (m *PriceWithTimeAndRound) GetTimestamp() string { +func (m *PriceTimeRound) GetTimestamp() string { if m != nil { return m.Timestamp } return "" } -func (m *PriceWithTimeAndRound) GetRoundID() uint64 { +func (m *PriceTimeRound) GetRoundID() uint64 { if m != nil { return m.RoundID } @@ -240,36 +240,35 @@ func (m *PriceWithTimeAndRound) GetRoundID() uint64 { func init() { proto.RegisterType((*PriceTimeDetID)(nil), "exocore.oracle.PriceTimeDetID") proto.RegisterType((*PriceSource)(nil), "exocore.oracle.PriceSource") - proto.RegisterType((*PriceWithTimeAndRound)(nil), "exocore.oracle.PriceWithTimeAndRound") + proto.RegisterType((*PriceTimeRound)(nil), "exocore.oracle.PriceTimeRound") } func init() { proto.RegisterFile("exocore/oracle/price.proto", fileDescriptor_6755466c800b64fc) } var fileDescriptor_6755466c800b64fc = []byte{ - // 357 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0x31, 0x4b, 0xc3, 0x40, - 0x14, 0xc7, 0x7b, 0x6d, 0xd2, 0x36, 0x57, 0xe9, 0x70, 0x54, 0x08, 0x45, 0xd2, 0xd0, 0x41, 0xea, - 0x92, 0x88, 0x82, 0xbb, 0x21, 0x0e, 0x71, 0x10, 0x89, 0x82, 0xe0, 0x22, 0x6d, 0xee, 0xd1, 0x1e, - 0x36, 0xbd, 0x70, 0xb9, 0x62, 0xdd, 0x1c, 0x5c, 0x05, 0x3f, 0x96, 0x63, 0x47, 0xa7, 0x22, 0xe9, - 0x17, 0x91, 0xbb, 0x34, 0x48, 0x77, 0xb7, 0x77, 0xf9, 0xbd, 0xff, 0x7b, 0xff, 0xf7, 0xf2, 0x70, - 0x1f, 0x56, 0x3c, 0xe1, 0x02, 0x7c, 0x2e, 0xc6, 0xc9, 0x1c, 0xfc, 0x4c, 0xb0, 0x04, 0xbc, 0x4c, - 0x70, 0xc9, 0x49, 0x77, 0xc7, 0xbc, 0x92, 0xf5, 0x7b, 0x53, 0x3e, 0xe5, 0x1a, 0xf9, 0x2a, 0x2a, - 0xb3, 0x86, 0x6f, 0x08, 0x77, 0x6f, 0x95, 0xea, 0x9e, 0xa5, 0x10, 0x82, 0x8c, 0x42, 0xd2, 0xc3, - 0xa6, 0xae, 0x63, 0x23, 0x17, 0x8d, 0xac, 0xb8, 0x7c, 0x10, 0x1b, 0xb7, 0x28, 0x24, 0x2c, 0x1d, - 0xcf, 0xed, 0xba, 0x8b, 0x46, 0x66, 0x5c, 0x3d, 0xc9, 0x11, 0xb6, 0x24, 0x4b, 0x21, 0x97, 0xe3, - 0x34, 0xb3, 0x1b, 0x5a, 0xf3, 0xf7, 0x81, 0xb8, 0xb8, 0x49, 0x41, 0x3e, 0x31, 0x6a, 0x1b, 0x0a, - 0x05, 0x56, 0xb1, 0x19, 0x98, 0xba, 0x51, 0x6c, 0x52, 0x90, 0x11, 0x1d, 0xbe, 0x23, 0xdc, 0xd1, - 0x16, 0xee, 0xf8, 0x52, 0x24, 0x40, 0x4e, 0xb0, 0x95, 0xeb, 0x48, 0x89, 0x94, 0x07, 0x23, 0x38, - 0x28, 0x36, 0x83, 0x76, 0x89, 0xa3, 0x30, 0x6e, 0x97, 0x38, 0xa2, 0xe4, 0x02, 0x37, 0xb5, 0xbb, - 0xdc, 0xae, 0xbb, 0x8d, 0x51, 0xe7, 0xcc, 0xf1, 0xf6, 0x87, 0xf6, 0xf6, 0x47, 0x8b, 0x77, 0xd9, - 0x84, 0x60, 0x83, 0x42, 0x9e, 0xec, 0xdc, 0xea, 0x78, 0xf8, 0x81, 0xf0, 0xa1, 0x4e, 0x7f, 0x60, - 0x72, 0xa6, 0x24, 0x97, 0x0b, 0x1a, 0xf3, 0xe5, 0x82, 0xfe, 0xf3, 0x42, 0x8e, 0x71, 0x5b, 0xa8, - 0xb2, 0xd5, 0x4a, 0x8c, 0xa0, 0x53, 0x6c, 0x06, 0x2d, 0xdd, 0x2a, 0x0a, 0xe3, 0x96, 0x86, 0x11, - 0x0d, 0xae, 0xbf, 0x0a, 0x07, 0xad, 0x0b, 0x07, 0xfd, 0x14, 0x0e, 0xfa, 0xdc, 0x3a, 0xb5, 0xf5, - 0xd6, 0xa9, 0x7d, 0x6f, 0x9d, 0xda, 0xe3, 0xe9, 0x94, 0xc9, 0xd9, 0x72, 0xe2, 0x25, 0x3c, 0xf5, - 0xaf, 0xca, 0x79, 0x6f, 0x40, 0xbe, 0x70, 0xf1, 0xec, 0x57, 0xf7, 0xb0, 0xaa, 0x2e, 0x42, 0xbe, - 0x66, 0x90, 0x4f, 0x9a, 0xfa, 0x67, 0x9f, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x58, 0xe2, 0x3e, - 0x36, 0x30, 0x02, 0x00, 0x00, + // 347 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0xbd, 0x4e, 0xc3, 0x30, + 0x10, 0xc7, 0xeb, 0x36, 0x69, 0x1b, 0x17, 0x75, 0xb0, 0x3a, 0x44, 0x15, 0x72, 0xa3, 0x0e, 0xa8, + 0x2c, 0x09, 0x02, 0x89, 0x07, 0x88, 0xc2, 0x10, 0x06, 0x84, 0x0c, 0x13, 0x0b, 0x6a, 0xed, 0x53, + 0x89, 0x68, 0x70, 0xe4, 0xb8, 0xa2, 0x6c, 0x0c, 0x88, 0x99, 0xc7, 0x62, 0xec, 0xc8, 0x54, 0xa1, + 0xf4, 0x45, 0x50, 0x9c, 0x46, 0xd0, 0x9d, 0xed, 0xce, 0xbf, 0xfb, 0xf8, 0xdf, 0xf9, 0xf0, 0x10, + 0x56, 0x92, 0x4b, 0x05, 0x81, 0x54, 0x53, 0xbe, 0x80, 0x20, 0x53, 0x09, 0x07, 0x3f, 0x53, 0x52, + 0x4b, 0xd2, 0xdf, 0x31, 0xbf, 0x62, 0xc3, 0xc1, 0x5c, 0xce, 0xa5, 0x41, 0x41, 0x69, 0x55, 0x51, + 0xe3, 0x57, 0x84, 0xfb, 0xd7, 0x65, 0xd6, 0x6d, 0x92, 0x42, 0x04, 0x3a, 0x8e, 0xc8, 0x00, 0xdb, + 0xa6, 0x8e, 0x8b, 0x3c, 0x34, 0x71, 0x58, 0xe5, 0x10, 0x17, 0x77, 0x04, 0xf0, 0x24, 0x9d, 0x2e, + 0xdc, 0xa6, 0x87, 0x26, 0x36, 0xab, 0x5d, 0x72, 0x88, 0x1d, 0x9d, 0xa4, 0x90, 0xeb, 0x69, 0x9a, + 0xb9, 0x2d, 0x93, 0xf3, 0xfb, 0x40, 0x3c, 0xdc, 0x16, 0xa0, 0xef, 0x13, 0xe1, 0x5a, 0x25, 0x0a, + 0x9d, 0x62, 0x33, 0xb2, 0x4d, 0x23, 0x66, 0x0b, 0xd0, 0xb1, 0x18, 0xbf, 0x21, 0xdc, 0x33, 0x12, + 0x6e, 0xe4, 0x52, 0x71, 0x20, 0xc7, 0xd8, 0xc9, 0x8d, 0x55, 0x26, 0x95, 0x1a, 0xac, 0xf0, 0xa0, + 0xd8, 0x8c, 0xba, 0x15, 0x8e, 0x23, 0xd6, 0xad, 0x70, 0x2c, 0xc8, 0x39, 0x6e, 0x1b, 0x75, 0xb9, + 0xdb, 0xf4, 0x5a, 0x93, 0xde, 0x29, 0xf5, 0xf7, 0x87, 0xf6, 0xf7, 0x47, 0x63, 0xbb, 0x68, 0x42, + 0xb0, 0x25, 0x20, 0xe7, 0x3b, 0xb5, 0xc6, 0x1e, 0xbf, 0xff, 0xdd, 0x04, 0x93, 0xcb, 0x27, 0xf1, + 0xcf, 0x9b, 0x38, 0xc2, 0x5d, 0x55, 0x96, 0xad, 0x77, 0x61, 0x85, 0xbd, 0x62, 0x33, 0xea, 0x98, + 0x56, 0x71, 0xc4, 0x3a, 0x06, 0xc6, 0x22, 0xbc, 0xfc, 0x2c, 0x28, 0x5a, 0x17, 0x14, 0x7d, 0x17, + 0x14, 0x7d, 0x6c, 0x69, 0x63, 0xbd, 0xa5, 0x8d, 0xaf, 0x2d, 0x6d, 0xdc, 0x9d, 0xcc, 0x13, 0xfd, + 0xb0, 0x9c, 0xf9, 0x5c, 0xa6, 0xc1, 0x45, 0x35, 0xe8, 0x15, 0xe8, 0x67, 0xa9, 0x1e, 0x83, 0xfa, + 0x10, 0x56, 0xf5, 0x29, 0xe8, 0x97, 0x0c, 0xf2, 0x59, 0xdb, 0xfc, 0xf2, 0xd9, 0x4f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xc3, 0xe6, 0x21, 0x72, 0x29, 0x02, 0x00, 0x00, } func (m *PriceTimeDetID) Marshal() (dAtA []byte, err error) { @@ -370,7 +369,7 @@ func (m *PriceSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *PriceWithTimeAndRound) Marshal() (dAtA []byte, err error) { +func (m *PriceTimeRound) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -380,12 +379,12 @@ func (m *PriceWithTimeAndRound) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PriceWithTimeAndRound) MarshalTo(dAtA []byte) (int, error) { +func (m *PriceTimeRound) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PriceWithTimeAndRound) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PriceTimeRound) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -474,7 +473,7 @@ func (m *PriceSource) Size() (n int) { return n } -func (m *PriceWithTimeAndRound) Size() (n int) { +func (m *PriceTimeRound) Size() (n int) { if m == nil { return 0 } @@ -803,7 +802,7 @@ func (m *PriceSource) Unmarshal(dAtA []byte) error { } return nil } -func (m *PriceWithTimeAndRound) Unmarshal(dAtA []byte) error { +func (m *PriceTimeRound) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -826,10 +825,10 @@ func (m *PriceWithTimeAndRound) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PriceWithTimeAndRound: wiretype end group for non-group") + return fmt.Errorf("proto: PriceTimeRound: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PriceWithTimeAndRound: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PriceTimeRound: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/oracle/types/prices.pb.go b/x/oracle/types/prices.pb.go index 017d7313f..43a216e16 100644 --- a/x/oracle/types/prices.pb.go +++ b/x/oracle/types/prices.pb.go @@ -30,7 +30,7 @@ type Prices struct { // next round id of the price to be updated NextRoundID uint64 `protobuf:"varint,2,opt,name=next_round_id,json=nextRoundId,proto3" json:"next_round_id,omitempty"` // price list of all history round prices for the token - PriceList []*PriceWithTimeAndRound `protobuf:"bytes,3,rep,name=price_list,json=priceList,proto3" json:"price_list,omitempty"` + PriceList []*PriceTimeRound `protobuf:"bytes,3,rep,name=price_list,json=priceList,proto3" json:"price_list,omitempty"` } func (m *Prices) Reset() { *m = Prices{} } @@ -80,7 +80,7 @@ func (m *Prices) GetNextRoundID() uint64 { return 0 } -func (m *Prices) GetPriceList() []*PriceWithTimeAndRound { +func (m *Prices) GetPriceList() []*PriceTimeRound { if m != nil { return m.PriceList } @@ -94,25 +94,24 @@ func init() { func init() { proto.RegisterFile("exocore/oracle/prices.proto", fileDescriptor_50cc9ccc8f92b87a) } var fileDescriptor_50cc9ccc8f92b87a = []byte{ - // 275 bytes of a gzipped FileDescriptorProto + // 268 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xad, 0xc8, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x4c, 0x4e, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0x4a, 0xea, 0x41, 0x24, 0xa5, 0xa4, 0xb0, 0x29, 0x86, 0xa8, 0x95, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x33, 0xf5, 0x41, 0x2c, 0x88, - 0xa8, 0xd2, 0x6a, 0x46, 0x2e, 0xb6, 0x00, 0xb0, 0x91, 0x42, 0x6a, 0x5c, 0x1c, 0x25, 0xf9, 0xd9, + 0xa8, 0xd2, 0x12, 0x46, 0x2e, 0xb6, 0x00, 0xb0, 0x91, 0x42, 0x6a, 0x5c, 0x1c, 0x25, 0xf9, 0xd9, 0xa9, 0x79, 0xf1, 0x99, 0x29, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x2c, 0x4e, 0xdc, 0x8f, 0xee, 0xc9, 0xb3, 0x87, 0x80, 0xc4, 0x3c, 0x5d, 0x82, 0xd8, 0xc1, 0x92, 0x9e, 0x29, 0x42, 0xc6, 0x5c, 0xbc, 0x79, 0xa9, 0x15, 0x25, 0xf1, 0x45, 0xf9, 0xa5, 0x79, 0x29, 0x20, 0xc5, 0x4c, 0x60, 0xc5, 0xfc, 0x8f, 0xee, 0xc9, 0x73, 0xfb, 0xa5, 0x56, 0x94, 0x04, 0x81, 0xc4, 0x3d, 0x5d, 0x82, 0xb8, 0xf3, - 0xe0, 0x9c, 0x14, 0x21, 0x17, 0x2e, 0x2e, 0xb0, 0x63, 0xe2, 0x73, 0x32, 0x8b, 0x4b, 0x24, 0x98, - 0x15, 0x98, 0x35, 0xb8, 0x8d, 0x54, 0xf5, 0x50, 0x9d, 0xaf, 0x07, 0x76, 0x48, 0x78, 0x66, 0x49, - 0x46, 0x48, 0x66, 0x6e, 0xaa, 0x63, 0x5e, 0x0a, 0x58, 0x73, 0x10, 0x27, 0x58, 0xa3, 0x4f, 0x66, - 0x71, 0x89, 0x93, 0xd7, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, - 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x19, 0xa4, - 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xbb, 0x42, 0x4c, 0xf5, 0x4b, 0x2d, - 0x29, 0xcf, 0x2f, 0xca, 0xd6, 0x87, 0x85, 0x49, 0x05, 0x2c, 0x54, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, - 0x93, 0xd8, 0xc0, 0x01, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x39, 0x8b, 0xfd, 0x9d, 0x61, - 0x01, 0x00, 0x00, + 0xe0, 0x9c, 0x14, 0x21, 0x5b, 0x2e, 0x2e, 0xb0, 0x63, 0xe2, 0x73, 0x32, 0x8b, 0x4b, 0x24, 0x98, + 0x15, 0x98, 0x35, 0xb8, 0x8d, 0xe4, 0xf4, 0x50, 0x9d, 0xaf, 0x07, 0x76, 0x48, 0x48, 0x66, 0x6e, + 0x2a, 0x58, 0x57, 0x10, 0x27, 0x58, 0x87, 0x4f, 0x66, 0x71, 0x89, 0x93, 0xd7, 0x89, 0x47, 0x72, + 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, + 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x19, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, + 0xe7, 0xe7, 0xea, 0xbb, 0x42, 0x8c, 0xf3, 0x4b, 0x2d, 0x29, 0xcf, 0x2f, 0xca, 0xd6, 0x87, 0x05, + 0x46, 0x05, 0x2c, 0x38, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x3e, 0x37, 0x06, 0x04, + 0x00, 0x00, 0xff, 0xff, 0x30, 0x95, 0x2b, 0x4d, 0x5a, 0x01, 0x00, 0x00, } func (m *Prices) Marshal() (dAtA []byte, err error) { @@ -296,7 +295,7 @@ func (m *Prices) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PriceList = append(m.PriceList, &PriceWithTimeAndRound{}) + m.PriceList = append(m.PriceList, &PriceTimeRound{}) if err := m.PriceList[len(m.PriceList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err }