message: Organize cosmWasmCodec test code
diff: @@ -28,23 +28,26 @@ describe("cosmWasmCodec", () => {
  });
  });
  - it("properly generates bytes to sign", () => {
  + describe("bytesToSign", () => {
  + it("works for SendTransaction via bank module", () => {
  const expected = {
  bytes: toUtf8(
  '{"account_number":"0","chain_id":"cosmoshub-3","fee":{"amount":[{"amount":"2500","denom":"uatom"}],"gas":"100000"},"memo":"","msgs":[{"type":"cosmos-sdk/MsgSend","value":{"amount":[{"amount":"35997500","denom":"uatom"}],"from_address":"cosmos1txqfn5jmcts0x0q7krdxj8tgf98tj0965vqlmq","to_address":"cosmos1nynns8ex9fq6sjjfj8k79ymkdz4sqth06xexae"}}],"sequence":"99"}',
  ),
  prehashType: PrehashType.Sha256,
  };
  - const bytesToSign = cosmWasmCodec.bytesToSign(sendTxJson, nonce);
  -
  - expect(bytesToSign).toEqual(expected);
  + expect(cosmWasmCodec.bytesToSign(sendTxJson, nonce)).toEqual(expected);
  + });
  });
  - it("properly encodes transactions", () => {
  + describe("bytesToPost", () => {
  + it("works for SendTransaction via bank module", () => {
  const encoded = cosmWasmCodec.bytesToPost(signedTxJson);
  expect(encoded).toEqual(signedTxEncodedJson);
  });
  + });
  + describe("parseBytes", () => {
  it("throws when trying to decode a transaction without a nonce", () => {
  expect(() => cosmWasmCodec.parseBytes(signedTxBin as PostableBytes, chainId)).toThrowError(
  /nonce is required/i,
  @@ -62,3 +65,4 @@ describe("cosmWasmCodec", () => {
  expect(decoded).toEqual(signedTxJson);
  });
  });
  +});
  