Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Commit

Permalink
test: put test cases in ts instead of json (#361)
Browse files Browse the repository at this point in the history
* test: put testcases in ts instead of json

* test: remove unnecessary slicing
  • Loading branch information
Noel committed Aug 21, 2021
1 parent 4207ab7 commit 3f9fe40
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 8,068 deletions.
36 changes: 35 additions & 1 deletion packages/zilliqa-js-crypto/test/address.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,44 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.

import { addresses } from './address.fixtures';
import bech32Tests from './bech32.fixtures.json';
import { checksummedStore } from './checksum.fixtures';
import * as crypto from '../src/index';

const bech32Tests = [
{
b16: '1d19918a737306218b5cbb3241fcdcbd998c3a72',
b32: 'zil1r5verznnwvrzrz6uhveyrlxuhkvccwnju4aehf',
},
{
b16: 'cc8ee24773e1b4b28b3cc5596bb9cfc430b48453',
b32: 'zil1ej8wy3mnux6t9zeuc4vkhww0csctfpznzt4s76',
},
{
b16: 'e14576944443e9aeca6f12b454941884aa122938',
b32: 'zil1u9zhd9zyg056ajn0z269f9qcsj4py2fc89ru3d',
},
{
b16: '179361114cbfd53be4d3451edf8148cde4cfe774',
b32: 'zil1z7fkzy2vhl2nhexng50dlq2gehjvlem5w7kx8z',
},
{
b16: '5a2b667fdeb6356597681d08f6cd6636aed94784',
b32: 'zil1tg4kvl77kc6kt9mgr5y0dntxx6hdj3uy95ash8',
},
{
b16: '537342e5e0a6b402f281e2b4301b89123ae31117',
b32: 'zil12de59e0q566q9u5pu26rqxufzgawxyghq0vdk9',
},
{
b16: '5e61d42a952d2df1f4e5cbed7f7d1294e9744a52',
b32: 'zil1tesag25495klra89e0kh7lgjjn5hgjjj0qmu8l',
},
{
b16: '5f5db1c18ccde67e513b7f7ae820e569154976ba',
b32: 'zil1tawmrsvvehn8u5fm0aawsg89dy25ja46ndsrhq',
},
];

describe('addresses', () => {
it('should produce the same results as the C++ keygen crypto', () => {
addresses.forEach(({ public: pub, private: priv, address }) => {
Expand Down
25 changes: 0 additions & 25 deletions packages/zilliqa-js-crypto/test/b58.fixtures.json

This file was deleted.

34 changes: 0 additions & 34 deletions packages/zilliqa-js-crypto/test/bech32.fixtures.json

This file was deleted.

0 comments on commit 3f9fe40

Please sign in to comment.