Skip to content

Commit f720190

Browse files
authored
refactor: add evm builder (#186)
1 parent 520735f commit f720190

File tree

106 files changed

+3157
-3207
lines changed

Some content is hidden

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

106 files changed

+3157
-3207
lines changed

.github/workflows/test.yml

Lines changed: 49 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,54 @@
11
name: Test
22

33
on:
4-
push:
5-
branches:
6-
- "master"
7-
- "develop"
8-
pull_request:
9-
types: [ready_for_review, synchronize, opened]
4+
push:
5+
branches:
6+
- "master"
7+
- "develop"
8+
pull_request:
9+
types: [ready_for_review, synchronize, opened]
1010

1111
jobs:
12-
format:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v2
17-
with:
18-
ref: ${{ github.head_ref }}
19-
20-
- name: Merge Conflict finder
21-
uses: olivernybroe/[email protected]
22-
23-
- name: Use Java Version 22
24-
uses: actions/setup-java@v2
25-
with:
26-
distribution: "adopt"
27-
java-version: "22"
28-
cache: "gradle"
29-
30-
- name: Format code
31-
run: gradle format
32-
33-
- name: Commit fixed code
34-
uses: stefanzweifel/git-auto-commit-action@v4
35-
with:
36-
commit_message: "style: resolve style guide violations"
37-
branch: ${{ github.head_ref }}
38-
39-
unit:
40-
runs-on: ubuntu-latest
41-
steps:
42-
- name: Checkout code
43-
uses: actions/checkout@v2
44-
with:
45-
ref: ${{ github.head_ref }}
46-
47-
- name: Merge Conflict finder
48-
uses: olivernybroe/[email protected]
49-
50-
- name: Install Nix
51-
uses: cachix/install-nix-action@v27
52-
53-
- name: Install libsecp256k1
54-
run: |
55-
nix profile install nixpkgs#secp256k1
56-
env:
57-
NIX_PATH: $HOME/.nix-profile/bin
58-
59-
- name: Set LD_LIBRARY_PATH
60-
run: echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.nix-profile/lib" >> $GITHUB_ENV
61-
62-
- name: Use Java Version 22
63-
uses: actions/setup-java@v2
64-
with:
65-
distribution: "adopt"
66-
java-version: "22"
67-
cache: "gradle"
68-
69-
- name: Install
70-
run: gradle dependencies
71-
72-
- name: Test
73-
run: gradle test && gradle jacocoTestReport
74-
75-
- name: Codecov
76-
run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}
12+
unit:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Java 17
19+
uses: actions/setup-java@v3
20+
with:
21+
distribution: 'temurin'
22+
java-version: '17'
23+
cache: 'gradle'
24+
25+
- name: Install Dependencies
26+
run: ./gradlew dependencies
27+
28+
- name: Run Tests
29+
run: ./gradlew test jacocoTestReport
30+
31+
- name: Upload Test Results
32+
uses: actions/upload-artifact@v3
33+
with:
34+
name: test-results
35+
path: build/reports/tests/test
36+
37+
- name: Upload Coverage Report
38+
uses: actions/upload-artifact@v3
39+
with:
40+
name: code-coverage-report
41+
path: build/reports/jacoco/test/html
42+
43+
- name: Upload Jacoco XML Report
44+
uses: actions/upload-artifact@v3
45+
with:
46+
name: jacoco-xml-report
47+
path: build/reports/jacoco/test/jacocoTestReport.xml
48+
49+
- name: Codecov
50+
uses: codecov/codecov-action@v3
51+
with:
52+
token: ${{ secrets.CODECOV_TOKEN }}
53+
files: build/reports/jacoco/test/jacocoTestReport.xml
54+
fail_ci_if_error: true

build.gradle

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ plugins {
77
}
88

99
group = 'org.arkecosystem'
10-
version = '2.0.0'
10+
version = '2.0.0-mainsail'
1111

1212
java {
13-
sourceCompatibility = JavaVersion.VERSION_1_8
14-
targetCompatibility = JavaVersion.VERSION_1_8
13+
sourceCompatibility = JavaVersion.VERSION_17
14+
targetCompatibility = JavaVersion.VERSION_17
1515
withJavadocJar()
1616
withSourcesJar()
1717
}
@@ -22,15 +22,13 @@ repositories {
2222
}
2323

2424
dependencies {
25-
implementation 'org.web3j:core:4.8.7'
25+
// Core dependencies
2626
implementation 'org.bitcoinj:bitcoinj-core:0.16.3'
27-
implementation files('libs/secp256k1-api-0.0.1.jar')
28-
implementation files('libs/secp256k1-foreign-0.0.1.jar')
27+
implementation 'org.bouncycastle:bcprov-jdk15on:1.70'
28+
implementation 'org.web3j:core:4.8.7'
2929
implementation 'com.google.code.gson:gson:2.11.0'
30-
implementation 'com.google.guava:guava:30.2.0-jre'
3130

32-
testImplementation 'org.slf4j:slf4j-api:2.0.13'
33-
testRuntimeOnly 'org.slf4j:slf4j-simple:2.0.13'
31+
// Test dependencies
3432
testImplementation 'org.hamcrest:hamcrest-library:3.0'
3533
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
3634
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.3'
@@ -42,7 +40,6 @@ test {
4240
useJUnitPlatform()
4341
testLogging {
4442
events 'PASSED', 'FAILED', 'SKIPPED'
45-
showStandardStreams = true
4643
}
4744
}
4845

@@ -155,8 +152,13 @@ publishing {
155152
}
156153

157154
signing {
155+
// Only sign when publishing to remote repository
156+
required { gradle.taskGraph.hasTask("publish") && !gradle.taskGraph.hasTask("publishToMavenLocal") }
157+
158158
def signingKey = findProperty("signingKey")
159159
def signingPassword = findProperty("signingPassword")
160-
useInMemoryPgpKeys(signingKey as String, signingPassword as String)
161-
sign publishing.publications.mavenJava
160+
if (signingKey && signingPassword) {
161+
useInMemoryPgpKeys(signingKey as String, signingPassword as String)
162+
sign publishing.publications.mavenJava
163+
}
162164
}

libs/secp256k1-api-0.0.1.jar

-12.4 KB
Binary file not shown.

libs/secp256k1-foreign-0.0.1.jar

-92.4 KB
Binary file not shown.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.arkecosystem.crypto.enums;
2+
3+
public enum AbiFunction {
4+
VOTE("vote"),
5+
UNVOTE("unvote"),
6+
VALIDATOR_REGISTRATION("registerValidator"),
7+
VALIDATOR_RESIGNATION("resignValidator");
8+
9+
private final String functionName;
10+
11+
AbiFunction(String functionName) {
12+
this.functionName = functionName;
13+
}
14+
15+
public String toString() {
16+
return functionName;
17+
}
18+
}

src/main/java/org/arkecosystem/crypto/enums/CoreTransactionTypes.java

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/main/java/org/arkecosystem/crypto/enums/Fees.java

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/main/java/org/arkecosystem/crypto/enums/TransactionTypeGroup.java

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/main/java/org/arkecosystem/crypto/signature/CompressedPubKeyDataImpl.java

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/main/java/org/arkecosystem/crypto/signature/P256k1PrivKeyImpl.java

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)