Skip to content

Commit 5ab6e98

Browse files
authored
Merge pull request #1206 from WalletConnect/develop
2 parents b1b3742 + 1b9339a commit 5ab6e98

File tree

280 files changed

+6546
-2253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

280 files changed

+6546
-2253
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @WalletConnect/kotlin-team @kacperoak @Elyniss @jakubuid @TalhaAli00

.github/workflows/ci_assemble.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
env:
4545
WC_CLOUD_PROJECT_ID: ${{ secrets.WC_CLOUD_PROJECT_ID }}
4646
# See if we can build out the list of sample project instead of manually adding them here
47-
run: ./gradlew assembleDebug -x :sample:wallet:assembleDebug -x :sample:dapp:assembleDebug -x :sample:common:assembleDebug -x :sample:modals:assembleDebug
47+
run: ./gradlew assembleDebug -x :sample:wallet:assembleDebug -x :sample:dapp:assembleDebug -x :sample:common:assembleDebug -x :sample:modal:assembleDebug
4848

4949
- name: Stop Gradle
5050
run: ./gradlew --stop

.github/workflows/ci_release_sample.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ jobs:
99
matrix:
1010
conf: [
1111
{ name: wallet, command: ":sample:wallet:assembleRelease :sample:wallet:appDistributionUploadRelease" },
12-
{ name: dapp, command: ":sample:dapp:assembleRelease :sample:dapp:appDistributionUploadRelease" }
12+
{ name: dapp, command: ":sample:dapp:assembleRelease :sample:dapp:appDistributionUploadRelease" },
13+
{ name: modal, command: ":sample:modal:assembleRelease :sample:modal:appDistributionUploadRelease" }
1314
]
1415
name: ${{ matrix.conf.name }}
1516
runs-on: ubuntu-latest

ReadMe.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ WalletConnect v2 protocols for Android applications.
1010

1111
| BOM | [Core SDK](core/android) | [Sign SDK](protocol/sign) | [Auth SDK](protocol/auth) | [Chat SDK](protocol/chat) | [Notify SDK](protocol/notify) | [web3wallet](product/web3wallet) | [web3modal](product/web3modal) | [WalletConnectModal](product/walletconnectmodal) |
1212
|-----------------------------------------------------------------------------------------|--------------------------|---------------------------|---------------------------|---------------------------|:------------------------------|----------------------------------|--------------------------------|--------------------------------------------------|
13+
| 1.18.0 | 1.23.0 | 2.21.0 | 1.21.0 | 1.0.0.beta20 | 1.0.0-beta01 | 1.16.0 | 1.0.0-alpha11 | 1.0.0-alpha07 |
1314
| 1.17.2 | 1.22.1 | 2.20.1 | 1.20.1 | 1.0.0.beta19 | 1.0.0-alpha05 | 1.15.1 | 1.0.0-alpha10 | 1.0.0-alpha06 |
1415
| 1.17.1 | 1.22.0 | 2.20.0 | 1.20.0 | 1.0.0.beta18 | 1.0.0-alpha04 | 1.15.0 | 1.0.0-alpha09 | 1.0.0-alpha05 |
1516
| 1.17.0 | 1.22.0 | 2.20.0 | 1.20.0 | 1.0.0.beta18 | 1.0.0-alpha03 | 1.15.0 | 1.0.0-alpha09 | 1.0.0-alpha05 |

buildSrc/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ repositories {
99
gradlePluginPortal()
1010
}
1111

