Skip to content

Commit

Permalink
Update protobufs for ContractHistory query
Browse files Browse the repository at this point in the history
  • Loading branch information
assafmo committed Jun 13, 2023
1 parent 68418d4 commit 0e31cb3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 50 deletions.
3 changes: 0 additions & 3 deletions src/grpc_gateway/secret/compute/v1beta1/query.pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

import * as CosmosBaseAbciV1beta1Abci from "../../../cosmos/base/abci/v1beta1/abci.pb"
import * as CosmosBaseQueryV1beta1Pagination from "../../../cosmos/base/query/v1beta1/pagination.pb"
import * as fm from "../../../fetch.pb"
import * as GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
import * as SecretComputeV1beta1Types from "./types.pb"
Expand Down Expand Up @@ -89,12 +88,10 @@ export type DecryptedAnswers = {

export type QueryContractHistoryRequest = {
contract_address?: string
pagination?: CosmosBaseQueryV1beta1Pagination.PageRequest
}

export type QueryContractHistoryResponse = {
entries?: SecretComputeV1beta1Types.ContractCodeHistoryEntry[]
pagination?: CosmosBaseQueryV1beta1Pagination.PageResponse
}

export class Query {
Expand Down
49 changes: 2 additions & 47 deletions src/protobuf/secret/compute/v1beta1/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
import Long from "long";
import * as _m0 from "protobufjs/minimal";
import { ContractInfo, ContractCodeHistoryEntry } from "./types";
import {
PageRequest,
PageResponse,
} from "../../../cosmos/base/query/v1beta1/pagination";
import { StringEvent } from "../../../cosmos/base/abci/v1beta1/abci";
import { Empty } from "../../../google/protobuf/empty";

Expand Down Expand Up @@ -105,8 +101,6 @@ export interface DecryptedAnswers {
export interface QueryContractHistoryRequest {
/** address is the address of the contract to query */
contract_address: string;
/** pagination defines an optional pagination for the request. */
pagination?: PageRequest;
}

/**
Expand All @@ -115,8 +109,6 @@ export interface QueryContractHistoryRequest {
*/
export interface QueryContractHistoryResponse {
entries: ContractCodeHistoryEntry[];
/** pagination defines the pagination in the response. */
pagination?: PageResponse;
}

function createBaseQuerySecretContractRequest(): QuerySecretContractRequest {
Expand Down Expand Up @@ -1262,7 +1254,7 @@ export const DecryptedAnswers = {
};

function createBaseQueryContractHistoryRequest(): QueryContractHistoryRequest {
return { contract_address: "", pagination: undefined };
return { contract_address: "" };
}

export const QueryContractHistoryRequest = {
Expand All @@ -1273,9 +1265,6 @@ export const QueryContractHistoryRequest = {
if (message.contract_address !== "") {
writer.uint32(10).string(message.contract_address);
}
if (message.pagination !== undefined) {
PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim();
}
return writer;
},

Expand All @@ -1292,9 +1281,6 @@ export const QueryContractHistoryRequest = {
case 1:
message.contract_address = reader.string();
break;
case 2:
message.pagination = PageRequest.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
Expand All @@ -1308,20 +1294,13 @@ export const QueryContractHistoryRequest = {
contract_address: isSet(object.contract_address)
? String(object.contract_address)
: "",
pagination: isSet(object.pagination)
? PageRequest.fromJSON(object.pagination)
: undefined,
};
},

toJSON(message: QueryContractHistoryRequest): unknown {
const obj: any = {};
message.contract_address !== undefined &&
(obj.contract_address = message.contract_address);
message.pagination !== undefined &&
(obj.pagination = message.pagination
? PageRequest.toJSON(message.pagination)
: undefined);
return obj;
},

Expand All @@ -1330,16 +1309,12 @@ export const QueryContractHistoryRequest = {
): QueryContractHistoryRequest {
const message = createBaseQueryContractHistoryRequest();
message.contract_address = object.contract_address ?? "";
message.pagination =
object.pagination !== undefined && object.pagination !== null
? PageRequest.fromPartial(object.pagination)
: undefined;
return message;
},
};

function createBaseQueryContractHistoryResponse(): QueryContractHistoryResponse {
return { entries: [], pagination: undefined };
return { entries: [] };
}

export const QueryContractHistoryResponse = {
Expand All @@ -1350,12 +1325,6 @@ export const QueryContractHistoryResponse = {
for (const v of message.entries) {
ContractCodeHistoryEntry.encode(v!, writer.uint32(10).fork()).ldelim();
}
if (message.pagination !== undefined) {
PageResponse.encode(
message.pagination,
writer.uint32(18).fork(),
).ldelim();
}
return writer;
},

Expand All @@ -1374,9 +1343,6 @@ export const QueryContractHistoryResponse = {
ContractCodeHistoryEntry.decode(reader, reader.uint32()),
);
break;
case 2:
message.pagination = PageResponse.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
Expand All @@ -1390,9 +1356,6 @@ export const QueryContractHistoryResponse = {
entries: Array.isArray(object?.entries)
? object.entries.map((e: any) => ContractCodeHistoryEntry.fromJSON(e))
: [],
pagination: isSet(object.pagination)
? PageResponse.fromJSON(object.pagination)
: undefined,
};
},

Expand All @@ -1405,10 +1368,6 @@ export const QueryContractHistoryResponse = {
} else {
obj.entries = [];
}
message.pagination !== undefined &&
(obj.pagination = message.pagination
? PageResponse.toJSON(message.pagination)
: undefined);
return obj;
},

Expand All @@ -1418,10 +1377,6 @@ export const QueryContractHistoryResponse = {
const message = createBaseQueryContractHistoryResponse();
message.entries =
object.entries?.map((e) => ContractCodeHistoryEntry.fromPartial(e)) || [];
message.pagination =
object.pagination !== undefined && object.pagination !== null
? PageResponse.fromPartial(object.pagination)
: undefined;
return message;
},
};
Expand Down

0 comments on commit 0e31cb3

Please sign in to comment.