Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
248 commits
Select commit Hold shift + click to select a range
e5b5b11
Removed unnecessary code and updated pojos for retrive shares and con…
grvgoel81 Jun 1, 2023
6d0c5a4
adding POJOS for retreive shares
grvgoel81 Jun 13, 2023
1f35528
modified pubKey changes
grvgoel81 Jun 14, 2023
401dce0
refactored getPublicKey function
grvgoel81 Jun 15, 2023
027c18f
refactored retriveShares function
grvgoel81 Jun 15, 2023
96926f3
refactored retriveShares function
grvgoel81 Jun 15, 2023
94200e7
refactored retriveShares function
grvgoel81 Jun 19, 2023
f5ea0ee
Added SapphireTest case for getPublicAddress function
grvgoel81 Jun 20, 2023
c3af4ac
changes in ShareRequestParams
grvgoel81 Jun 25, 2023
59c5fdc
changes added for KeyAssignResult
grvgoel81 Jun 26, 2023
0148da2
changes added for retrieveShares
grvgoel81 Jun 26, 2023
5872a79
changes added for KeyAssignment
grvgoel81 Jun 26, 2023
1b044d8
changes added for RetrieveSharesResponse,
grvgoel81 Jun 27, 2023
7e27116
testcase added for GetKeyAssign
grvgoel81 Jun 27, 2023
a5520c2
importShares params added in ImportShares request
grvgoel81 Jun 28, 2023
06df790
LEGACY_NETWORKS_ROUTE_MAP support added in getPublicAddress() and ret…
grvgoel81 Jun 30, 2023
eb58b21
Added SapphireTestcases for getPublicAddress and retrieveShare functions
grvgoel81 Jun 30, 2023
d1f610f
added legacyPublicAddress and keyAssign() function and improve testcases
grvgoel81 Jul 3, 2023
d0a28dc
testcases refactored for mainnet network
grvgoel81 Jul 3, 2023
0d9b92a
testcases refactored for TorusUtilsTest
grvgoel81 Jul 3, 2023
94a7275
code refactored
grvgoel81 Jul 3, 2023
df4c77b
code refactored
grvgoel81 Jul 3, 2023
7182ee9
retrieveShares() code refactored to support legacy network functions.
grvgoel81 Jul 3, 2023
f51c66c
Refractored onekeytest and MainnetTest
grvgoel81 Jul 4, 2023
3b904b3
code refactored
grvgoel81 Jul 4, 2023
a2c7024
Aqua, cyan and celeste test cases refactored
grvgoel81 Jul 4, 2023
a4acf09
MainnetTest cases refactored
grvgoel81 Jul 4, 2023
8b74e03
getUserTypeAndAddress function and test cases added
grvgoel81 Jul 4, 2023
5a30138
code refactoring
grvgoel81 Jul 4, 2023
8568e5b
Updated RetrieveSharesResponse and modified test cases.
grvgoel81 Jul 4, 2023
e6f1979
code refactored
grvgoel81 Jul 4, 2023
b649627
code refactored
grvgoel81 Jul 4, 2023
f76240d
code refactored
grvgoel81 Jul 4, 2023
ec579b3
test cases refactored
grvgoel81 Jul 4, 2023
90d75e7
test cases refactored
grvgoel81 Jul 5, 2023
eec5a78
code refactored
grvgoel81 Jul 6, 2023
7e5df16
added assertJ testing library and test cases added
grvgoel81 Jul 6, 2023
9b6ec69
testcases added
grvgoel81 Jul 7, 2023
33acc38
code refactored
grvgoel81 Jul 7, 2023
c204287
added code for importPrivateKey()
grvgoel81 Jul 7, 2023
971e2d6
added code for importPrivateKey()
grvgoel81 Jul 8, 2023
c391848
code refactored.
grvgoel81 Jul 8, 2023
9c67025
code refactored.
grvgoel81 Jul 10, 2023
6356b69
code refactored.
grvgoel81 Jul 11, 2023
1fae052
code refactored.
grvgoel81 Jul 11, 2023
cd9a379
code refactored.
grvgoel81 Jul 11, 2023
aa9e244
code refactored.
grvgoel81 Jul 11, 2023
4e6c6c7
code refactored.
grvgoel81 Jul 11, 2023
f817799
code refactored.
grvgoel81 Jul 11, 2023
f668ed9
code refactored.
grvgoel81 Jul 12, 2023
17ffb34
code refactored.
grvgoel81 Jul 13, 2023
7479b2f
Sapphire devnet and mainnet test cases resolved.
grvgoel81 Jul 13, 2023
11e0dba
Sapphire devnet and mainnet test cases resolved.
grvgoel81 Jul 14, 2023
7fae43b
Sapphire devnet and mainnet test cases resolved.
grvgoel81 Jul 14, 2023
e7eaa46
test cases refactored
grvgoel81 Jul 14, 2023
5aeaece
test cases refactored
grvgoel81 Jul 17, 2023
03ca3c7
test cases refactored
grvgoel81 Jul 17, 2023
5d3996c
test cases refactored
grvgoel81 Jul 17, 2023
cd6165d
test cases refactored
grvgoel81 Jul 19, 2023
7377286
test cases refactored
grvgoel81 Jul 19, 2023
cb4a042
test cases refactored
grvgoel81 Jul 19, 2023
a1f8a89
test cases refactored
grvgoel81 Jul 19, 2023
d20394d
sapphire-mainnet
grvgoel81 Jul 19, 2023
851cbd9
sapphire-devnet
grvgoel81 Jul 19, 2023
633274c
torus-utils
grvgoel81 Jul 19, 2023
06712ed
test cases refactored
grvgoel81 Jul 19, 2023
b3c85fc
test cases refactored
grvgoel81 Jul 21, 2023
eebdb5b
test cases refactored
grvgoel81 Jul 21, 2023
9e0abd0
test cases refactored
grvgoel81 Jul 24, 2023
0c72da1
refactored retrieveShares code.
grvgoel81 Aug 11, 2023
7ab5d74
refactored retrieveShares code.
grvgoel81 Aug 11, 2023
fac524d
refactored retrieveShares code.
grvgoel81 Aug 11, 2023
b28be25
refactored sessionToken code in retrieveShares function.
grvgoel81 Aug 15, 2023
5da3a49
refactored GetPubKeyOrKeyAssignRequestParams in getPublicAddress() fu…
grvgoel81 Aug 16, 2023
1ea9c55
refactor: remove importPrivateKey() function
grvgoel81 Aug 22, 2023
ed54498
refactor: fix tests
grvgoel81 Aug 22, 2023
4a7ef91
refactor: fix tests
grvgoel81 Aug 28, 2023
7759633
refactor: fix tests
grvgoel81 Aug 29, 2023
90c21ce
refactor: fix tests
grvgoel81 Sep 7, 2023
08a8134
refactor: fix tests
grvgoel81 Oct 24, 2023
e5b08f4
refactor: fix tests
grvgoel81 Oct 24, 2023
3f16a0e
refactor: fix tests
grvgoel81 Oct 30, 2023
84dd089
refactor: fix tests for aqua, cyan and mainnet network for email "hel…
grvgoel81 Nov 1, 2023
f992c98
refactor: bump torus-utils-java, add client-id and origin parameter a…
grvgoel81 Nov 1, 2023
b1c7d65
refactor: making client-id mandatory in TorusCtorOptions and updated …
grvgoel81 Nov 2, 2023
4d54c76
refactor: making client-id mandatory in TorusCtorOptions and updated …
grvgoel81 Dec 12, 2023
e8522d2
update TorusUtils.java
grvgoel81 Dec 12, 2023
4e597ec
update tests.
grvgoel81 Dec 15, 2023
1361f53
update build.gradle
grvgoel81 Dec 15, 2023
9b384d0
update fnd-java and build.gradle
grvgoel81 Dec 15, 2023
77ebae8
update fnd-java and build.gradle
grvgoel81 Dec 15, 2023
6f02ae2
updated fnd-java version and test cases with serverTimeOffset
grvgoel81 Apr 16, 2024
7ae6f60
updated fnd-java version and test cases with serverTimeOffset
grvgoel81 Apr 17, 2024
4fda2a2
mid commit
chaitanyapotti Apr 18, 2024
a08c813
update retrieveShares function
grvgoel81 Apr 18, 2024
297bf01
Update test cases and resolve OR comments
grvgoel81 Apr 18, 2024
f7f3687
Update test cases and resolve OR comments
grvgoel81 Apr 18, 2024
67a9f7e
mid commit
chaitanyapotti Apr 18, 2024
dfd1dbe
update retrieveShares function
grvgoel81 Apr 19, 2024
fdff602
update retrieveShares and unit-tests
grvgoel81 Apr 19, 2024
0543c8e
update test-cases
grvgoel81 Apr 19, 2024
fd20feb
update torus-utils
grvgoel81 Apr 19, 2024
5b82ef1
update retrieveShares function.
grvgoel81 Apr 25, 2024
bff4de6
feat: celeste migration
grvgoel81 May 6, 2024
f5c5d1f
feat: update fnd java version,unit-tests. Replace TorusNetwork with W…
grvgoel81 Jul 16, 2024
84014ca
feat: replace evmAddress with walletAddress everywhere.
grvgoel81 Jul 16, 2024
c1cf52d
feat: mid commit, Add KeyUtils, Lagrange and Replace ShareMetadata wi…
grvgoel81 Jul 19, 2024
53c0a20
feat: changes added in getPublicAddress() function
grvgoel81 Jul 22, 2024
dae6f62
feat: unit-tests updated and modified
grvgoel81 Jul 22, 2024
fbde93a
feat: update retrieveShares function
grvgoel81 Jul 23, 2024
c4579a1
Merge branch 'master' into adding-sapphire
grvgoel81 Jul 23, 2024
2bbee64
feat: resolve conflicts from master
grvgoel81 Jul 23, 2024
517befd
feat: resolve conflicts from master
grvgoel81 Jul 23, 2024
d78e20c
feat: remove unused code
grvgoel81 Jul 23, 2024
70acf70
feat: code refactored
grvgoel81 Jul 24, 2024
6cc6329
feat: code refactored
grvgoel81 Jul 24, 2024
c24fdf8
feat: mid commit
grvgoel81 Jul 25, 2024
75d3fae
feat: mid commit
grvgoel81 Jul 25, 2024
c8ba326
feat: mid commit for importPrivateKey
grvgoel81 Jul 29, 2024
a9ff688
feat: improve unit-tests and add helper functions for importPrivateKey
grvgoel81 Jul 31, 2024
8ef3ef7
feat: mid-commit
grvgoel81 Jul 31, 2024
92d9ae3
add some todos and a fix for commitment request concurrency
metalurgical Aug 5, 2024
c0fa372
add todo
metalurgical Aug 5, 2024
cd5025e
add comments to generate shares to explain how to get ecies results
metalurgical Aug 5, 2024
524848c
decryptHex function added
grvgoel81 Aug 5, 2024
b65192f
fix comment
metalurgical Aug 5, 2024
be4189f
fix threshold
metalurgical Aug 5, 2024
937dce1
update retrieveShares() function and unit-tests
grvgoel81 Aug 5, 2024
bbcb958
Merge remote-tracking branch 'origin/import_private_key' into import_…
grvgoel81 Aug 5, 2024
3b13a2d
add more comments
metalurgical Aug 5, 2024
62bac6f
Update AES256CBC.java
metalurgical Aug 5, 2024
3512d72
Update TorusUtils.java
metalurgical Aug 5, 2024
67b9569
added AES_256_CBC.java and update encrypt, decrypt function
grvgoel81 Aug 6, 2024
732e4de
code refactoring
grvgoel81 Aug 7, 2024
de9b46b
code refactoring
grvgoel81 Aug 8, 2024
21f57d3
fix ecdh, wip aes encrypt/decrypt
metalurgical Aug 8, 2024
be97660
fix: encryption
metalurgical Aug 10, 2024
4723f6a
cleanup
metalurgical Aug 10, 2024
228085c
cleanup
metalurgical Aug 10, 2024
99a0ce5
update
metalurgical Aug 10, 2024
bb39598
extend test
metalurgical Aug 10, 2024
549bec3
fix: decode node pubkey from hex
metalurgical Aug 10, 2024
c8fa5ab
cleanup and debugging
metalurgical Aug 10, 2024
bb5cf66
strip dead code
metalurgical Aug 10, 2024
faf09b4
update
metalurgical Aug 10, 2024
7a0cd53
fix: kcombinations
metalurgical Aug 11, 2024
e4740fa
Update Encryption.java
metalurgical Aug 12, 2024
d9114dd
wip: fix classes and interfaces
metalurgical Aug 12, 2024
2df203d
wip: fix functions
metalurgical Aug 12, 2024
b9883bc
update
metalurgical Aug 12, 2024
46b00f1
fix: getpublicaddress
metalurgical Aug 13, 2024
505620a
fix: servertimeoffset
metalurgical Aug 13, 2024
403f4b0
fix: sessiontime
metalurgical Aug 13, 2024
e15f60a
wip: retrieveorimportshare
metalurgical Aug 13, 2024
490eb45
cleanup
metalurgical Aug 13, 2024
9f54399
cleanup todos
metalurgical Aug 13, 2024
876feb5
Update ShareRequestResult.java
metalurgical Aug 13, 2024
792b304
cleanup types
metalurgical Aug 13, 2024
5b9d6f5
fix: fix tests
grvgoel81 Aug 13, 2024
ed57a46
fix: fix MetadataParams and unit-tests
grvgoel81 Aug 13, 2024
4b2bc23
cleanup formatLegacyPublicKeyData and GetOrSetNonce
metalurgical Aug 13, 2024
b1670ed
fix: wip
grvgoel81 Aug 13, 2024
cf0b585
fix: missing prefix
metalurgical Aug 13, 2024
1ae6c00
further class cleanup
metalurgical Aug 13, 2024
f796520
fix
metalurgical Aug 13, 2024
5f7e284
cleanup
metalurgical Aug 13, 2024
795e2a7
add well known private key to library
metalurgical Aug 13, 2024
94aeeea
cleanup
metalurgical Aug 13, 2024
41a80d3
fix: getPublicAdress paramaters
grvgoel81 Aug 13, 2024
48b33ab
Merge remote-tracking branch 'origin/import_private_key' into import_…
grvgoel81 Aug 13, 2024
758cb65
fix: wip
grvgoel81 Aug 13, 2024
80d4daa
cleanup
metalurgical Aug 13, 2024
3350429
Merge branch 'import_private_key' of https://github.com/torusresearch…
metalurgical Aug 13, 2024
b808abf
fix test
metalurgical Aug 13, 2024
6383a51
debugging
metalurgical Aug 13, 2024
424d579
fix test
metalurgical Aug 13, 2024
e13f120
further cleanup
metalurgical Aug 13, 2024
3e444c3
further cleanup
metalurgical Aug 13, 2024
fffff0e
cleanup
metalurgical Aug 13, 2024
cc07bc7
fix all getPublicAddress tests.
grvgoel81 Aug 14, 2024
985eb0e
update
metalurgical Aug 14, 2024
603fc21
cleanup
metalurgical Aug 14, 2024
49e7113
update
metalurgical Aug 14, 2024
324eac4
fix OneKeyTest
grvgoel81 Aug 14, 2024
4c7b731
fix test
grvgoel81 Aug 14, 2024
d31f2fc
update
metalurgical Aug 14, 2024
9553a02
debugging
metalurgical Aug 14, 2024
d003f25
add lagrange test
metalurgical Aug 14, 2024
c4dfd7b
debugging
metalurgical Aug 14, 2024
43b59f7
update
metalurgical Aug 14, 2024
71cc8ae
debugging
metalurgical Aug 14, 2024
1d8a8e8
debugging
metalurgical Aug 14, 2024
ba0214f
debugging
metalurgical Aug 14, 2024
78ce927
fix isUpgraded value
grvgoel81 Aug 15, 2024
0e02b72
cleanup many warnings
metalurgical Aug 15, 2024
e74a3ac
further warning cleanup
metalurgical Aug 15, 2024
2e8924c
Update JsonRPCResponse.java
metalurgical Aug 15, 2024
e5c0bd5
further cleanup of warnings
metalurgical Aug 15, 2024
e8496ea
further cleanup
metalurgical Aug 15, 2024
609bb34
cleanup
metalurgical Aug 15, 2024
f8a8691
cleanup
metalurgical Aug 15, 2024
bee4d43
cleanup
metalurgical Aug 15, 2024
9fc0b5b
cleanup
metalurgical Aug 15, 2024
302d990
cleanup
metalurgical Aug 15, 2024
2804901
cleanup
metalurgical Aug 15, 2024
6a043a9
cleanup
metalurgical Aug 15, 2024
2983152
cleanup
metalurgical Aug 15, 2024
28e21c5
fix annotation
metalurgical Aug 15, 2024
3c7b549
cleanup
metalurgical Aug 15, 2024
adcf304
fix aggragate login
metalurgical Aug 15, 2024
3dcc71b
fix shouldAggregateLogin() tests
grvgoel81 Aug 15, 2024
41c82d0
update
metalurgical Aug 15, 2024
8beb4ed
update sapphire aggregate test
metalurgical Aug 15, 2024
2ce692e
fix Sapphire-devnet shouldAggregateLogin()
grvgoel81 Aug 15, 2024
58deb91
update
metalurgical Aug 15, 2024
e628022
Merge branch 'import_private_key' of https://github.com/torusresearch…
metalurgical Aug 15, 2024
e8db0bc
cleanup
metalurgical Aug 15, 2024
864c1ec
fix
metalurgical Aug 15, 2024
5ce4fe2
update
metalurgical Aug 15, 2024
9ec653e
fix importPrivateKey
grvgoel81 Aug 15, 2024
8e081e3
Update Utils.java
metalurgical Aug 15, 2024
f6dfd18
fix unit-test
grvgoel81 Aug 15, 2024
a907a75
fix unit-test
grvgoel81 Aug 15, 2024
b5587f0
code reorganization
metalurgical Aug 15, 2024
0b15dee
Update OneKeyTest.java
metalurgical Aug 15, 2024
b590111
fix SapphireDevnetTest.java
grvgoel81 Aug 15, 2024
d9fdfa0
cleanup
metalurgical Aug 15, 2024
6921066
fix: token parsing in tests
metalurgical Aug 15, 2024
8834623
cleanup
metalurgical Aug 15, 2024
478b2e6
Celeste network test added.
grvgoel81 Aug 15, 2024
bda7e75
Merge remote-tracking branch 'origin/import_private_key' into import_…
grvgoel81 Aug 15, 2024
de46f34
update
metalurgical Aug 15, 2024
8cd30d2
update
metalurgical Aug 15, 2024
3416099
further improve test stability
metalurgical Aug 15, 2024
0192001
update: rename test configuration file
metalurgical Aug 15, 2024
aad3fab
cleanup
metalurgical Aug 15, 2024
a001418
cleanup
metalurgical Aug 15, 2024
ee62e69
cleanup and add unit-tests
grvgoel81 Aug 16, 2024
b016b37
add missing try...catch for CompletableFuture results
metalurgical Aug 16, 2024
27e38d3
cleanup warnings
metalurgical Aug 16, 2024
2993d5f
code cleanup
grvgoel81 Aug 16, 2024
4f11b80
Merge remote-tracking branch 'origin/import_private_key' into import_…
grvgoel81 Aug 16, 2024
44f8a41
code cleanup
grvgoel81 Aug 16, 2024
3f39cd6
useApiKey to true
metalurgical Aug 20, 2024
6ccea4a
review comments
metalurgical Aug 26, 2024
89a8d54
fix: upgrade json package
metalurgical Aug 27, 2024
90e3626
Delete key.pem
metalurgical Aug 27, 2024
0ba9ca2
Update .gitignore
metalurgical Aug 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ nb-configuration.xml
##############################
## OS X
##############################
.DS_Store
**/*.DS_Store

*.pem
##############################
## Misc
##############################
**/*.pem
25 changes: 25 additions & 0 deletions .run/AllTests.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":test" />
<option value="--tests" />
<option value="&quot;org.torusresearch.torusutilstest.*&quot;" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ Since Torus nodes operate on a threshold assumption, we need to ensure that API
This is to prevent malicious nodes from withholding shares, or deliberately slowing down the entire process.