12-
kotlin.jvmToolchain(11)
13-
1412
dependencies {
1513
implementation("com.android.tools.build:gradle:8.0.2") // when changing, remember to change version in Versions.kt in buildSrc module
1614
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21") // when changing, remember to change version in Versions.kt in buildSrc module

buildSrc/src/main/kotlin/Versions.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ const val KEY_PUBLISH_ARTIFACT_ID = "PUBLISH_ARTIFACT_ID"
55
const val KEY_SDK_NAME = "SDK_NAME"
66

77
//Latest versions
8-
const val BOM_VERSION = "1.17.2"
8+
const val BOM_VERSION = "1.18.0"
99
const val FOUNDATION_VERSION = "1.12.0"
10-
const val CORE_VERSION = "1.22.1"
11-
const val SIGN_VERSION = "2.20.1"
12-
const val AUTH_VERSION = "1.20.1"
13-
const val CHAT_VERSION = "1.0.0-beta19"
14-
const val NOTIFY_VERSION = "1.0.0-alpha05"
15-
const val WEB_3_WALLET = "1.15.1"
16-
const val WEB_3_MODAL = "1.0.0-alpha10"
17-
const val WC_MODAL_VERSION = "1.0.0-alpha06"
18-
const val MODAL_CORE_VERSION = "1.0.0-alpha05"
10+
const val CORE_VERSION = "1.23.0"
11+
const val SIGN_VERSION = "2.21.0"
12+
const val AUTH_VERSION = "1.21.0"
13+
const val CHAT_VERSION = "1.0.0-beta20"
14+
const val NOTIFY_VERSION = "1.0.0-beta01"
15+
const val WEB_3_WALLET = "1.16.0"
16+
const val WEB_3_MODAL = "1.0.0-alpha11"
17+
const val WC_MODAL_VERSION = "1.0.0-alpha07"
18+
const val MODAL_CORE_VERSION = "1.0.0-alpha06"
1919

2020
val jvmVersion = JavaVersion.VERSION_11
2121
const val MIN_SDK: Int = 23
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
import com.android.build.gradle.BaseExtension
2+
3+
plugins {
4+
jacoco
5+
}
6+
7+
private val fileFilter = mutableSetOf(
8+
"**/R.class",
9+
"**/R\$*.class",
10+
"**/*\$1*", // Jacoco can not handle several "$" in class name.
11+
"**/BuildConfig.*",
12+
"**/Manifest*.*",
13+
"**/*Test*.*",
14+
"android/**/*.*",
15+
"**/models/**",
16+
"**/*\$Lambda$*.*", // Jacoco can not handle several "$" in class name.
17+
"**/*\$inlined$*.*" // Kotlin specific, Jacoco can not handle several "$" in class name.
18+
)
19+
20+
21+
val javaTree = fileTree("dir" to "${project.buildDir}/intermediates/javac/debug/classes", "excludes" to fileFilter)
22+
val kotlinTree = fileTree("dir" to "${project.buildDir}/tmp/kotlin-classes/debug", "excludes" to fileFilter)
23+
private val classDirectoriesTree = fileTree("${project.buildDir}") {
24+
include(
25+
"**/classes/**/main/**",
26+
"**/intermediates/classes/debug/**",
27+
"**/intermediates/javac/debug/classes/**", // Android Gradle Plugin 3.2.x support.
28+
"**/tmp/kotlin-classes/debug/**"
29+
)
30+
exclude(fileFilter)
31+
}
32+
33+
private val sourceDirectoriesTree = fileTree("${project.projectDir}") {
34+
include(
35+
"src/main/java/**",
36+
"src/main/kotlin/**",
37+
"src/debug/kotlin/**",
38+
"src/release/kotlin/**",
39+
)
40+
}
41+
42+
private val executionDataTree = fileTree(project.buildDir) {
43+
include(
44+
"outputs/code_coverage/**/*.ec",
45+
"jacoco/jacocoTestReportDebug.exec",
46+
"jacoco/testDebugUnitTest.exec",
47+
"jacoco/test.exec"
48+
)
49+
}
50+
51+
fun JacocoReportsContainer.reports() {
52+
xml.required.set(false)
53+
html.required.set(true)
54+
html.outputLocation.set(file("${buildDir}/reports/jacoco/html"))
55+
}
56+
57+
fun JacocoCoverageVerification.setDirectories() {
58+
sourceDirectories.setFrom(sourceDirectoriesTree)
59+
classDirectories.setFrom(classDirectoriesTree)
60+
executionData.setFrom(executionDataTree)
61+
}
62+
63+
fun JacocoReport.setDirectories() {
64+
sourceDirectories.setFrom(sourceDirectoriesTree)
65+
classDirectories.setFrom(classDirectoriesTree)
66+
executionData.setFrom(executionDataTree)
67+
}
68+
69+
tasks {
70+
register<JacocoReport>("jacocoAndroidTestReport") {
71+
group = "Verification"
72+
description = "Code coverage report for both Android and Unit tests."
73+
dependsOn("testDebugUnitTest"/*, "createDebugUnitTestCoverageReport"*/)
74+
reports {
75+
reports()
76+
}
77+
setDirectories()
78+
}
79+
80+
register<JacocoCoverageVerification>("jacocoAndroidCoverageVerification") {
81+
group = "Verification"
82+
description = "Code coverage verification for Android both Android and Unit tests."
83+
dependsOn("testDebugUnitTest", "jacocoAndroidTestReport"/*, "createDebugUnitTestCoverageReport"*/)
84+
violationRules {
85+
rule {
86+
element = "CLASS"
87+
excludes = listOf(
88+
"**.FactorFacade.Builder",
89+
"**.ServiceFacade.Builder",
90+
"**.ChallengeFacade.Builder",
91+
"**.Task"
92+
)
93+
limit {
94+
minimum = "0.0".toBigDecimal()
95+
}
96+
}
97+
}
98+
setDirectories()
99+
}
100+
}
101+
102+
(project as? ExtensionAware)?.extensions?.configure<BaseExtension>("android") {
103+
buildTypes.forEach { builtType ->
104+
builtType.enableUnitTestCoverage = false
105+
}
106+
}
107+
108+
afterEvaluate {
109+
project.tasks.getByName("testDebugUnitTest").finalizedBy("jacocoAndroidTestReport", "jacocoAndroidCoverageVerification")
110+
}

core/android/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
id("com.android.library")
33
kotlin("android")
44
id("publish-module-android")
5+
id("jacoco-report")
56
id("com.squareup.sqldelight")
67
id("com.google.devtools.ksp") version kspVersion
78
}
Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
CREATE TABLE Identities (
22
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
3-
identity TEXT NOT NULL,
4-
accountId TEXT NOT NULL
3+
identity TEXT UNIQUE NOT NULL,
4+
accountId TEXT NOT NULL,
5+
cacao_payload TEXT DEFAULT NULL,
6+
is_owner INTEGER AS Boolean DEFAULT 0
57
);
68

79
insertOrAbortIdentity:
8-
INSERT OR ABORT INTO Identities(identity, accountId)
9-
VALUES (?, ?);
10+
INSERT OR ABORT INTO Identities(identity, accountId, cacao_payload, is_owner)
11+
VALUES (?, ?, ?, ?);
12+
13+
removeIdentity:
14+
DELETE FROM Identities
15+
WHERE identity = ?;
1016

1117
getAccountIdByIdentity:
1218
SELECT accountId
1319
FROM Identities
14-
WHERE identity = ?;
20+
WHERE identity = ?;
21+
22+
getCacaoPayloadByIdentity:
23+
SELECT cacao_payload
24+
FROM Identities
25+
WHERE identity = ? AND is_owner = 1;
44 KB
Binary file not shown.

0 commit comments

Comments
 (0)