Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: stargate: Update proto files based on Panacea v2.0.0 #43

Merged
merged 1 commit into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"proto-gen": "./protocgen.sh",
"build": "tsc --module commonjs",
"test": "jest",
"test": "jest --runInBand",
"lint": "eslint src test --ext .ts,.tsx",
"doc": "typedoc",
"prepublishOnly": "npm run build"
Expand Down
8 changes: 4 additions & 4 deletions protodep.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ proto_outdir = "./third_party/proto"

[[dependencies]]
target = "github.com/medibloc/panacea-core/proto"
revision = "8f8223bd73d6d1aabb9eb0a56f1f402ff7c49f47"
branch = "stargate"
revision = "fba1c1c6a14e9c1ff7853094ac8665feea82a41e"
branch = ""
path = ""
protocol = ""

[[dependencies]]
target = "github.com/cosmos/cosmos-sdk/third_party/proto"
revision = "842b06003f97d31e4ec83847e9fe8185d51a1fc7"
revision = "84c33215658131d87daf3c629e909e12ed9370fa"
branch = ""
path = ""
protocol = ""

[[dependencies]]
target = "github.com/cosmos/cosmos-sdk/proto"
revision = "842b06003f97d31e4ec83847e9fe8185d51a1fc7"
revision = "84c33215658131d87daf3c629e909e12ed9370fa"
branch = ""
path = ""
protocol = ""
6 changes: 3 additions & 3 deletions protodep.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ proto_outdir = "./third_party/proto"

[[dependencies]]
target = "github.com/medibloc/panacea-core/proto"
branch = "stargate" # TODO: use a specific revision
revision = "v2.0.0"

[[dependencies]]
target = "github.com/cosmos/cosmos-sdk/third_party/proto"
revision = "v0.42.5"
revision = "v0.42.7"

[[dependencies]]
target = "github.com/cosmos/cosmos-sdk/proto"
revision = "v0.42.5"
revision = "v0.42.7"


14 changes: 7 additions & 7 deletions src/panacea-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { createProtobufRpcClient, StargateClient } from "@cosmjs/stargate";
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
import {
QueryClientImpl as AolQueryClientImpl,
QueryListTopicsResponse,
QueryListWritersResponse
QueryTopicsResponse,
QueryWritersResponse
} from "./proto/panacea/aol/v2/query";
import { Topic } from "./proto/panacea/aol/v2/topic";
import { PageRequest } from "./proto/cosmos/base/query/v1beta1/pagination";
Expand Down Expand Up @@ -34,7 +34,7 @@ export class PanaceaClient extends StargateClient {
const queryService = new AolQueryClientImpl(createProtobufRpcClient(this.forceGetQueryClient()));
try {
const resp = await queryService.Topic({ownerAddress: ownerAddress, topicName: topicName});
return resp.Topic ?? null;
return resp.topic ?? null;
} catch (error) {
if (rpcErrMsgNotFound.test(error)) {
return null;
Expand All @@ -43,7 +43,7 @@ export class PanaceaClient extends StargateClient {
}
}

async getTopics(ownerAddress: string, pageRequest?: PageRequest): Promise<QueryListTopicsResponse> {
async getTopics(ownerAddress: string, pageRequest?: PageRequest): Promise<QueryTopicsResponse> {
const queryService = new AolQueryClientImpl(createProtobufRpcClient(this.forceGetQueryClient()));
return await queryService.Topics({ownerAddress: ownerAddress, pagination: pageRequest});
}
Expand All @@ -56,7 +56,7 @@ export class PanaceaClient extends StargateClient {
topicName: topicName,
writerAddress: writerAddress
});
return resp.Writer ?? null;
return resp.writer ?? null;
} catch (error) {
if (rpcErrMsgNotFound.test(error)) {
return null;
Expand All @@ -65,7 +65,7 @@ export class PanaceaClient extends StargateClient {
}
}

async getWriters(ownerAddress: string, topicName: string, pageRequest?: PageRequest): Promise<QueryListWritersResponse> {
async getWriters(ownerAddress: string, topicName: string, pageRequest?: PageRequest): Promise<QueryWritersResponse> {
const queryService = new AolQueryClientImpl(createProtobufRpcClient(this.forceGetQueryClient()));
return await queryService.Writers({ownerAddress: ownerAddress, topicName: topicName, pagination: pageRequest});
}
Expand All @@ -74,7 +74,7 @@ export class PanaceaClient extends StargateClient {
const queryService = new AolQueryClientImpl(createProtobufRpcClient(this.forceGetQueryClient()));
try {
const resp = await queryService.Record({ownerAddress: ownerAddress, topicName: topicName, offset: offset})
return resp.Record ?? null;
return resp.record ?? null;
} catch (error) {
if (rpcErrMsgNotFound.test(error)) {
return null;
Expand Down
16 changes: 8 additions & 8 deletions src/proto/google/protobuf/descriptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,18 +435,18 @@ export interface FileOptions {
*/
javaPackage: string;
/**
* Controls the name of the wrapper Java class generated for the .proto file.
* That class will always contain the .proto file's getDescriptor() method as
* well as any top-level extensions defined in the .proto file.
* If java_multiple_files is disabled, then all the other classes from the
* .proto file will be nested inside the single wrapper outer class.
* If set, all the classes from the .proto file are wrapped in a single
* outer class with the given name. This applies to both Proto1
* (equivalent to the old "--one_java_file" option) and Proto2 (where
* a .proto always translates to a single class, but you may want to
* explicitly choose the class name).
*/
javaOuterClassname: string;
/**
* If enabled, then the Java code generator will generate a separate .java
* If set true, then the Java code generator will generate a separate .java
* file for each top-level message, enum, and service defined in the .proto
* file. Thus, these types will *not* be nested inside the wrapper class
* named by java_outer_classname. However, the wrapper class will still be
* file. Thus, these types will *not* be nested inside the outer class
* named by java_outer_classname. However, the outer class will still be
* generated to contain the file's getDescriptor() method as well as any
* top-level extensions defined in the file.
*/
Expand Down
1 change: 1 addition & 0 deletions src/proto/panacea/aol/v2/owner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import _m0 from "protobufjs/minimal";

export const protobufPackage = "panacea.aol.v2";

/** Owner defines a owner type. */
export interface Owner {
totalTopics: Long;
}
Expand Down
Loading