Skip to content

Commit

Permalink
Adjusting unit tests and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jleni committed Jun 1, 2019
1 parent a6c73d2 commit cdc02b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# ledger-cosmos-js

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![npm version](https://badge.fury.io/js/ledger-cosmos-js.svg)](https://badge.fury.io/js/ledger-cosmos-js)
[![CircleCI](https://circleci.com/gh/ZondaX/cosmos-delegation-js/tree/master.svg?style=shield)](https://circleci.com/gh/ZondaX/cosmos-delegation-js/tree/master)

This package provides a basic client library to communicate with a Tendermint/Cosmos App running in a Ledger Nano S/X

Expand Down
13 changes: 2 additions & 11 deletions tests/basic.ispec.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,8 @@ test('sign_big_tx', async () => {

expect(response_pk.return_code).toEqual(0x9000);
expect(response_pk.error_message).toEqual('No errors');
expect(response_sign.return_code).toEqual(0x9000);
expect(response_sign.error_message).toEqual('No errors');

// Check signature is valid
const hash = crypto.createHash('sha256');
let msg_hash = hash.update(message).digest();

let signature_der = response_sign.signature;
let signature = secp256k1.signatureImport(signature_der);
let signature_ok = secp256k1.verify(msg_hash, signature, response_pk.compressed_pk);
expect(signature_ok).toEqual(true);
expect(response_sign.return_code).toEqual(0x6A80);
expect(response_sign.error_message).toEqual('NOMEM: JSON string contains too many tokens');
});


Expand Down

0 comments on commit cdc02b7

Please sign in to comment.