From de3d54ebc147109e0dbf37e67e24ad03f6a5fed2 Mon Sep 17 00:00:00 2001 From: Sorawit Suriyakarn Date: Sun, 10 May 2020 16:36:43 +0700 Subject: [PATCH] chain/automation: Write a script to generate all constructors --- chain/scripts/protocgen.sh | 8 +- chain/scripts/protoconstructorgen.py | 52 +++++ chain/x/oracle/types/constructors.go | 296 ++++++++++++++++++++++++++ chain/x/oracle/types/data_source.go | 17 -- chain/x/oracle/types/msgs.go | 136 ------------ chain/x/oracle/types/oracle_script.go | 18 -- chain/x/oracle/types/packets.go | 29 --- chain/x/oracle/types/params.go | 31 --- chain/x/oracle/types/report.go | 22 -- chain/x/oracle/types/request.go | 37 ---- chain/x/oracle/types/types.pb.go | 259 +++++++++++----------- chain/x/oracle/types/types.proto | 4 +- 12 files changed, 484 insertions(+), 425 deletions(-) create mode 100755 chain/scripts/protoconstructorgen.py create mode 100644 chain/x/oracle/types/constructors.go delete mode 100644 chain/x/oracle/types/data_source.go delete mode 100644 chain/x/oracle/types/oracle_script.go delete mode 100644 chain/x/oracle/types/report.go delete mode 100644 chain/x/oracle/types/request.go diff --git a/chain/scripts/protocgen.sh b/chain/scripts/protocgen.sh index 0818824a41..7763590d6f 100755 --- a/chain/scripts/protocgen.sh +++ b/chain/scripts/protocgen.sh @@ -5,7 +5,9 @@ set -eo pipefail proto_dirs=$(find . -path ./third_party -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) for dir in $proto_dirs; do protoc \ - -I. \ - --gocosmos_out=plugins=interfacetype,paths=source_relative:. \ - $(find "${dir}" -name '*.proto') + -I. \ + --gocosmos_out=plugins=interfacetype,paths=source_relative:. \ + $(find "${dir}" -name '*.proto') + + ./scripts/protoconstructorgen.py ${dir} done diff --git a/chain/scripts/protoconstructorgen.py b/chain/scripts/protoconstructorgen.py new file mode 100755 index 0000000000..2b6e5412e0 --- /dev/null +++ b/chain/scripts/protoconstructorgen.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 + + +import os +import re +import sys + + +PATTERN = re.compile(r"type (\w+) struct {") + + +def process_file(w, filepath): + with open(filepath, "r") as r: + content = "\n".join(r.readlines()) + for match in re.finditer(PATTERN, content): + typename = match.group(1) + w.write("\n") + w.write("func New{}(\n".format(typename)) + start = match.end() + 1 + end = start + content[start:].index("}") - 1 + members = [] + for rawline in content[start:end].split("\n"): + line = rawline.strip() + if line == "" or line.startswith("//"): + continue + tokens = line.split() + members.append((tokens[0], tokens[1])) + max_key_length = max(map(lambda mem: len(mem[0]), members)) + for (key, ty) in members: + w.write("\t{} {},\n".format(key, ty)) + w.write(") {} {{\n".format(typename)) + w.write("\treturn {}{{\n".format(typename)) + for (key, _) in members: + w.write("\t\t{}:{} {},\n".format(key, " " * (max_key_length - len(key)), key)) + w.write("\t}\n") + w.write("}\n") + + +def main(path): + with open(os.path.join(path, "constructors.go"), "w") as w: + w.write("// Code generated by protoconstructorgen.py. DO NOT EDIT.\n") + w.write("package {}\n".format(os.path.basename(path))) + w.write("\n") + w.write('import github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"\n') + + for filename in os.listdir(path): + if filename.endswith(".pb.go"): + process_file(w, os.path.join(path, filename)) + + +if __name__ == "__main__": + main(sys.argv[1]) diff --git a/chain/x/oracle/types/constructors.go b/chain/x/oracle/types/constructors.go new file mode 100644 index 0000000000..014a15b262 --- /dev/null +++ b/chain/x/oracle/types/constructors.go @@ -0,0 +1,296 @@ +// Code generated by protoconstructorgen.py. DO NOT EDIT. +package types + +import github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + +func NewMsgRequestData( + OracleScriptID OracleScriptID, + Calldata []byte, + AskCount int64, + MinCount int64, + ClientID string, + Sender github_com_cosmos_cosmos_sdk_types.AccAddress, +) MsgRequestData { + return MsgRequestData{ + OracleScriptID: OracleScriptID, + Calldata: Calldata, + AskCount: AskCount, + MinCount: MinCount, + ClientID: ClientID, + Sender: Sender, + } +} + +func NewMsgReportData( + RequestID RequestID, + DataSet []RawReport, + Validator github_com_cosmos_cosmos_sdk_types.ValAddress, + Reporter github_com_cosmos_cosmos_sdk_types.AccAddress, +) MsgReportData { + return MsgReportData{ + RequestID: RequestID, + DataSet: DataSet, + Validator: Validator, + Reporter: Reporter, + } +} + +func NewMsgCreateDataSource( + Owner github_com_cosmos_cosmos_sdk_types.AccAddress, + Name string, + Description string, + Executable []byte, + Sender github_com_cosmos_cosmos_sdk_types.AccAddress, +) MsgCreateDataSource { + return MsgCreateDataSource{ + Owner: Owner, + Name: Name, + Description: Description, + Executable: Executable, + Sender: Sender, + } +} + +func NewMsgEditDataSource( + DataSourceID DataSourceID, + Owner github_com_cosmos_cosmos_sdk_types.AccAddress, + Name string, + Description string, + Executable []byte, + Sender github_com_cosmos_cosmos_sdk_types.AccAddress, +) MsgEditDataSource { + return MsgEditDataSource{ + DataSourceID: DataSourceID, + Owner: Owner, + Name: Name, + Description: Description, + Executable: Executable, + Sender: Sender, + } +} + +func NewMsgCreateOracleScript( + Owner github_com_cosmos_cosmos_sdk_types.AccAddress, + Name string, + Description string, + Code []byte, + Schema string, + SourceCodeURL string, + Sender github_com_cosmos_cosmos_sdk_types.AccAddress, +) MsgCreateOracleScript { + return MsgCreateOracleScript{ + Owner: Owner, + Name: Name, + Description: Description, + Code: Code, + Schema: Schema, + SourceCodeURL: SourceCodeURL, + Sender: Sender, + } +} + +func NewMsgEditOracleScript( + OracleScriptID OracleScriptID, + Owner github_com_cosmos_cosmos_sdk_types.AccAddress, + Name string, + Description string, + Code []byte, + Schema string, + SourceCodeURL string, + Sender github_com_cosmos_cosmos_sdk_types.AccAddress, +) MsgEditOracleScript { + return MsgEditOracleScript{ + OracleScriptID: OracleScriptID, + Owner: Owner, + Name: Name, + Description: Description, + Code: Code, + Schema: Schema, + SourceCodeURL: SourceCodeURL, + Sender: Sender, + } +} + +func NewMsgAddOracleAddress( + Validator github_com_cosmos_cosmos_sdk_types.ValAddress, + Reporter github_com_cosmos_cosmos_sdk_types.AccAddress, +) MsgAddOracleAddress { + return MsgAddOracleAddress{ + Validator: Validator, + Reporter: Reporter, + } +} + +func NewMsgRemoveOracleAddress( + Validator github_com_cosmos_cosmos_sdk_types.ValAddress, + Reporter github_com_cosmos_cosmos_sdk_types.AccAddress, +) MsgRemoveOracleAddress { + return MsgRemoveOracleAddress{ + Validator: Validator, + Reporter: Reporter, + } +} + +func NewDataSource( + Owner github_com_cosmos_cosmos_sdk_types.AccAddress, + Name string, + Description string, + Executable []byte, +) DataSource { + return DataSource{ + Owner: Owner, + Name: Name, + Description: Description, + Executable: Executable, + } +} + +func NewOracleScript( + Owner github_com_cosmos_cosmos_sdk_types.AccAddress, + Name string, + Description string, + Code []byte, + Schema string, + SourceCodeURL string, +) OracleScript { + return OracleScript{ + Owner: Owner, + Name: Name, + Description: Description, + Code: Code, + Schema: Schema, + SourceCodeURL: SourceCodeURL, + } +} + +func NewRawRequest( + ExternalID ExternalID, + DataSourceID DataSourceID, + Calldata []byte, +) RawRequest { + return RawRequest{ + ExternalID: ExternalID, + DataSourceID: DataSourceID, + Calldata: Calldata, + } +} + +func NewRawReport( + ExternalID ExternalID, + ExitCode uint32, + Data []byte, +) RawReport { + return RawReport{ + ExternalID: ExternalID, + ExitCode: ExitCode, + Data: Data, + } +} + +func NewOracleRequestPacketData( + ClientID string, + OracleScriptID OracleScriptID, + Calldata string, + AskCount int64, + MinCount int64, +) OracleRequestPacketData { + return OracleRequestPacketData{ + ClientID: ClientID, + OracleScriptID: OracleScriptID, + Calldata: Calldata, + AskCount: AskCount, + MinCount: MinCount, + } +} + +func NewOracleResponsePacketData( + ClientID string, + RequestID RequestID, + AnsCount int64, + RequestTime int64, + ResolveTime int64, + ResolveStatus ResolveStatus, + Result string, +) OracleResponsePacketData { + return OracleResponsePacketData{ + ClientID: ClientID, + RequestID: RequestID, + AnsCount: AnsCount, + RequestTime: RequestTime, + ResolveTime: ResolveTime, + ResolveStatus: ResolveStatus, + Result: Result, + } +} + +func NewRequest( + OracleScriptID OracleScriptID, + Calldata []byte, + RequestedValidators []github_com_cosmos_cosmos_sdk_types.ValAddress, + MinCount int64, + RequestHeight int64, + RequestTime int64, + ClientID string, + IBC *RequestIBC, +) Request { + return Request{ + OracleScriptID: OracleScriptID, + Calldata: Calldata, + RequestedValidators: RequestedValidators, + MinCount: MinCount, + RequestHeight: RequestHeight, + RequestTime: RequestTime, + ClientID: ClientID, + IBC: IBC, + } +} + +func NewRequestIBC( + SourcePort string, + SourceChannel string, +) RequestIBC { + return RequestIBC{ + SourcePort: SourcePort, + SourceChannel: SourceChannel, + } +} + +func NewReport( + Validator github_com_cosmos_cosmos_sdk_types.ValAddress, + RawReports []RawReport, +) Report { + return Report{ + Validator: Validator, + RawReports: RawReports, + } +} + +func NewParams( + MaxDataSourceExecutableSize uint64, + MaxOracleScriptCodeSize uint64, + MaxCalldataSize uint64, + MaxRawRequestCount uint64, + MaxRawDataReportSize uint64, + MaxResultSize uint64, + MaxNameLength uint64, + MaxDescriptionLength uint64, + GasPerRawDataRequestPerValidator uint64, + ExpirationBlockCount uint64, + ExecuteGas uint64, + PrepareGas uint64, +) Params { + return Params{ + MaxDataSourceExecutableSize: MaxDataSourceExecutableSize, + MaxOracleScriptCodeSize: MaxOracleScriptCodeSize, + MaxCalldataSize: MaxCalldataSize, + MaxRawRequestCount: MaxRawRequestCount, + MaxRawDataReportSize: MaxRawDataReportSize, + MaxResultSize: MaxResultSize, + MaxNameLength: MaxNameLength, + MaxDescriptionLength: MaxDescriptionLength, + GasPerRawDataRequestPerValidator: GasPerRawDataRequestPerValidator, + ExpirationBlockCount: ExpirationBlockCount, + ExecuteGas: ExecuteGas, + PrepareGas: PrepareGas, + } +} diff --git a/chain/x/oracle/types/data_source.go b/chain/x/oracle/types/data_source.go deleted file mode 100644 index 047830ca2b..0000000000 --- a/chain/x/oracle/types/data_source.go +++ /dev/null @@ -1,17 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// NewDataSource creates a new DataSource instance. -func NewDataSource( - owner sdk.AccAddress, name string, description string, executable []byte, -) DataSource { - return DataSource{ - Owner: owner, - Name: name, - Description: description, - Executable: executable, - } -} diff --git a/chain/x/oracle/types/msgs.go b/chain/x/oracle/types/msgs.go index e4c7a731e3..0b5e764593 100644 --- a/chain/x/oracle/types/msgs.go +++ b/chain/x/oracle/types/msgs.go @@ -8,25 +8,6 @@ import ( // RouterKey is they name of the bank module const RouterKey = ModuleName -// NewMsgRequestData creates a new MsgRequestData instance. -func NewMsgRequestData( - oracleScriptID OracleScriptID, - calldata []byte, - askCount int64, - minCount int64, - clientID string, - sender sdk.AccAddress, -) MsgRequestData { - return MsgRequestData{ - OracleScriptID: oracleScriptID, - Calldata: calldata, - AskCount: askCount, - MinCount: minCount, - ClientID: clientID, - Sender: sender, - } -} - // Route implements the sdk.Msg interface for MsgRequestData. func (msg MsgRequestData) Route() string { return RouterKey } @@ -68,21 +49,6 @@ func (msg MsgRequestData) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -// NewMsgReportData creates a new MsgReportData instance. -func NewMsgReportData( - requestID RequestID, - dataSet []RawReport, - validator sdk.ValAddress, - reporter sdk.AccAddress, -) MsgReportData { - return MsgReportData{ - RequestID: requestID, - DataSet: dataSet, - Validator: validator, - Reporter: reporter, - } -} - // Route implements the sdk.Msg interface for MsgReportData. func (msg MsgReportData) Route() string { return RouterKey } @@ -124,23 +90,6 @@ func (msg MsgReportData) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -// NewMsgCreateDataSource creates a new MsgCreateDataSource instance. -func NewMsgCreateDataSource( - owner sdk.AccAddress, - name string, - description string, - executable []byte, - sender sdk.AccAddress, -) MsgCreateDataSource { - return MsgCreateDataSource{ - Owner: owner, - Name: name, - Description: description, - Executable: executable, - Sender: sender, - } -} - // Route implements the sdk.Msg interface for MsgCreateDataSource. func (msg MsgCreateDataSource) Route() string { return RouterKey } @@ -178,25 +127,6 @@ func (msg MsgCreateDataSource) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -// NewMsgEditDataSource creates a new MsgEditDataSource instance. -func NewMsgEditDataSource( - dataSourceID DataSourceID, - owner sdk.AccAddress, - name string, - description string, - executable []byte, - sender sdk.AccAddress, -) MsgEditDataSource { - return MsgEditDataSource{ - DataSourceID: dataSourceID, - Owner: owner, - Name: name, - Description: description, - Executable: executable, - Sender: sender, - } -} - // Route implements the sdk.Msg interface for MsgEditDataSource. func (msg MsgEditDataSource) Route() string { return RouterKey } @@ -238,27 +168,6 @@ func (msg MsgEditDataSource) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -// NewMsgCreateOracleScript creates a new MsgCreateOracleScript instance. -func NewMsgCreateOracleScript( - owner sdk.AccAddress, - name string, - description string, - code []byte, - schema string, - sourceCodeURL string, - sender sdk.AccAddress, -) MsgCreateOracleScript { - return MsgCreateOracleScript{ - Owner: owner, - Name: name, - Description: description, - Code: code, - Schema: schema, - SourceCodeURL: sourceCodeURL, - Sender: sender, - } -} - // Route implements the sdk.Msg interface for MsgCreateOracleScript. func (msg MsgCreateOracleScript) Route() string { return RouterKey } @@ -296,29 +205,6 @@ func (msg MsgCreateOracleScript) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -// NewMsgEditOracleScript creates a new MsgEditOracleScript instance. -func NewMsgEditOracleScript( - oracleScriptID OracleScriptID, - owner sdk.AccAddress, - name string, - description string, - code []byte, - schema string, - sourceCodeURL string, - sender sdk.AccAddress, -) MsgEditOracleScript { - return MsgEditOracleScript{ - OracleScriptID: oracleScriptID, - Owner: owner, - Name: name, - Description: description, - Code: code, - Schema: schema, - SourceCodeURL: sourceCodeURL, - Sender: sender, - } -} - // Route implements the sdk.Msg interface for MsgEditOracleScript. func (msg MsgEditOracleScript) Route() string { return RouterKey } @@ -356,17 +242,6 @@ func (msg MsgEditOracleScript) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -// NewMsgAddOracleAddress creates a new MsgAddOracleAddress instance. -func NewMsgAddOracleAddress( - validator sdk.ValAddress, - reporter sdk.AccAddress, -) MsgAddOracleAddress { - return MsgAddOracleAddress{ - Validator: validator, - Reporter: reporter, - } -} - // Route implements the sdk.Msg interface for MsgAddOracleAddress. func (msg MsgAddOracleAddress) Route() string { return RouterKey } @@ -395,17 +270,6 @@ func (msg MsgAddOracleAddress) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -// NewMsgRemoveOracleAddress creates a new MsgRemoveOracleAddress instance. -func NewMsgRemoveOracleAddress( - validator sdk.ValAddress, - reporter sdk.AccAddress, -) MsgRemoveOracleAddress { - return MsgRemoveOracleAddress{ - Validator: validator, - Reporter: reporter, - } -} - // Route implements the sdk.Msg interface for MsgRemoveOracleAddress. func (msg MsgRemoveOracleAddress) Route() string { return RouterKey } diff --git a/chain/x/oracle/types/oracle_script.go b/chain/x/oracle/types/oracle_script.go deleted file mode 100644 index b0a94cd340..0000000000 --- a/chain/x/oracle/types/oracle_script.go +++ /dev/null @@ -1,18 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// NewOracleScript creates a new OracleScript instance. -func NewOracleScript( - owner sdk.AccAddress, name string, description string, code []byte, schema string, sourceCodeURL string) OracleScript { - return OracleScript{ - Owner: owner, - Name: name, - Description: description, - Code: code, - Schema: schema, - SourceCodeURL: sourceCodeURL, - } -} diff --git a/chain/x/oracle/types/packets.go b/chain/x/oracle/types/packets.go index 38464d7d02..e5aa0da463 100644 --- a/chain/x/oracle/types/packets.go +++ b/chain/x/oracle/types/packets.go @@ -4,20 +4,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// NewOracleRequestPacketData creates a new OracleRequestPacketData instance. -func NewOracleRequestPacketData( - clientID string, oracleScriptID OracleScriptID, calldata string, - askCount int64, minCount int64, -) OracleRequestPacketData { - return OracleRequestPacketData{ - ClientID: clientID, - OracleScriptID: oracleScriptID, - Calldata: calldata, - AskCount: askCount, - MinCount: minCount, - } -} - // func (p OracleRequestPacketData) String() string { // return fmt.Sprintf(`OracleRequestPacketData: // ClientID: %s @@ -42,21 +28,6 @@ func (p OracleRequestPacketData) GetBytes() []byte { return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(p)) } -func NewOracleResponsePacketData( - clientID string, requestID RequestID, ansCount int64, requestTime int64, resolveTime int64, - resolveStatus ResolveStatus, result string, -) OracleResponsePacketData { - return OracleResponsePacketData{ - ClientID: clientID, - RequestID: requestID, - AnsCount: ansCount, - RequestTime: requestTime, - ResolveTime: resolveTime, - ResolveStatus: resolveStatus, - Result: result, - } -} - // func (p OracleResponsePacketData) String() string { // return fmt.Sprintf(`OracleResponsePacketData: // ClientID: %s diff --git a/chain/x/oracle/types/params.go b/chain/x/oracle/types/params.go index 6707a344ba..7a1a42fe72 100644 --- a/chain/x/oracle/types/params.go +++ b/chain/x/oracle/types/params.go @@ -72,37 +72,6 @@ var ( KeyPrepareGas = []byte("PrepareGas") ) -// NewParams creates a new Params object. -func NewParams( - maxDataSourceExecutableSize uint64, - maxOracleScriptCodeSize uint64, - maxCalldataSize uint64, - maxDataSourceCountPerRequest uint64, - maxRawDataReportSize uint64, - maxResultSize uint64, - maxNameLength uint64, - maxDescriptionLength uint64, - gasPerRawDataRequestPerValidator uint64, - expirationBlockCount uint64, - executeGas uint64, - prepareGas uint64, -) Params { - return Params{ - MaxDataSourceExecutableSize: maxDataSourceExecutableSize, - MaxOracleScriptCodeSize: maxOracleScriptCodeSize, - MaxCalldataSize: maxCalldataSize, - MaxRawRequestCount: maxDataSourceCountPerRequest, - MaxRawDataReportSize: maxRawDataReportSize, - MaxResultSize: maxResultSize, - MaxNameLength: maxNameLength, - MaxDescriptionLength: maxDescriptionLength, - GasPerRawDataRequestPerValidator: gasPerRawDataRequestPerValidator, - ExpirationBlockCount: expirationBlockCount, - ExecuteGas: executeGas, - PrepareGas: prepareGas, - } -} - // String implements the stringer interface for Params. func (p Params) String() string { return fmt.Sprintf(`oracle Params: diff --git a/chain/x/oracle/types/report.go b/chain/x/oracle/types/report.go deleted file mode 100644 index ba97f5eacb..0000000000 --- a/chain/x/oracle/types/report.go +++ /dev/null @@ -1,22 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// NewRawReport creates a new RawDataReport instance. -func NewRawReport(externalID ExternalID, exitCode uint32, data []byte) RawReport { - return RawReport{ - ExternalID: externalID, - ExitCode: exitCode, - Data: data, - } -} - -// NewReport is a contructor of Report -func NewReport(validator sdk.ValAddress, reports []RawReport) Report { - return Report{ - RawReports: reports, - Validator: validator, - } -} diff --git a/chain/x/oracle/types/request.go b/chain/x/oracle/types/request.go deleted file mode 100644 index 85aeb2d29f..0000000000 --- a/chain/x/oracle/types/request.go +++ /dev/null @@ -1,37 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// NewRequest creates a new Request instance. -func NewRequest( - oracleScriptID OracleScriptID, - calldata []byte, - requestedValidators []sdk.ValAddress, - minCount int64, - requestHeight int64, - requestTime int64, - clientID string, - ibc *RequestIBC, -) Request { - return Request{ - OracleScriptID: oracleScriptID, - Calldata: calldata, - RequestedValidators: requestedValidators, - MinCount: minCount, - RequestHeight: requestHeight, - RequestTime: requestTime, - ClientID: clientID, - IBC: ibc, - } -} - -// NewRawRequest creates a new RawRequest instance. -func NewRawRequest(externalID ExternalID, did DataSourceID, calldata []byte) RawRequest { - return RawRequest{ - ExternalID: externalID, - DataSourceID: did, - Calldata: calldata, - } -} diff --git a/chain/x/oracle/types/types.pb.go b/chain/x/oracle/types/types.pb.go index aa0f902bf4..6225900600 100644 --- a/chain/x/oracle/types/types.pb.go +++ b/chain/x/oracle/types/types.pb.go @@ -1308,8 +1308,8 @@ func (m *RequestIBC) GetSourceChannel() string { // Report is a report that contains operator address in struct type Report struct { - RawReports []RawReport `protobuf:"bytes,1,rep,name=raw_reports,json=rawReports,proto3" json:"raw_reports"` - Validator github_com_cosmos_cosmos_sdk_types.ValAddress `protobuf:"bytes,2,opt,name=validator,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ValAddress" json:"validator,omitempty"` + Validator github_com_cosmos_cosmos_sdk_types.ValAddress `protobuf:"bytes,1,opt,name=validator,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ValAddress" json:"validator,omitempty"` + RawReports []RawReport `protobuf:"bytes,2,rep,name=raw_reports,json=rawReports,proto3" json:"raw_reports"` } func (m *Report) Reset() { *m = Report{} } @@ -1345,16 +1345,16 @@ func (m *Report) XXX_DiscardUnknown() { var xxx_messageInfo_Report proto.InternalMessageInfo -func (m *Report) GetRawReports() []RawReport { +func (m *Report) GetValidator() github_com_cosmos_cosmos_sdk_types.ValAddress { if m != nil { - return m.RawReports + return m.Validator } return nil } -func (m *Report) GetValidator() github_com_cosmos_cosmos_sdk_types.ValAddress { +func (m *Report) GetRawReports() []RawReport { if m != nil { - return m.Validator + return m.RawReports } return nil } @@ -1516,101 +1516,100 @@ func init() { func init() { proto.RegisterFile("x/oracle/types/types.proto", fileDescriptor_53e65fd95a58412c) } var fileDescriptor_53e65fd95a58412c = []byte{ - // 1489 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0xcd, 0x6b, 0x1c, 0xc7, - 0x12, 0xd7, 0xcc, 0x7e, 0x68, 0xb7, 0x56, 0x2b, 0xcb, 0xe3, 0xaf, 0x45, 0x7a, 0x68, 0xf6, 0x99, - 0x67, 0x3d, 0xd9, 0xe0, 0x5d, 0xec, 0xf7, 0x30, 0xd8, 0x24, 0x10, 0xef, 0x4a, 0x56, 0x04, 0x96, - 0xad, 0x8c, 0x12, 0x1f, 0x7c, 0x19, 0x5a, 0x33, 0xcd, 0xee, 0xa0, 0xf9, 0xd8, 0x74, 0xcf, 0xca, - 0x6b, 0xdf, 0x72, 0xc8, 0x3d, 0xc7, 0x1c, 0x72, 0xf0, 0x5f, 0x10, 0x48, 0x20, 0x84, 0x10, 0xc8, - 0xd9, 0x10, 0x08, 0x3e, 0xe4, 0x90, 0x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 0xaa, 0xc5, 0xbc, 0x5c, - 0x0c, 0xbc, 0x50, 0x2e, 0x9e, 0x87, 0xb2, 0xe3, 0x7b, 0x34, 0x44, 0xf3, 0x0a, 0x75, 0x6d, 0xb5, - 0xdc, 0x9a, 0x1b, 0x0d, 0xcd, 0x52, 0x1b, 0x99, 0x9b, 0x6b, 0x56, 0x49, 0x2e, 0x6f, 0xba, 0xc6, - 0x26, 0x14, 0x39, 0x0d, 0x5d, 0xca, 0x6a, 0x45, 0x71, 0x7c, 0xeb, 0xd2, 0xd3, 0xa1, 0x79, 0xb1, + // 1483 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0xcf, 0x6b, 0x1b, 0xc7, + 0x17, 0xf7, 0xae, 0x7e, 0x58, 0x7a, 0xb2, 0x1c, 0x67, 0xf3, 0x4b, 0xd8, 0x5f, 0xbc, 0xfa, 0x86, + 0x6f, 0xfc, 0x75, 0x02, 0x91, 0x48, 0x5a, 0x02, 0x09, 0x2d, 0x34, 0x92, 0x1d, 0xd7, 0x10, 0x27, + 0xee, 0xba, 0xcd, 0x21, 0x97, 0x65, 0xbc, 0x3b, 0x48, 0x8b, 0xf7, 0x87, 0x3a, 0xb3, 0x72, 0x94, + 0xdc, 0x7a, 0xe8, 0xbd, 0xc7, 0x1e, 0x7a, 0xc8, 0x5f, 0x50, 0x68, 0xa1, 0x94, 0x52, 0xe8, 0x39, + 0x50, 0x28, 0x39, 0xf4, 0xd0, 0x93, 0x28, 0xca, 0xa5, 0xc7, 0x9e, 0x03, 0x85, 0x32, 0x6f, 0x66, + 0xb5, 0xab, 0xc6, 0x71, 0x1a, 0x57, 0x6d, 0x08, 0xbd, 0xc8, 0xfb, 0xde, 0xbc, 0x37, 0x33, 0xef, + 0xf3, 0x3e, 0xf3, 0xde, 0x8c, 0x61, 0x71, 0xd0, 0x8c, 0x18, 0x71, 0x7c, 0xda, 0x8c,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 0xad, 0x17, 0x31, 0x89, 0xd9, 0x55, + 0x00, 0x26, 0x21, 0x4c, 0xd1, 0x5a, 0x1c, 0x0d, 0xcd, 0xb2, 0x02, 0x16, 0x81, 0x4a, 0x05, 0xab, + 0xac, 0xac, 0x37, 0x5d, 0x63, 0x03, 0x4a, 0x02, 0x0a, 0x9b, 0xd3, 0xb8, 0xa6, 0xd7, 0x73, 0xab, + 0x95, 0xcb, 0x2b, 0x8d, 0x43, 0x32, 0xdb, 0xb0, 0xc8, 0x3d, 0xb9, 0x70, 0x2b, 0xff, 0x68, 0x68, + 0xce, 0x58, 0xb3, 0xc2, 0x7b, 0x87, 0xc6, 0xc6, 0x6d, 0x28, 0xef, 0x13, 0xdf, 0x73, 0x49, 0x1c, + 0x31, 0xc4, 0xf2, 0xcf, 0x47, 0x7a, 0x87, 0xf8, 0x49, 0xa4, 0xe9, 0x1c, 0xc6, 0x16, 0x94, 0x18, + 0xae, 0x44, 0x19, 0xc2, 0x7f, 0x24, 0xe4, 0xc6, 0x53, 0x28, 0xec, 0x3e, 0xd6, 0xe1, 0xc4, 0x16, 0xef, 0xb4, 0x19, 0x25, 0x31, 0x15, 0xd8, 0xed, 0x44, 0x7d, 0xe6, 0x50, 0x63, 0x03, 0x0a, 0xd1, - 0xbd, 0x90, 0x32, 0x04, 0xef, 0x48, 0x27, 0x49, 0x7d, 0xc3, 0x80, 0x7c, 0x48, 0x02, 0x8a, 0xa9, - 0x56, 0xb6, 0xf0, 0xdb, 0xa8, 0x43, 0xc5, 0xa5, 0x32, 0x9b, 0xbd, 0x28, 0x44, 0x70, 0xca, 0x56, - 0x96, 0x65, 0x2c, 0x03, 0xd0, 0x01, 0x75, 0xfa, 0x31, 0xd9, 0xf5, 0xa9, 0xf4, 0xd6, 0xca, 0x70, - 0x32, 0x39, 0x54, 0x98, 0x4e, 0x0e, 0xfd, 0xa8, 0xc3, 0xf1, 0x2d, 0xde, 0x59, 0x77, 0xbd, 0x38, - 0x83, 0xc2, 0x0d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0, 0x4e, 0xd8, 0x2e, 0x7d, 0x72, + 0xe8, 0x73, 0x2c, 0x20, 0x83, 0xb6, 0xd2, 0xa3, 0xed, 0x25, 0x38, 0x25, 0x6c, 0x25, 0x26, 0x92, + 0x67, 0x29, 0x5f, 0xf3, 0x96, 0x11, 0x90, 0x41, 0xda, 0x26, 0x25, 0x73, 0xaf, 0x40, 0x2d, 0x71, + 0xc1, 0xe9, 0x25, 0x96, 0x72, 0x95, 0x02, 0x7a, 0x9d, 0x94, 0x5e, 0x22, 0x3c, 0x09, 0x14, 0x2e, + 0xb5, 0x02, 0xc7, 0xd0, 0x0f, 0x0b, 0x80, 0x34, 0x2f, 0xa2, 0x79, 0x55, 0x98, 0xa3, 0x36, 0x6b, + 0x27, 0x6e, 0x0d, 0xb6, 0x4f, 0xc3, 0x4e, 0xdc, 0x45, 0x56, 0x4b, 0xbb, 0x5b, 0x24, 0xa0, 0x37, + 0x51, 0x69, 0xbc, 0x09, 0xa7, 0x11, 0xea, 0xf4, 0x0a, 0x91, 0x98, 0x97, 0xc6, 0xbb, 0x58, 0x4b, + 0x07, 0x95, 0xd7, 0x36, 0xac, 0x74, 0x08, 0xb7, 0x7b, 0x94, 0x65, 0x23, 0x90, 0x91, 0x0b, 0x65, + 0x4a, 0xb7, 0x32, 0xce, 0x52, 0xef, 0x10, 0xbe, 0x4d, 0xd9, 0x38, 0x1c, 0xd9, 0xf0, 0x28, 0x1b, + 0x9f, 0x73, 0xb1, 0x0f, 0x3a, 0xe8, 0x79, 0x8c, 0xe0, 0x16, 0x76, 0xfd, 0xc8, 0x49, 0x1a, 0x0d, + 0xc8, 0x7d, 0xa4, 0xa3, 0x2d, 0x31, 0x28, 0x51, 0x34, 0x45, 0xeb, 0x16, 0x49, 0xa7, 0x76, 0x87, + 0xf0, 0x5a, 0x05, 0x4d, 0xd5, 0x25, 0x8d, 0x6e, 0x10, 0x2e, 0x0c, 0x7a, 0x8c, 0xf6, 0x08, 0x93, + 0x06, 0x73, 0xd2, 0x40, 0xa9, 0x36, 0x08, 0xbf, 0x56, 0xfa, 0xf4, 0xa1, 0x39, 0x23, 0xf8, 0x77, + 0xe1, 0x1d, 0xa8, 0x4e, 0x14, 0x61, 0xa3, 0x04, 0xf9, 0xdb, 0x3d, 0x1a, 0x2e, 0xcc, 0x18, 0x15, + 0x98, 0xdd, 0xe9, 0x3b, 0x0e, 0xe5, 0x7c, 0x41, 0x13, 0xc2, 0x0d, 0xe2, 0xf9, 0x7d, 0x46, 0x17, + 0x74, 0x21, 0xac, 0x8b, 0x8d, 0x51, 0x77, 0x21, 0xd7, 0xda, 0x7e, 0x34, 0x5a, 0xd6, 0x1e, 0x8f, + 0x96, 0xb5, 0x9f, 0x47, 0xcb, 0xda, 0x27, 0x4f, 0x96, 0x67, 0x1e, 0x3f, 0x59, 0x9e, 0xf9, 0xe9, + 0xc9, 0xf2, 0xcc, 0xdd, 0x2b, 0x99, 0xa3, 0x26, 0x4e, 0x09, 0xfe, 0x97, 0xd0, 0x89, 0xfc, 0xe6, + 0xf8, 0xc8, 0x34, 0xe5, 0xef, 0xe4, 0x3f, 0x26, 0x77, 0x8b, 0x68, 0xf8, 0xc6, 0xef, 0x01, 0x00, + 0x00, 0xff, 0xff, 0x0a, 0xe8, 0x5e, 0xa6, 0xb1, 0x14, 0x00, 0x00, } func (this *MsgRequestData) Equal(that interface{}) bool { @@ -2212,6 +2211,9 @@ func (this *Report) Equal(that interface{}) bool { } else if this == nil { return false } + if !bytes.Equal(this.Validator, that1.Validator) { + return false + } if len(this.RawReports) != len(that1.RawReports) { return false } @@ -2220,9 +2222,6 @@ func (this *Report) Equal(that interface{}) bool { return false } } - if !bytes.Equal(this.Validator, that1.Validator) { - return false - } return true } func (this *Params) Equal(that interface{}) bool { @@ -3186,13 +3185,6 @@ func (m *Report) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Validator) > 0 { - i -= len(m.Validator) - copy(dAtA[i:], m.Validator) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Validator))) - i-- - dAtA[i] = 0x12 - } if len(m.RawReports) > 0 { for iNdEx := len(m.RawReports) - 1; iNdEx >= 0; iNdEx-- { { @@ -3204,9 +3196,16 @@ func (m *Report) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 } } + if len(m.Validator) > 0 { + i -= len(m.Validator) + copy(dAtA[i:], m.Validator) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Validator))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -3748,16 +3747,16 @@ func (m *Report) Size() (n int) { } var l int _ = l + l = len(m.Validator) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } if len(m.RawReports) > 0 { for _, e := range m.RawReports { l = e.Size() n += 1 + l + sovTypes(uint64(l)) } } - l = len(m.Validator) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } return n } @@ -6961,9 +6960,9 @@ func (m *Report) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RawReports", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -6973,31 +6972,31 @@ func (m *Report) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.RawReports = append(m.RawReports, RawReport{}) - if err := m.RawReports[len(m.RawReports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Validator = append(m.Validator[:0], dAtA[iNdEx:postIndex]...) + if m.Validator == nil { + m.Validator = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RawReports", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -7007,24 +7006,24 @@ func (m *Report) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } - m.Validator = append(m.Validator[:0], dAtA[iNdEx:postIndex]...) - if m.Validator == nil { - m.Validator = []byte{} + m.RawReports = append(m.RawReports, RawReport{}) + if err := m.RawReports[len(m.RawReports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex default: diff --git a/chain/x/oracle/types/types.proto b/chain/x/oracle/types/types.proto index e5e491e066..1e68ce6449 100644 --- a/chain/x/oracle/types/types.proto +++ b/chain/x/oracle/types/types.proto @@ -273,9 +273,9 @@ message RequestIBC { message Report { option (gogoproto.equal) = true; - repeated RawReport raw_reports = 1 [(gogoproto.nullable) = false]; - bytes validator = 2 + bytes validator = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"]; + repeated RawReport raw_reports = 2 [(gogoproto.nullable) = false]; } // Params - used for initializing default parameter for oracle at genesis.