Skip to content

Commit

Permalink
[Android] Update sdk and warnings fixes (#1208)
Browse files Browse the repository at this point in the history
* Update sdk and fix android warnings

* Fix cardano address test

* update espresso to 3.3.0
  • Loading branch information
hewigovens committed Dec 8, 2020
1 parent 57cb656 commit 61091e0
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28
compileSdkVersion 30
ndkVersion '21.2.6472646'
defaultConfig {
applicationId "com.trustwallet.core.app"
minSdkVersion 23
targetSdkVersion 28
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -35,7 +35,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'

// Tests
androidTestImplementation("androidx.test.espresso:espresso-core:3.1.0-beta02", {
androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', {
testImplementation 'junit:junit:4.13.1'
exclude group: "com.android.support", module: "support-annotations"
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.trustwallet.core.app.blockchains.aeternity
import com.google.protobuf.ByteString
import com.trustwallet.core.app.utils.toHexByteArray
import com.trustwallet.core.app.utils.toHexBytesInByteString
import junit.framework.Assert.assertEquals
import org.junit.Assert.assertEquals
import org.junit.Test
import wallet.core.java.AnySigner
import wallet.core.jni.CoinType.AETERNITY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ class TestCardanoAddress {
val key = PrivateKey("b0884d248cb301edd1b34cf626ba6d880bb3ae8fd91b4696446999dc4f0b5744309941d56938e943980d11643c535e046653ca6f498c014b88f2ad9fd6e71effbf36a8fa9f5e11eb7a852c41e185e3969d518e66e6893c81d3fc7227009952d4".toHexByteArray())
val pubkey = key.publicKeyEd25519Extended
val address = AnyAddress(pubkey, CoinType.CARDANO)
val expected = AnyAddress("addr1snpa4z7ntyfszv7ckquprdw75w4qjqh0qmya9jtkpxxlzxghlqyvv7l0yjamh8fxraw06p3ua8sj2g2gv98v4849s43t9g2999kquuu5egnprk", CoinType.CARDANO)
val expected = AnyAddress("addr1s3tl64970vuthz2j0qkz7kd2ya5j3fxuhdnv333vu38e6c37e4dq80ek4raf7hs3adag2tzpuxz7895a2x8xde5f8jqa8lrjyuqfj5k50pm668", CoinType.CARDANO)

assertEquals(pubkey.data().toHex(), "0x57fd54be7b38bb8952782c2f59aa276928a4dcbb66c8c62ce44f9d623ecd5a03bf36a8fa9f5e11eb7a852c41e185e3969d518e66e6893c81d3fc7227009952d4")
assertEquals(address.description(), expected.description())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package com.trustwallet.core.app.blockchains.elrond

import com.google.protobuf.ByteString
import com.trustwallet.core.app.utils.toHexByteArray
import junit.framework.Assert.assertEquals
import org.junit.Assert.assertEquals
import org.junit.Test
import wallet.core.java.AnySigner
import wallet.core.jni.CoinType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.trustwallet.core.app.blockchains.filecoin
import com.google.protobuf.ByteString
import com.trustwallet.core.app.utils.toHexByteArray
import com.trustwallet.core.app.utils.toHexBytesInByteString
import junit.framework.Assert.assertEquals
import org.junit.Assert.assertEquals
import org.junit.Test
import wallet.core.java.AnySigner
import wallet.core.jni.AnyAddress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package com.trustwallet.core.app.blockchains.polkadot

import com.trustwallet.core.app.utils.Numeric
import com.trustwallet.core.app.utils.toHexBytesInByteString
import junit.framework.Assert.assertEquals
import org.junit.Assert.assertEquals
import org.junit.Test
import wallet.core.java.AnySigner
import wallet.core.jni.CoinType.KUSAMA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.junit.Test
import wallet.core.java.AnySigner
import wallet.core.jni.proto.NEO
import com.trustwallet.core.app.utils.toHexBytesInByteString
import junit.framework.Assert.assertEquals
import org.junit.Assert.assertEquals
import wallet.core.jni.CoinType

class TestNEOSigner {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.trustwallet.core.app.blockchains.nuls
import com.google.protobuf.ByteString
import com.trustwallet.core.app.utils.Numeric
import com.trustwallet.core.app.utils.toHexByteArray
import junit.framework.Assert.assertEquals
import org.junit.Assert.assertEquals
import org.junit.Test
import wallet.core.jni.CoinType
import wallet.core.java.AnySigner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package com.trustwallet.core.app.blockchains.polkadot

import com.trustwallet.core.app.utils.Numeric
import com.trustwallet.core.app.utils.toHexBytesInByteString
import junit.framework.Assert.assertEquals
import org.junit.Assert.assertEquals
import org.junit.Test
import wallet.core.java.AnySigner
import wallet.core.jni.CoinType.POLKADOT
Expand Down
2 changes: 1 addition & 1 deletion codegen/lib/templates/newcoin/SignerTests.kt.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.trustwallet.core.app.utils.Numeric
import com.trustwallet.core.app.utils.toHexByteArray
import com.trustwallet.core.app.utils.toHexBytes
import com.trustwallet.core.app.utils.toHexBytesInByteString
import junit.framework.Assert.assertEquals
import org.junit.Assert.assertEquals
import org.junit.Test
import wallet.core.jni.<%= format_name(coin) %>Signer
import wallet.core.jni.proto.<%= format_name(coin) %>
Expand Down

0 comments on commit 61091e0

Please sign in to comment.