From 76f8162a1c68ce24bcd266d6c1497954303d6964 Mon Sep 17 00:00:00 2001 From: Romantsov Date: Wed, 24 Feb 2016 13:00:34 +0200 Subject: [PATCH 1/2] Bip39TrezorTest fix. --- .../test/java/com/bitsofproof/supernode/api/BIP39Test.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/test/java/com/bitsofproof/supernode/api/BIP39Test.java b/api/src/test/java/com/bitsofproof/supernode/api/BIP39Test.java index 2c5b255a..0ada8e43 100644 --- a/api/src/test/java/com/bitsofproof/supernode/api/BIP39Test.java +++ b/api/src/test/java/com/bitsofproof/supernode/api/BIP39Test.java @@ -64,11 +64,11 @@ public void bip39TrezorTest () throws IOException, JSONException, ValidationExce { JSONObject testData = readObject (TESTS); JSONArray english = testData.getJSONArray ("english"); - for ( int i = 0; i < testData.length (); ++i ) + for ( int i = 0; i < english.length (); ++i ) { JSONArray test = english.getJSONArray (i); - String m = BIP39.getMnemonic (ByteUtils.fromHex (test.getString (i))); - assertTrue (m.equals (test.getString (i + 1))); + String m = BIP39.getMnemonic(ByteUtils.fromHex(test.getString(0))); + assertTrue (m.equals (test.getString (1))); } } From 2169badbe5db8ae7c0b4714b3ecec66f999f3b95 Mon Sep 17 00:00:00 2001 From: Romantsov Date: Wed, 24 Feb 2016 13:13:22 +0200 Subject: [PATCH 2/2] bip39EncodeDecodeTest fix. --- api/src/test/java/com/bitsofproof/supernode/api/BIP39Test.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/test/java/com/bitsofproof/supernode/api/BIP39Test.java b/api/src/test/java/com/bitsofproof/supernode/api/BIP39Test.java index 0ada8e43..b86125c0 100644 --- a/api/src/test/java/com/bitsofproof/supernode/api/BIP39Test.java +++ b/api/src/test/java/com/bitsofproof/supernode/api/BIP39Test.java @@ -77,7 +77,7 @@ public void bip39EncodeDecodeTest () throws IOException, JSONException, Validati { JSONObject testData = readObject (TESTS); JSONArray english = testData.getJSONArray ("english"); - for ( int i = 0; i < testData.length (); ++i ) + for ( int i = 0; i < english.length (); ++i ) { JSONArray test = english.getJSONArray (i); byte[] m = BIP39.decode (test.getString (1), "BOP");