Skip to content

Commit 2d15862

Browse files
authored
Merge pull request #16 from hyperweb-io/anmol/amino-execptions
feature: add amino exceptions to the hyperwebjs
2 parents fe97e9e + 306bf1e commit 2d15862

File tree

3 files changed

+62
-7
lines changed

3 files changed

+62
-7
lines changed

packages/hyperwebjs/scripts/codegen.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,26 @@ export const options: TelescopeInput = {
106106
useProtoOptionality: true,
107107
customTypes: {
108108
useCosmosSDKDec: true
109+
},
110+
exceptions: {
111+
'/hyperweb.hvm.MsgEval': {
112+
aminoType: 'hvm/x/hvm/MsgEval'
113+
},
114+
'/hyperweb.hvm.MsgEvalResponse': {
115+
aminoType: 'hvm/x/hvm/MsgEvalResponse'
116+
},
117+
'/hyperweb.hvm.MsgInstantiate': {
118+
aminoType: 'hvm/x/hvm/MsgInstantiate'
119+
},
120+
'/hyperweb.hvm.MsgInstantiateResponse': {
121+
aminoType: 'hvm/x/hvm/MsgInstantiateResponse'
122+
},
123+
'/hyperweb.hvm.MsgUpdateParams': {
124+
aminoType: 'hvm/x/hvm/MsgUpdateParams'
125+
},
126+
'/hyperweb.hvm.MsgUpdateParamsResponse': {
127+
aminoType: 'hvm/x/hvm/MsgUpdateParamsResponse'
128+
},
109129
}
110130
}
111131
}

packages/hyperwebjs/src/hyperweb/hvm/tx.amino.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ export const AminoConverter = {
77
fromAmino: MsgUpdateParams.fromAmino
88
},
99
"/hyperweb.hvm.MsgInstantiate": {
10-
aminoType: "/hyperweb.hvm.MsgInstantiate",
10+
aminoType: "hvm/x/hvm/MsgInstantiate",
1111
toAmino: MsgInstantiate.toAmino,
1212
fromAmino: MsgInstantiate.fromAmino
1313
},
1414
"/hyperweb.hvm.MsgEval": {
15-
aminoType: "/hyperweb.hvm.MsgEval",
15+
aminoType: "hvm/x/hvm/MsgEval",
1616
toAmino: MsgEval.toAmino,
1717
fromAmino: MsgEval.fromAmino
1818
}

