From b75445a0e1fdc1a58233d4c8a526000011009a2d Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Mon, 10 Aug 2020 23:25:35 +0200 Subject: [PATCH] Test decodeBech32Pubkey with ed25519 --- packages/launchpad/src/pubkey.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/launchpad/src/pubkey.spec.ts b/packages/launchpad/src/pubkey.spec.ts index 4c34209e..f76cbe0f 100644 --- a/packages/launchpad/src/pubkey.spec.ts +++ b/packages/launchpad/src/pubkey.spec.ts @@ -39,6 +39,18 @@ describe("pubkey", () => { value: "A6lihrEs3PEFCu8m01ebcas3KjEVAjDIEmU7P9ED3PFx", }); }); + + it("works for ed25519", () => { + // Encoded from `corald tendermint show-validator` + // Decoded from http://localhost:26657/validators + const decoded = decodeBech32Pubkey( + "coralvalconspub1zcjduepqvxg72ccnl9r65fv0wn3amlk4sfzqfe2k36l073kjx2qyaf6sk23qw7j8wq", + ); + expect(decoded).toEqual({ + type: "tendermint/PubKeyEd25519", + value: "YZHlYxP5R6olj3Tj3f7VgkQE5VaOvv9G0jKATqdQsqI=", + }); + }); }); describe("encodeBech32Pubkey", () => {