diff --git a/chain/oracle/types/genesis.pb.go b/chain/oracle/types/genesis.pb.go index 8ed3736a..9c8af997 100644 --- a/chain/oracle/types/genesis.pb.go +++ b/chain/oracle/types/genesis.pb.go @@ -26,17 +26,18 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the oracle module's genesis state. type GenesisState struct { // params defines all the parameters of related to oracle. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - BandRelayers []string `protobuf:"bytes,2,rep,name=band_relayers,json=bandRelayers,proto3" json:"band_relayers,omitempty"` - BandPriceStates []*BandPriceState `protobuf:"bytes,3,rep,name=band_price_states,json=bandPriceStates,proto3" json:"band_price_states,omitempty"` - PriceFeedPriceStates []*PriceFeedState `protobuf:"bytes,4,rep,name=price_feed_price_states,json=priceFeedPriceStates,proto3" json:"price_feed_price_states,omitempty"` - CoinbasePriceStates []*CoinbasePriceState `protobuf:"bytes,5,rep,name=coinbase_price_states,json=coinbasePriceStates,proto3" json:"coinbase_price_states,omitempty"` - BandIbcPriceStates []*BandPriceState `protobuf:"bytes,6,rep,name=band_ibc_price_states,json=bandIbcPriceStates,proto3" json:"band_ibc_price_states,omitempty"` - BandIbcOracleRequests []*BandOracleRequest `protobuf:"bytes,7,rep,name=band_ibc_oracle_requests,json=bandIbcOracleRequests,proto3" json:"band_ibc_oracle_requests,omitempty"` - BandIbcParams BandIBCParams `protobuf:"bytes,8,opt,name=band_ibc_params,json=bandIbcParams,proto3" json:"band_ibc_params"` - BandIbcLatestClientId uint64 `protobuf:"varint,9,opt,name=band_ibc_latest_client_id,json=bandIbcLatestClientId,proto3" json:"band_ibc_latest_client_id,omitempty"` - CalldataRecords []*CalldataRecord `protobuf:"bytes,10,rep,name=calldata_records,json=calldataRecords,proto3" json:"calldata_records,omitempty"` - BandIbcLatestRequestId uint64 `protobuf:"varint,11,opt,name=band_ibc_latest_request_id,json=bandIbcLatestRequestId,proto3" json:"band_ibc_latest_request_id,omitempty"` + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + BandRelayers []string `protobuf:"bytes,2,rep,name=band_relayers,json=bandRelayers,proto3" json:"band_relayers,omitempty"` + BandPriceStates []*BandPriceState `protobuf:"bytes,3,rep,name=band_price_states,json=bandPriceStates,proto3" json:"band_price_states,omitempty"` + PriceFeedPriceStates []*PriceFeedState `protobuf:"bytes,4,rep,name=price_feed_price_states,json=priceFeedPriceStates,proto3" json:"price_feed_price_states,omitempty"` + CoinbasePriceStates []*CoinbasePriceState `protobuf:"bytes,5,rep,name=coinbase_price_states,json=coinbasePriceStates,proto3" json:"coinbase_price_states,omitempty"` + BandIbcPriceStates []*BandPriceState `protobuf:"bytes,6,rep,name=band_ibc_price_states,json=bandIbcPriceStates,proto3" json:"band_ibc_price_states,omitempty"` + BandIbcOracleRequests []*BandOracleRequest `protobuf:"bytes,7,rep,name=band_ibc_oracle_requests,json=bandIbcOracleRequests,proto3" json:"band_ibc_oracle_requests,omitempty"` + BandIbcParams BandIBCParams `protobuf:"bytes,8,opt,name=band_ibc_params,json=bandIbcParams,proto3" json:"band_ibc_params"` + BandIbcLatestClientId uint64 `protobuf:"varint,9,opt,name=band_ibc_latest_client_id,json=bandIbcLatestClientId,proto3" json:"band_ibc_latest_client_id,omitempty"` + CalldataRecords []*CalldataRecord `protobuf:"bytes,10,rep,name=calldata_records,json=calldataRecords,proto3" json:"calldata_records,omitempty"` + BandIbcLatestRequestId uint64 `protobuf:"varint,11,opt,name=band_ibc_latest_request_id,json=bandIbcLatestRequestId,proto3" json:"band_ibc_latest_request_id,omitempty"` + ChainlinkPriceStates []*ChainlinkPriceState `protobuf:"bytes,12,rep,name=chainlink_price_states,json=chainlinkPriceStates,proto3" json:"chainlink_price_states,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -149,6 +150,13 @@ func (m *GenesisState) GetBandIbcLatestRequestId() uint64 { return 0 } +func (m *GenesisState) GetChainlinkPriceStates() []*ChainlinkPriceState { + if m != nil { + return m.ChainlinkPriceStates + } + return nil +} + type CalldataRecord struct { ClientId uint64 `protobuf:"varint,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` Calldata []byte `protobuf:"bytes,2,opt,name=calldata,proto3" json:"calldata,omitempty"` @@ -211,41 +219,43 @@ func init() { } var fileDescriptor_f7e14cf80151b4d2 = []byte{ - // 540 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xcf, 0x6e, 0xd3, 0x40, - 0x10, 0xc6, 0xe3, 0x26, 0x84, 0x64, 0x93, 0x12, 0x58, 0x1a, 0x30, 0x41, 0x32, 0x56, 0x11, 0x60, - 0x09, 0xb0, 0xd5, 0x72, 0x41, 0x1c, 0x38, 0x24, 0x12, 0xc8, 0x52, 0x24, 0x2a, 0x17, 0x2e, 0x70, - 0x30, 0xeb, 0xf5, 0x34, 0x35, 0x72, 0xbc, 0x66, 0x77, 0x53, 0xa9, 0x6f, 0xc1, 0x63, 0xf5, 0xd8, - 0x23, 0x27, 0x84, 0x92, 0x27, 0xe0, 0x0d, 0x90, 0xd7, 0x7f, 0x1a, 0x17, 0xa5, 0x15, 0x37, 0xcf, - 0x78, 0xe6, 0xf7, 0x7d, 0x33, 0x1a, 0x2d, 0x7a, 0x1a, 0x25, 0xdf, 0x80, 0xca, 0xe8, 0x04, 0x1c, - 0xc6, 0x09, 0x8d, 0xc1, 0x39, 0xd9, 0x0b, 0x40, 0x92, 0x3d, 0x67, 0x06, 0x09, 0x88, 0x48, 0xd8, - 0x29, 0x67, 0x92, 0x61, 0xbd, 0xaa, 0xb3, 0xf3, 0x3a, 0xbb, 0xa8, 0x1b, 0x3d, 0xd9, 0x48, 0x28, - 0x0a, 0x15, 0x60, 0xb4, 0x33, 0x63, 0x33, 0xa6, 0x3e, 0x9d, 0xec, 0x2b, 0xcf, 0xee, 0xfe, 0x69, - 0xa3, 0xfe, 0xfb, 0x5c, 0xe8, 0x50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0c, 0xa2, 0x7c, 0x4b, 0xe4, 0x69, 0x0a, 0x22, 0x68, 0xab, 0xd7, 0xe2, 0xd5, 0xdf, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xd8, 0x3a, 0xfe, 0x61, 0xae, 0x04, 0x00, 0x00, + // 567 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x4f, 0x6f, 0xd3, 0x4c, + 0x10, 0xc6, 0xe3, 0x26, 0x6f, 0x9a, 0x6c, 0xd2, 0x37, 0xb0, 0x24, 0xc5, 0x04, 0xc9, 0x58, 0x45, + 0x80, 0x25, 0xa8, 0xad, 0x96, 0x0b, 0xe2, 0xc0, 0x21, 0x91, 0x40, 0x96, 0x22, 0x51, 0xb9, 0x70, + 0x81, 0x83, 0x59, 0xaf, 0xa7, 0xe9, 0x82, 0x63, 0x07, 0xef, 0xa6, 0x52, 0xbf, 0x05, 0x1f, 0xab, + 0xc7, 0x9e, 0x10, 0x27, 0x84, 0x92, 0x2f, 0x82, 0xbc, 0xfe, 0x53, 0xbb, 0x55, 0x52, 0x71, 0xf3, + 0x8c, 0xe7, 0xf9, 0xcd, 0x33, 0xe3, 0x91, 0xd1, 0x53, 0x16, 0x7e, 0x05, 0x2a, 0xd8, 0x19, 0x58, + 0x51, 0x4c, 0x68, 0x00, 0xd6, 0xd9, 0x81, 0x07, 0x82, 0x1c, 0x58, 0x53, 0x08, 0x81, 0x33, 0x6e, + 0xce, 0xe3, 0x48, 0x44, 0x58, 0x2d, 0xea, 0xcc, 0xb4, 0xce, 0xcc, 0xea, 0x86, 0x4f, 0xd6, 0x12, + 0xb2, 0x42, 0x09, 0x18, 0xf6, 0xa7, 0xd1, 0x34, 0x92, 0x8f, 0x56, 0xf2, 0x94, 0x66, 0xf7, 0x7e, + 0x6e, 0xa3, 0xee, 0xbb, 0xb4, 0xd1, 0xb1, 0x20, 0x02, 0xf0, 0x1b,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x3c, 0x93, 0x46, 0x33, 0xcb, 0xce, 0x3d, 0x4f, 0x88, 0xc7, 0xad, 0x62, + 0x82, 0x7d, 0x1a, 0xc5, 0x50, 0x0e, 0x13, 0xb3, 0xd6, 0x2c, 0xf2, 0x17, 0x01, 0xf0, 0xfc, 0x87, + 0x25, 0xce, 0xe7, 0xc0, 0xbd, 0xa6, 0xfc, 0x25, 0xbd, 0xfc, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xfc, + 0xc1, 0x7e, 0x01, 0x13, 0x05, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -268,6 +278,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ChainlinkPriceStates) > 0 { + for iNdEx := len(m.ChainlinkPriceStates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ChainlinkPriceStates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + } if m.BandIbcLatestRequestId != 0 { i = encodeVarintGenesis(dAtA, i, uint64(m.BandIbcLatestRequestId)) i-- @@ -498,6 +522,12 @@ func (m *GenesisState) Size() (n int) { if m.BandIbcLatestRequestId != 0 { n += 1 + sovGenesis(uint64(m.BandIbcLatestRequestId)) } + if len(m.ChainlinkPriceStates) > 0 { + for _, e := range m.ChainlinkPriceStates { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -892,6 +922,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { break } } + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainlinkPriceStates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainlinkPriceStates = append(m.ChainlinkPriceStates, &ChainlinkPriceState{}) + if err := m.ChainlinkPriceStates[len(m.ChainlinkPriceStates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/chain/oracle/types/params.go b/chain/oracle/types/params.go index 8212d7fb..854d21ff 100644 --- a/chain/oracle/types/params.go +++ b/chain/oracle/types/params.go @@ -54,3 +54,18 @@ func DefaultBandIBCParams() BandIBCParams { func (p Params) Validate() error { return nil } + +func DefaultTestBandIbcParams() *BandIBCParams { + return &BandIBCParams{ + // true if Band IBC should be enabled + BandIbcEnabled: true, + // block request interval to send Band IBC prices + IbcRequestInterval: 10, + // band IBC source channel + IbcSourceChannel: "channel-0", + // band IBC version + IbcVersion: "bandchain-1", + // band IBC portID + IbcPortId: "oracle", + } +}