packages/hyperwebjs/src/hyperweb/hvm/tx.ts

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export interface MsgUpdateParamsResponseProtoMsg {
5252
*/
5353
export interface MsgUpdateParamsResponseAmino {}
5454
export interface MsgUpdateParamsResponseAminoMsg {
55-
type: "/hyperweb.hvm.MsgUpdateParamsResponse";
55+
type: "hvm/x/hvm/MsgUpdateParamsResponse";
5656
value: MsgUpdateParamsResponseAmino;
5757
}
5858
/**
@@ -79,7 +79,7 @@ export interface MsgInstantiateAmino {
7979
source: string;
8080
}
8181
export interface MsgInstantiateAminoMsg {
82-
type: "/hyperweb.hvm.MsgInstantiate";
82+
type: "hvm/x/hvm/MsgInstantiate";
8383
value: MsgInstantiateAmino;
8484
}
8585
/** msg instantiate */
@@ -103,7 +103,7 @@ export interface MsgInstantiateResponseAmino {
103103
address: string;
104104
}
105105
export interface MsgInstantiateResponseAminoMsg {
106-
type: "/hyperweb.hvm.MsgInstantiateResponse";
106+
type: "hvm/x/hvm/MsgInstantiateResponse";
107107
value: MsgInstantiateResponseAmino;
108108
}
109109
/** msg instantiate response */
@@ -142,7 +142,7 @@ export interface MsgEvalAmino {
142142
args: string[];
143143
}
144144
export interface MsgEvalAminoMsg {
145-
type: "/hyperweb.hvm.MsgEval";
145+
type: "hvm/x/hvm/MsgEval";
146146
value: MsgEvalAmino;
147147
}
148148
/** msg eval response */
@@ -165,7 +165,7 @@ export interface MsgEvalResponseAmino {
165165
result: string;
166166
}
167167
export interface MsgEvalResponseAminoMsg {
168-
type: "/hyperweb.hvm.MsgEvalResponse";
168+
type: "hvm/x/hvm/MsgEvalResponse";
169169
value: MsgEvalResponseAmino;
170170
}
171171
/** msg eval response */
@@ -297,6 +297,7 @@ function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse {
297297
}
298298
export const MsgUpdateParamsResponse = {
299299
typeUrl: "/hyperweb.hvm.MsgUpdateParamsResponse",
300+
aminoType: "hvm/x/hvm/MsgUpdateParamsResponse",
300301
is(o: any): o is MsgUpdateParamsResponse {
301302
return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl;
302303
},
@@ -353,6 +354,12 @@ export const MsgUpdateParamsResponse = {
353354
fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse {
354355
return MsgUpdateParamsResponse.fromAmino(object.value);
355356
},
357+
toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg {
358+
return {
359+
type: "hvm/x/hvm/MsgUpdateParamsResponse",
360+
value: MsgUpdateParamsResponse.toAmino(message)
361+
};
362+
},
356363
fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse {
357364
return MsgUpdateParamsResponse.decode(message.value);
358365
},
@@ -376,6 +383,7 @@ function createBaseMsgInstantiate(): MsgInstantiate {
376383
}
377384
export const MsgInstantiate = {
378385
typeUrl: "/hyperweb.hvm.MsgInstantiate",
386+
aminoType: "hvm/x/hvm/MsgInstantiate",
379387
is(o: any): o is MsgInstantiate {
380388
return o && (o.$typeUrl === MsgInstantiate.typeUrl || typeof o.creator === "string" && typeof o.code === "string" && typeof o.source === "string");
381389
},
@@ -478,6 +486,12 @@ export const MsgInstantiate = {
478486
fromAminoMsg(object: MsgInstantiateAminoMsg): MsgInstantiate {
479487
return MsgInstantiate.fromAmino(object.value);
480488
},
489+
toAminoMsg(message: MsgInstantiate): MsgInstantiateAminoMsg {
490+
return {
491+
type: "hvm/x/hvm/MsgInstantiate",
492+
value: MsgInstantiate.toAmino(message)
493+
};
494+
},
481495
fromProtoMsg(message: MsgInstantiateProtoMsg): MsgInstantiate {
482496
return MsgInstantiate.decode(message.value);
483497
},
@@ -500,6 +514,7 @@ function createBaseMsgInstantiateResponse(): MsgInstantiateResponse {
500514
}
501515
export const MsgInstantiateResponse = {
502516
typeUrl: "/hyperweb.hvm.MsgInstantiateResponse",
517+
aminoType: "hvm/x/hvm/MsgInstantiateResponse",
503518
is(o: any): o is MsgInstantiateResponse {
504519
return o && (o.$typeUrl === MsgInstantiateResponse.typeUrl || typeof o.index === "bigint" && typeof o.address === "string");
505520
},
@@ -589,6 +604,12 @@ export const MsgInstantiateResponse = {
589604
fromAminoMsg(object: MsgInstantiateResponseAminoMsg): MsgInstantiateResponse {
590605
return MsgInstantiateResponse.fromAmino(object.value);
591606
},
607+
toAminoMsg(message: MsgInstantiateResponse): MsgInstantiateResponseAminoMsg {
608+
return {
609+
type: "hvm/x/hvm/MsgInstantiateResponse",
610+
value: MsgInstantiateResponse.toAmino(message)
611+
};
612+
},
592613
fromProtoMsg(message: MsgInstantiateResponseProtoMsg): MsgInstantiateResponse {
593614
return MsgInstantiateResponse.decode(message.value);
594615
},
@@ -613,6 +634,7 @@ function createBaseMsgEval(): MsgEval {
613634
}
614635
export const MsgEval = {
615636
typeUrl: "/hyperweb.hvm.MsgEval",
637+
aminoType: "hvm/x/hvm/MsgEval",
616638
is(o: any): o is MsgEval {
617639
return o && (o.$typeUrl === MsgEval.typeUrl || typeof o.creator === "string" && typeof o.address === "string" && typeof o.callee === "string" && Array.isArray(o.args) && (!o.args.length || typeof o.args[0] === "string"));
618640
},
@@ -740,6 +762,12 @@ export const MsgEval = {
740762
fromAminoMsg(object: MsgEvalAminoMsg): MsgEval {
741763
return MsgEval.fromAmino(object.value);
742764
},
765+
toAminoMsg(message: MsgEval): MsgEvalAminoMsg {
766+
return {
767+
type: "hvm/x/hvm/MsgEval",
768+
value: MsgEval.toAmino(message)
769+
};
770+
},
743771
fromProtoMsg(message: MsgEvalProtoMsg): MsgEval {
744772
return MsgEval.decode(message.value);
745773
},
@@ -761,6 +789,7 @@ function createBaseMsgEvalResponse(): MsgEvalResponse {
761789
}
762790
export const MsgEvalResponse = {
763791
typeUrl: "/hyperweb.hvm.MsgEvalResponse",
792+
aminoType: "hvm/x/hvm/MsgEvalResponse",
764793
is(o: any): o is MsgEvalResponse {
765794
return o && (o.$typeUrl === MsgEvalResponse.typeUrl || typeof o.result === "string");
766795
},
@@ -833,6 +862,12 @@ export const MsgEvalResponse = {
833862
fromAminoMsg(object: MsgEvalResponseAminoMsg): MsgEvalResponse {
834863
return MsgEvalResponse.fromAmino(object.value);
835864
},
865+
toAminoMsg(message: MsgEvalResponse): MsgEvalResponseAminoMsg {
866+
return {
867+
type: "hvm/x/hvm/MsgEvalResponse",
868+
value: MsgEvalResponse.toAmino(message)
869+
};
870+
},
836871
fromProtoMsg(message: MsgEvalResponseProtoMsg): MsgEvalResponse {
837872
return MsgEvalResponse.decode(message.value);
838873
},

0 commit comments

Comments
 (0)