Skip to content

Commit

Permalink
[Chore] Merge develop into sep-6 (#1157)
Browse files Browse the repository at this point in the history
### Description

This merges `develop` into `sep-6`. The RPC API and Custody service
changes make up the bulk of the commits.

### Context

Catch up `sep-6` branch to `develop`

### Testing

- `./gradlew test`

### Known limitations

N/A
  • Loading branch information
philipliu authored Oct 11, 2023
2 parents 90398f4 + e3df5d7 commit 8d5c17a
Show file tree
Hide file tree
Showing 391 changed files with 37,544 additions and 2,009 deletions.
17 changes: 7 additions & 10 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
<!-- If you're making a doc PR or something tiny where the below is irrelevant, delete this
template and use a short description, but in your description aim to include both what the
change is, and why it is being made, with enough context for anyone to understand. -->

### Description

<!-- Short statement about what is changing. -->
- TODO: describe what this change does

### Context

<!-- Why this change is being made. Include any context required to understand the why. -->
- TODO: describe why this change was made

### Testing
<!-- How was this change tested? -->
<!-- Default to `./gradlew test` but if there are other steps required to test, include them here. -->
`./gradlew test`

- `./gradlew test`
- TODO: replace with any additional test steps

### Known limitations

<!-- Any known limitations or edge cases. If no known limitations, put NA here.-->
TODO: describe any limitations or replace with N/A

7 changes: 6 additions & 1 deletion .github/workflows/sub_gradle_test_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
gradle_test_and_build:
name: Gradle Test and Build
runs-on: ubuntu-22.04
runs-on: ubuntu-latest-16-cores
# write to PR permission is required for jacocoTestReport Action to update comment
permissions:
contents: read
Expand All @@ -28,6 +28,7 @@ jobs:
sudo echo "127.0.0.1 reference-server" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 wallet-server" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 platform" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 custody-server" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 host.docker.internal" | sudo tee -a /etc/hosts
- name: Build and run the stack with docker compose
Expand Down Expand Up @@ -128,6 +129,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Gradle properties
run: |
echo "kotlin.daemon.jvmargs=-Xmx2g" >> gradle.properties
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .run/Run - All Servers - no Docker.run.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run - All Servers - no Docker" type="JetRunConfigurationType">
<envs>
<env name="sep24.enableTest" value="true" />
<env name="app.enableTest" value="true" />
</envs>
<option name="MAIN_CLASS_NAME" value="org.stellar.anchor.platform.run_profiles.RunAllServers" />
<module name="java-stellar-anchor-sdk.service-runner.main" />
Expand Down
10 changes: 10 additions & 0 deletions .run/Run - Custody Server - no Docker.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run - Custody Server - no Docker" type="JetRunConfigurationType">
<option name="MAIN_CLASS_NAME" value="org.stellar.anchor.platform.run_profiles.RunCustodyServer" />
<module name="java-stellar-anchor-sdk.service-runner.main" />
<shortenClasspath name="ARGS_FILE" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
2 changes: 1 addition & 1 deletion .run/Run - Kotlin Reference Server - no Docker.run.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run - Kotlin Reference Server - no Docker" type="JetRunConfigurationType">
<envs>
<env name="sep24.enableTest" value="true" />
<env name="app.enableTest" value="true" />
<env name="TEST_PROFILE_NAME" value="default" />
</envs>
<option name="MAIN_CLASS_NAME" value="org.stellar.anchor.platform.run_profiles.RunKotlinReferenceServer" />
Expand Down
34 changes: 34 additions & 0 deletions .run/Test - End2End with RPC Test - no fullstack.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test - End2End Test - no fullstack" type="JUnit" factoryName="JUnit">
<module name="java-stellar-anchor-sdk.integration-tests.test" />
<shortenClasspath name="ARGS_FILE" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.stellar.anchor.platform.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="false" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
</ENTRIES>
</extension>
<option name="PACKAGE_NAME" value="org.stellar.anchor.platform" />
<option name="MAIN_CLASS_NAME" value="org.stellar.anchor.platform.AnchorPlatformApiRpcEnd2EndTest" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<envs>
<env name="TEST_PROFILE_NAME" value="default-rpc" />
<env name="run_all_servers" value="false" />
<env name="run_docker" value="false" />
</envs>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
34 changes: 34 additions & 0 deletions .run/Test - End2End with RPC Test - with fullstack.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test - End2End Test - with fullstack" type="JUnit" factoryName="JUnit">
<module name="java-stellar-anchor-sdk.integration-tests.test" />
<shortenClasspath name="ARGS_FILE" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.stellar.anchor.platform.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="false" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
</ENTRIES>
</extension>
<option name="PACKAGE_NAME" value="org.stellar.anchor.platform" />
<option name="MAIN_CLASS_NAME" value="org.stellar.anchor.platform.AnchorPlatformApiRpcEnd2EndTest" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<envs>
<env name="TEST_PROFILE_NAME" value="default-rpc" />
<env name="run_all_servers" value="true" />
<env name="run_docker" value="true" />
</envs>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
38 changes: 38 additions & 0 deletions .run/Test - Fireblocks End2End Test - no fullstack.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test - Fireblocks End2End Test - no fullstack" type="JUnit" factoryName="JUnit">
<module name="java-stellar-anchor-sdk.integration-tests.test" />
<shortenClasspath name="ARGS_FILE" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.stellar.anchor.platform.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="false" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
</ENTRIES>
</extension>
<option name="PACKAGE_NAME" value="org.stellar.anchor.platform" />
<option name="MAIN_CLASS_NAME" value="org.stellar.anchor.platform.AnchorPlatformCustodyEnd2EndTest" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<envs>
<env name="TEST_PROFILE_NAME" value="default-custody" />
<env name="run_all_servers" value="false" />
<env name="run_docker" value="false" />
<env name="CUSTODY_TYPE" value="fireblocks" />
<env name="CUSTODY_FIREBLOCKS_VAULT_ACCOUNT_ID" value="stub" />
<env name="SECRET_CUSTODY_FIREBLOCKS_API_KEY" value="stub" />
<env name="SECRET_CUSTODY_FIREBLOCKS_SECRET_KEY" value="stub" />
</envs>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
38 changes: 38 additions & 0 deletions .run/Test - Fireblocks End2End Test - with fullstack.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test - Fireblocks End2End Test - with fullstack" type="JUnit" factoryName="JUnit">
<module name="java-stellar-anchor-sdk.integration-tests.test" />
<shortenClasspath name="ARGS_FILE" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.stellar.anchor.platform.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="false" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
</ENTRIES>
</extension>
<option name="PACKAGE_NAME" value="org.stellar.anchor.platform" />
<option name="MAIN_CLASS_NAME" value="org.stellar.anchor.platform.AnchorPlatformCustodyEnd2EndTest" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<envs>
<env name="TEST_PROFILE_NAME" value="default-custody" />
<env name="run_all_servers" value="true" />
<env name="run_docker" value="true" />
<env name="CUSTODY_TYPE" value="fireblocks" />
<env name="CUSTODY_FIREBLOCKS_VAULT_ACCOUNT_ID" value="stub" />
<env name="SECRET_CUSTODY_FIREBLOCKS_API_KEY" value="stub" />
<env name="SECRET_CUSTODY_FIREBLOCKS_SECRET_KEY" value="stub" />
</envs>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test - Fireblocks End2End Test - no fullstack" type="JUnit" factoryName="JUnit">
<module name="java-stellar-anchor-sdk.integration-tests.test" />
<shortenClasspath name="ARGS_FILE" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.stellar.anchor.platform.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="false" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
</ENTRIES>
</extension>
<option name="PACKAGE_NAME" value="org.stellar.anchor.platform" />
<option name="MAIN_CLASS_NAME" value="org.stellar.anchor.platform.AnchorPlatformCustodyApiRpcEnd2EndTest" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<envs>
<env name="TEST_PROFILE_NAME" value="default-custody-rpc" />
<env name="run_all_servers" value="false" />
<env name="run_docker" value="false" />
<env name="CUSTODY_TYPE" value="fireblocks" />
<env name="CUSTODY_FIREBLOCKS_VAULT_ACCOUNT_ID" value="stub" />
<env name="SECRET_CUSTODY_FIREBLOCKS_API_KEY" value="stub" />
<env name="SECRET_CUSTODY_FIREBLOCKS_SECRET_KEY" value="stub" />
</envs>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test - Fireblocks End2End Test - with fullstack" type="JUnit" factoryName="JUnit">
<module name="java-stellar-anchor-sdk.integration-tests.test" />
<shortenClasspath name="ARGS_FILE" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.stellar.anchor.platform.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="false" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
</ENTRIES>
</extension>
<option name="PACKAGE_NAME" value="org.stellar.anchor.platform" />
<option name="MAIN_CLASS_NAME" value="org.stellar.anchor.platform.AnchorPlatformCustodyApiRpcEnd2EndTest" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="class" />
<envs>
<env name="TEST_PROFILE_NAME" value="default-custody-rpc" />
<env name="run_all_servers" value="true" />
<env name="run_docker" value="true" />
<env name="CUSTODY_TYPE" value="fireblocks" />
<env name="CUSTODY_FIREBLOCKS_VAULT_ACCOUNT_ID" value="stub" />
<env name="SECRET_CUSTODY_FIREBLOCKS_API_KEY" value="stub" />
<env name="SECRET_CUSTODY_FIREBLOCKS_SECRET_KEY" value="stub" />
</envs>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
2 changes: 1 addition & 1 deletion anchor-reference-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {
implementation(libs.h2database)
implementation(libs.sqlite.jdbc)
implementation(libs.google.gson)
implementation(libs.java.stellar.sdk)
implementation(variantOf(libs.java.stellar.sdk) { classifier("uber") })
implementation(libs.okhttp3)

implementation(project(":api-schema"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public FilterRegistrationBean<Filter> platformToAnchorTokenFilter(
String authSecret = integrationAuthSettings.getPlatformToAnchorSecret();
switch (integrationAuthSettings.getAuthType()) {
case JWT:
JwtService jwtService = new JwtService(null, null, null, authSecret, null);
JwtService jwtService = new JwtService(null, null, null, authSecret, null, null);
platformToAnchorFilter = new CallbackAuthJwtFilter(jwtService);
break;

Expand All @@ -78,7 +78,7 @@ AuthHelper authHelper(IntegrationAuthSettings integrationAuthSettings) {
switch (integrationAuthSettings.getAuthType()) {
case JWT:
return AuthHelper.forJwtToken(
new JwtService(null, null, null, null, authSecret),
new JwtService(null, null, null, null, authSecret, null),
integrationAuthSettings.getExpirationMilliseconds());
case API_KEY:
return AuthHelper.forApiKey(authSecret);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import javax.persistence.Converter;
import org.stellar.anchor.api.sep.sep38.RateFee;
import org.stellar.anchor.util.GsonUtils;
import shadow.com.google.common.reflect.TypeToken;
import com.google.common.reflect.TypeToken;

@Converter
public class RateFeeConverter implements AttributeConverter<RateFee, String> {
Expand Down
23 changes: 23 additions & 0 deletions api-schema/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,26 @@ dependencies {

annotationProcessor(libs.lombok)
}

tasks.test {
// Enable parallel test execution
systemProperty("junit.jupiter.execution.parallel.enabled", true)
// Allocate thread count based on available processors
systemProperty("junit.jupiter.execution.parallel.config.strategy", "dynamic")
// Set default parallel mode to same thread. All tests within a class are run in sequence.
systemProperty("junit.jupiter.execution.parallel.mode.default", "same_thread")
// Set default parallel mode for classes to concurrent. All test classes are run in parallel.
systemProperty("junit.jupiter.execution.parallel.mode.classes.default", "concurrent")

// Set default test class order to order annotation. All test classes are run in parallel.
// Some tests take longer to run. Enabling the order will execute long-running tests first to
// shorten the overall test time.
systemProperty(
"junit.jupiter.testclass.order.default",
"org.junit.jupiter.api.ClassOrderer\$OrderAnnotation"
)
maxParallelForks =
(Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1).also {
println("junit5 ... setting maxParallelForks to $it")
}
}
Loading

0 comments on commit 8d5c17a

Please sign in to comment.