This utility library allows for early exits in optimistic scenarios, while handling rejection of invalid inputs from nodes in malicious/offline scenarios.
The general approach is to evaluate predicates against a list of (potentially incomplete) results, and exit when the predicate passes.
The general approach is to evaluate a threshold number of results instead of a list of (potentially incomplete) results, and then exit once a threshold number of valid results have been evaluated.

README.md
## Features
- Handles up to threshold number of failures.
- Optimistic early exit (eg. 5/9 nodes return valid shares = complete)
- All API's return `CompletableFutures`
- Optimistic early exit (eg. threshold number of nodes return valid shares = complete)

## Getting Started

Expand All @@ -29,11 +28,11 @@ repositories {
maven { url "https://jitpack.io" }
}
dependencies {
implementation 'org.torusresearch:torus-utils-java:3.1.2'
implementation 'org.torusresearch:torus-utils-java:4.0.0'
}
```

## Requirements

- Android - API level 24
- Java 8 / 1.8
- Java 11
14 changes: 10 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
plugins {
id 'java-library'
id 'maven-publish'
id "org.gradle.test-retry" version "1.5.10"
}

group 'org.torusresearch'
version '3.2.2'
version '4.0.0'

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 11
targetCompatibility = 11

repositories {
mavenCentral()
Expand All @@ -19,14 +20,19 @@ dependencies {
implementation 'org.web3j:core:4.8.8-android'
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
implementation 'org.json:json:20240303'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
testImplementation 'org.slf4j:slf4j-simple:1.7.36'
testImplementation 'org.assertj:assertj-core:3.6.1'
testImplementation 'com.auth0:java-jwt:3.19.2'
testImplementation 'net.andreinc:mockneat:0.4.8'
}

test {
retry {
maxRetries = 3
}

useJUnitPlatform()
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading