Skip to content

Commit

Permalink
fix field names with numbers like header1
Browse files Browse the repository at this point in the history
  • Loading branch information
Zetazzz committed Jun 21, 2023
1 parent d9db745 commit a1c8090
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,8 @@ export const Misbehaviour = {
fromSDK(object: MisbehaviourSDKType): Misbehaviour {
return {
clientId: object?.client_id,
header_1: object.header_1 ? Header.fromSDK(object.header_1) : undefined,
header_2: object.header_2 ? Header.fromSDK(object.header_2) : undefined
header1: object.header_1 ? Header.fromSDK(object.header_1) : undefined,
header2: object.header_2 ? Header.fromSDK(object.header_2) : undefined
};
},
fromSDKJSON(object: any): MisbehaviourSDKType {
Expand All @@ -532,8 +532,8 @@ export const Misbehaviour = {
toSDK(message: Misbehaviour): MisbehaviourSDKType {
const obj: any = {};
obj.client_id = message.clientId;
message.header_1 !== undefined && (obj.header_1 = message.header_1 ? Header.toSDK(message.header_1) : undefined);
message.header_2 !== undefined && (obj.header_2 = message.header_2 ? Header.toSDK(message.header_2) : undefined);
message.header1 !== undefined && (obj.header_1 = message.header1 ? Header.toSDK(message.header1) : undefined);
message.header2 !== undefined && (obj.header_2 = message.header2 ? Header.toSDK(message.header2) : undefined);
return obj;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -727,29 +727,29 @@ export const Misbehaviour = {
fromSDK(object: MisbehaviourSDKType): Misbehaviour {
return {
clientId: object?.client_id,
header_1: object.header_1 ? Header.fromSDK(object.header_1) : undefined,
header_2: object.header_2 ? Header.fromSDK(object.header_2) : undefined
header1: object.header_1 ? Header.fromSDK(object.header_1) : undefined,
header2: object.header_2 ? Header.fromSDK(object.header_2) : undefined
};
},
toSDK(message: Misbehaviour): MisbehaviourSDKType {
const obj: any = {};
obj.client_id = message.clientId;
message.header_1 !== undefined && (obj.header_1 = message.header_1 ? Header.toSDK(message.header_1) : undefined);
message.header_2 !== undefined && (obj.header_2 = message.header_2 ? Header.toSDK(message.header_2) : undefined);
message.header1 !== undefined && (obj.header_1 = message.header1 ? Header.toSDK(message.header1) : undefined);
message.header2 !== undefined && (obj.header_2 = message.header2 ? Header.toSDK(message.header2) : undefined);
return obj;
},
fromAmino(object: MisbehaviourAmino): Misbehaviour {
return {
clientId: object.client_id,
header_1: object?.header_1 ? Header.fromAmino(object.header_1) : undefined,
header_2: object?.header_2 ? Header.fromAmino(object.header_2) : undefined
header1: object?.header_1 ? Header.fromAmino(object.header_1) : undefined,
header2: object?.header_2 ? Header.fromAmino(object.header_2) : undefined
};
},
toAmino(message: Misbehaviour): MisbehaviourAmino {
const obj: any = {};
obj.client_id = message.clientId;
obj.header_1 = message.header_1 ? Header.toAmino(message.header_1) : undefined;
obj.header_2 = message.header_2 ? Header.toAmino(message.header_2) : undefined;
obj.header_1 = message.header1 ? Header.toAmino(message.header1) : undefined;
obj.header_2 = message.header2 ? Header.toAmino(message.header2) : undefined;
return obj;
},
fromAminoMsg(object: MisbehaviourAminoMsg): Misbehaviour {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -727,29 +727,29 @@ export const Misbehaviour = {
fromSDK(object: MisbehaviourSDKType): Misbehaviour {
return {
clientId: object?.client_id,
header_1: object.header_1 ? Header.fromSDK(object.header_1) : undefined,
header_2: object.header_2 ? Header.fromSDK(object.header_2) : undefined
header1: object.header_1 ? Header.fromSDK(object.header_1) : undefined,
header2: object.header_2 ? Header.fromSDK(object.header_2) : undefined
};
},
toSDK(message: Misbehaviour): MisbehaviourSDKType {
const obj: any = {};
obj.client_id = message.clientId;
message.header_1 !== undefined && (obj.header_1 = message.header_1 ? Header.toSDK(message.header_1) : undefined);
message.header_2 !== undefined && (obj.header_2 = message.header_2 ? Header.toSDK(message.header_2) : undefined);
message.header1 !== undefined && (obj.header_1 = message.header1 ? Header.toSDK(message.header1) : undefined);
message.header2 !== undefined && (obj.header_2 = message.header2 ? Header.toSDK(message.header2) : undefined);
return obj;
},
fromAmino(object: MisbehaviourAmino): Misbehaviour {
return {
clientId: object.client_id,
header_1: object?.header_1 ? Header.fromAmino(object.header_1) : undefined,
header_2: object?.header_2 ? Header.fromAmino(object.header_2) : undefined
header1: object?.header_1 ? Header.fromAmino(object.header_1) : undefined,
header2: object?.header_2 ? Header.fromAmino(object.header_2) : undefined
};
},
toAmino(message: Misbehaviour): MisbehaviourAmino {
const obj: any = {};
obj.client_id = message.clientId;
obj.header_1 = message.header_1 ? Header.toAmino(message.header_1) : undefined;
obj.header_2 = message.header_2 ? Header.toAmino(message.header_2) : undefined;
obj.header_1 = message.header1 ? Header.toAmino(message.header1) : undefined;
obj.header_2 = message.header2 ? Header.toAmino(message.header2) : undefined;
return obj;
},
fromAminoMsg(object: MisbehaviourAminoMsg): Misbehaviour {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,8 @@ export const Misbehaviour = {
fromSDK(object: MisbehaviourSDKType): Misbehaviour {
return {
clientId: object?.client_id,
header_1: object.header_1 ? Header.fromSDK(object.header_1) : undefined,
header_2: object.header_2 ? Header.fromSDK(object.header_2) : undefined
header1: object.header_1 ? Header.fromSDK(object.header_1) : undefined,
header2: object.header_2 ? Header.fromSDK(object.header_2) : undefined
};
},
fromSDKJSON(object: any): MisbehaviourSDKType {
Expand All @@ -532,8 +532,8 @@ export const Misbehaviour = {
toSDK(message: Misbehaviour): MisbehaviourSDKType {
const obj: any = {};
obj.client_id = message.clientId;
message.header_1 !== undefined && (obj.header_1 = message.header_1 ? Header.toSDK(message.header_1) : undefined);
message.header_2 !== undefined && (obj.header_2 = message.header_2 ? Header.toSDK(message.header_2) : undefined);
message.header1 !== undefined && (obj.header_1 = message.header1 ? Header.toSDK(message.header1) : undefined);
message.header2 !== undefined && (obj.header_2 = message.header2 ? Header.toSDK(message.header2) : undefined);
return obj;
}
};
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
},
"dependencies": {
"@babel/runtime": "^7.21.0",
"@cosmology/protobufjs": "6.11.6",
"@osmonauts/types": "^0.35.0",
"@pyramation/protobufjs": "6.11.5",
"dotty": "0.1.2",
"glob": "8.0.3",
"minimatch": "5.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/parser/src/store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sync as glob } from 'glob';
import { parse } from '@pyramation/protobufjs';
import { parse } from '@cosmology/protobufjs';
import { readFileSync } from 'fs';
import { join, resolve as pathResolve } from 'path';
import { ALLOWED_RPC_SERVICES, ProtoDep, ProtoField, ProtoRef, ProtoServiceMethod, ProtoType, TelescopeOptions } from '@osmonauts/types';
Expand Down Expand Up @@ -144,7 +144,7 @@ export class ProtoStore {

// NOT FOUND
const filler = GOOGLE_PROTOS.find(([f, v]) => { return f === goog });
if (!filler) return; // technically an error should be thrown
if (!filler) return; // technically an error should be thrown

// we have the filler
if (!neededFromGoogle.find(file => file.filename === goog)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/src/traverse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
getPluginValue
} from '@osmonauts/ast';

import { Service, Type, Field, Enum, Root, Namespace } from '@pyramation/protobufjs';
import { Service, Type, Field, Enum, Root, Namespace } from '@cosmology/protobufjs';
import { importLookup, lookup, lookupAny, lookupNested, protoScopeImportLookup } from './lookup';
import { parseService } from './services';
import { ProtoStore } from './store';
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dotty from 'dotty';
import { Service, Type, Enum, Root, Namespace } from '@pyramation/protobufjs';
import { Service, Type, Enum, Root, Namespace } from '@cosmology/protobufjs';
import { InterfaceTypeUrlMap, ProtoRef, ProtoRoot, ProtoType } from '@osmonauts/types';
import { ProtoStore } from './store';
import { GenericParseContext, getTypeUrl, getAminoTypeName, getPluginValue } from '@osmonauts/ast';
Expand Down
4 changes: 2 additions & 2 deletions packages/parser/types/store.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface ParseProtoOptions {
alternateCommentMode?: boolean;
preferTrailingComment?: boolean;
}
export declare const parseProto: (content: any, options?: ParseProtoOptions) => import("@pyramation/protobufjs").IParserResult;
export declare const parseProto: (content: any, options?: ParseProtoOptions) => import("@cosmology/protobufjs").IParserResult;
export declare class ProtoStore {
files: string[];
protoDirs: string[];
Expand All @@ -30,7 +30,7 @@ export declare class ProtoStore {
}[]): {
absolute: string;
filename: string;
proto: import("@pyramation/protobufjs").IParserResult;
proto: import("@cosmology/protobufjs").IParserResult;
}[];
getProtos(): ProtoRef[];
getPackages(): string[];
Expand Down
56 changes: 28 additions & 28 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1754,10 +1754,29 @@
secrets.js-grempe "2.0.0"
typescript "^4.7.4"

"@cosmwasm/ts-codegen@0.26.0":
version "0.26.0"
resolved "https://registry.npmjs.org/@cosmwasm/ts-codegen/-/ts-codegen-0.26.0.tgz#f1aef0c2194be5d775a9300940adefc461ceccd9"
integrity sha512-bALTObAlsPBNZHvCGBdYH7RUu+v563fvbbVgwN/WTok5tFnvB9klEQa3DtEZUOuczD20rqfsDxAC8Q17v2hhlw==
"@cosmology/protobufjs@6.11.6":
version "6.11.6"
resolved "https://registry.npmjs.org/@cosmology/protobufjs/-/protobufjs-6.11.6.tgz#6f7bd340ab4a27969b1f75b4bff21a74e03b971a"
integrity sha512-k1opGC9CTX5vD2447pUqLmleVv0Kb8RasBUxkZHudVOvuXs2qAAGONmMIEGRCROKTodhTY9fdTnGU2lCZqAwNw==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
"@protobufjs/codegen" "^2.0.4"
"@protobufjs/eventemitter" "^1.1.0"
"@protobufjs/fetch" "^1.1.0"
"@protobufjs/float" "^1.0.2"
"@protobufjs/inquire" "^1.1.0"
"@protobufjs/path" "^1.1.2"
"@protobufjs/pool" "^1.1.0"
"@protobufjs/utf8" "^1.1.0"
"@types/long" "^4.0.1"
"@types/node" ">=13.7.0"
long "^4.0.0"

"@cosmwasm/ts-codegen@0.30.1":
version "0.30.1"
resolved "https://registry.npmmirror.com/@cosmwasm/ts-codegen/-/ts-codegen-0.30.1.tgz#8b8a635273065261c608a76f8a50cb5045e23980"
integrity sha512-6ATbmtuK2MwG9fJxIi0M+Rwd0SQhsko2nA8qVXC9MRHpZJKNaXYYcof1fel/L5HJCjotmQVsoxons3rGg6dRnw==
dependencies:
"@babel/core" "7.18.10"
"@babel/generator" "7.18.12"
Expand Down Expand Up @@ -1785,7 +1804,7 @@
parse-package-name "1.0.0"
rimraf "3.0.2"
shelljs "0.8.5"
wasm-ast-types "^0.19.0"
wasm-ast-types "^0.23.1"

"@eslint-community/eslint-utils@^4.2.0":
version "4.4.0"
Expand Down Expand Up @@ -3287,25 +3306,6 @@
mz "^2.7.0"
prettier "^2.6.2"

"@pyramation/protobufjs@6.11.5":
version "6.11.5"
resolved "https://registry.npmjs.org/@pyramation/protobufjs/-/protobufjs-6.11.5.tgz#c64904a7214f2d061de53eed166c882a369731c4"
integrity sha512-gr+Iv6d7Iwq3PmNsTeQtL6TUONJs0WqbHFikett4zLquRK7egWuifZSKsqV8+o1UBNZcv52Z1HhgwTqNJe75Ag==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
"@protobufjs/codegen" "^2.0.4"
"@protobufjs/eventemitter" "^1.1.0"
"@protobufjs/fetch" "^1.1.0"
"@protobufjs/float" "^1.0.2"
"@protobufjs/inquire" "^1.1.0"
"@protobufjs/path" "^1.1.2"
"@protobufjs/pool" "^1.1.0"
"@protobufjs/utf8" "^1.1.0"
"@types/long" "^4.0.1"
"@types/node" ">=13.7.0"
long "^4.0.0"

"@sinclair/typebox@^0.24.1":
version "0.24.51"
resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f"
Expand Down Expand Up @@ -9700,10 +9700,10 @@ walker@^1.0.8:
dependencies:
makeerror "1.0.12"

wasm-ast-types@^0.19.0:
version "0.19.0"
resolved "https://registry.npmjs.org/wasm-ast-types/-/wasm-ast-types-0.19.0.tgz#d3e71ae91d48ddbdc23560bad5e10660f3c0d0da"
integrity sha512-SELRqjXMi7U3pB0jslvP0IrafJS9iN/VvySriiBITptBstwuzglhDTj3KFRpb/8LI4mG2ewC4a0/HxSQewQ/3g==
wasm-ast-types@^0.23.1:
version "0.23.1"
resolved "https://registry.npmmirror.com/wasm-ast-types/-/wasm-ast-types-0.23.1.tgz#b849629aa9f7a56dbb52c581ddbcb6b5ed7e2a07"
integrity sha512-igLcEk8VHZq62ZEwn4Jp+WRTp2D9yvTeiQd2Pc+s7LZouzSn3CwRpD42sHK2wV0UlSt2/cNbV6QywFm9Z6eM/A==
dependencies:
"@babel/runtime" "^7.18.9"
"@babel/types" "7.18.10"
Expand Down

0 comments on commit a1c8090

Please sign in to comment.