Throw error when unknown typeUrl

This commit is contained in:
abefernan
2023-06-15 14:23:29 +02:00
parent b0c41ab538
commit 1c78950ac6
+2 -2
View File
@@ -39,7 +39,7 @@ export const exportMsgToJson = (msg: EncodeObject): EncodeObject => {
return { ...msg, value: MsgCodecs[msg.typeUrl].toJSON(msg.value) };
}
return msg;
throw new Error("Unknown msg type");
};
const importMsgFromJson = (msg: EncodeObject): EncodeObject => {
@@ -48,7 +48,7 @@ const importMsgFromJson = (msg: EncodeObject): EncodeObject => {
return { ...msg, value: parsedValue };
}
return msg;
throw new Error("Unknown msg type");
};
export const dbTxFromJson = (txJson: string): DbTransaction | null => {