Skip to content

Commit

Permalink
updated bip39 library, updated secp256k1 - fixed NPE after signing, t…
Browse files Browse the repository at this point in the history
…est for leading zero address
  • Loading branch information
edwardstock committed Jun 21, 2019
1 parent 3427769 commit f58d191
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ project build.gradle
```groovy
ext {
minterSdkVersion = "0.3.2"
minterSdkVersion = "0.4.0"
}
dependencies {
Expand Down
4 changes: 4 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release notes

## 0.4.0
- Updated BIP39 library
- Updated secp256k1 library - fixed NPE after fail signing

## 0.3.2
- Fixed RLP encoding for raw bytes contains leading zeroes

Expand Down
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,16 @@ apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'

group = 'network.minter.android'
version = '0.3.2'
version = '0.4.0'

def libPath = ""
if(hasProperty("nativeLibPath")) {
libPath = getProperty("nativeLibPath")
}
println "Native lib path: ${libPath}"



android {
compileSdkVersion minterMaxSdk

Expand All @@ -111,6 +113,7 @@ android {

externalNativeBuild {
cmake {
arguments '-DWITH_BIP39_TEST=Off', '-DENABLE_GO=Off', '-DENABLE_JNI=On', '-DENABLE_CONAN_BUILD=Off'
cppFlags "-std=c++14"
}
}
Expand Down Expand Up @@ -202,6 +205,7 @@ android {
externalNativeBuild {
cmake {
path 'src/main/cpp/CMakeLists.txt'
version '3.10.2'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/cpp/bip39
Submodule bip39 updated from d33c51 to d3c633
21 changes: 19 additions & 2 deletions src/test/java/network/minter/core/MinterAddressTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
import network.minter.core.crypto.MinterAddress;
import network.minter.core.crypto.MinterPublicKey;
import network.minter.core.crypto.UnsignedBytesData;
import network.minter.core.internal.helpers.BytesHelper;
import network.minter.core.internal.helpers.StringHelper;
import network.minter.core.util.DecodeResult;
import network.minter.core.util.RLPBoxed;

Expand Down Expand Up @@ -78,6 +76,25 @@ public void testFirstZeroBytesAddressRLP() {

}

@Test
public void testFirstZeroBytesAddressArrayRLP() {
MinterAddress[] addresses = new MinterAddress[]{
new MinterAddress("Mx00aacae635ad329dc2a3f0509f947065703efc79"),
new MinterAddress("Mx00aacae635ad329dc2a3f0509f947065703efc79"),
};

char[] enc = RLPBoxed.encode(new Object[]{addresses});
DecodeResult res = RLPBoxed.decode(enc, 0);
Object[] dec = (Object[]) res.getDecoded();
Object[] dec0 = (Object[]) dec[0];
char[] add1 = (char[]) dec0[0];
char[] add2 = (char[]) dec0[1];

assertEquals(20, add1.length);
assertEquals(20, add2.length);

}

@Test
public void testFirstZeroBytesPubKeyRLP() {
MinterPublicKey pk = new MinterPublicKey("Mp009b5528f09d1c74a83d18414f2e4263e14850c47a3fac3f855f200111111111");
Expand Down

0 comments on commit f58d191

Please sign in to comment.