diff --git a/build/comet38/adaptor/responses.js b/build/comet38/adaptor/responses.js index 29ec063eb897202ea10f381f10020ba567038a04..28a5c02ae003ebbed05dce8805c22d0d64739819 100644 --- a/build/comet38/adaptor/responses.js +++ b/build/comet38/adaptor/responses.js @@ -72,7 +72,7 @@ function decodePubkey(data) { if ("Sum" in data) { // we don't need to check type because we're checking algorithm const [[algorithm, value]] = Object.entries(data.Sum.value); - (0, utils_1.assert)(algorithm === "ed25519" || algorithm === "secp256k1", `unknown pubkey type: ${algorithm}`); + (0, utils_1.assert)(algorithm === "ed25519" || algorithm === "secp256k1" || algorithm === "bn254", `unknown pubkey type: ${algorithm}`); return { algorithm, data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(value)), @@ -91,6 +91,16 @@ function decodePubkey(data) { algorithm: "secp256k1", data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)), }; + case "tendermint/PubKeyBn254": + return { + algorithm: "bn254", + data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)), + }; + case "cometbft/PubKeyBn254": + return { + algorithm: "bn254", + data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)), + }; default: throw new Error(`unknown pubkey type: ${data.type}`); } diff --git a/build/tendermint37/adaptor/responses.js b/build/tendermint37/adaptor/responses.js index 19df9de6589102d5d47f3ec380b11ac0cd37fed4..c73c4caee417380d484f46fa786fe137dc841534 100644 --- a/build/tendermint37/adaptor/responses.js +++ b/build/tendermint37/adaptor/responses.js @@ -72,7 +72,7 @@ function decodePubkey(data) { if ("Sum" in data) { // we don't need to check type because we're checking algorithm const [[algorithm, value]] = Object.entries(data.Sum.value); - (0, utils_1.assert)(algorithm === "ed25519" || algorithm === "secp256k1", `unknown pubkey type: ${algorithm}`); + (0, utils_1.assert)(algorithm === "ed25519" || algorithm === "secp256k1" || algorithm === "bn254", `unknown pubkey type: ${algorithm}`); return { algorithm, data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(value)), @@ -91,6 +91,16 @@ function decodePubkey(data) { algorithm: "secp256k1", data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)), }; + case "tendermint/PubKeyBn254": + return { + algorithm: "bn254", + data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)), + }; + case "cometbft/PubKeyBn254": + return { + algorithm: "bn254", + data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)), + }; default: throw new Error(`unknown pubkey type: ${data.type}`); } diff --git a/build/tendermintclient.js b/build/tendermintclient.js index 257b104030c72bbf351e0806faeed98ebd1ebd5e..dbf2240c68313ebad5d0e3cdb7c434b4c81eed72 100644 --- a/build/tendermintclient.js +++ b/build/tendermintclient.js @@ -28,7 +28,7 @@ async function connectComet(endpoint) { if (version.startsWith("0.37.")) { out = tm37Client; } - else if (version.startsWith("0.38.")) { + else if (version.startsWith("0.38.") || version.startsWith("1.0.")) { tm37Client.disconnect(); out = await comet38_1.Comet38Client.connect(endpoint); }