Skip to content

Commit 1b8a595

Browse files
Kristjan KosicKovacZanrenovate[bot]datedspkjp
authored
release: 1.0.0 (#105)
* feat: add AIP11 transaction types (#56) * chore(deps): update dependency gradle to v5 (#62) * release: 0.1.4 (#47) * chore: bump dependencies (#49) * release: 0.1.5 (#50) * chore: downgrade bitcoinj-core to 0.14.7 (#51) * release: 0.1.6 (#52) * chore: setup probot/stale configuration * chore(readme): add lead maintainer information (#54) * ci: setup github action workflow for testing * ci: adjust job triggers (#58) * ci: report coverage to codecov (#59) * chore(deps): add renovate.json (#60) * chore(deps): update dependency gradle to v5 * refactor: add SpotlessPlugin and make required changes (#64) * refactor: change transactionType in abstract builder into int (#68) * chore: spotless plugin can only run with java 8 (#76) * chore: remove throw statement if spotless is not run on java 8 (#78) * style: rename AbstractTransaction to AbstractTransactionBuilder (#79) * fix: enable vendorfield for multipayment (#81) * fix: enable vendorfield for multipayment * test: add vendorField to test multipayment txs * chore: spotless plugin (#83) Co-authored-by: Kristjan Kosic <[email protected]> * chore: merge master into develop (#86) * release: 0.1.4 (#47) * chore: bump dependencies (#49) * release: 0.1.5 (#50) * chore: downgrade bitcoinj-core to 0.14.7 (#51) * release: 0.1.6 (#52) * chore: setup probot/stale configuration * chore(readme): add lead maintainer information (#54) * ci: setup github action workflow for testing * ci: adjust job triggers (#58) * ci: report coverage to codecov (#59) * chore(deps): add renovate.json (#60) * chore: update workflow config (#66) * chore(deps): update dependency gradle to v6 (#70) Co-authored-by: WhiteSource Renovate <[email protected]> * chore(deps): update dependency com.google.code.gson:gson to v2.8.6 (#71) Co-authored-by: WhiteSource Renovate <[email protected]> * chore(deps): update dependency org.bitcoinj:bitcoinj-core to v0.15.6 (#72) Co-authored-by: WhiteSource Renovate <[email protected]> * chore(deps): update dependency org.bouncycastle:bcprov-jdk15on to v1.64 (#73) Co-authored-by: WhiteSource Renovate <[email protected]> * fix: handle SignatureDecodeException (#85) * fix: handle SignatureDecodeException * fix: exception handling in Message.java re: update bitcoinj * fix: remove bouncy castle from deps // collision with bitcoinj * chore: update guava package * style: spotless * style: spotless included now in test folder to * chore(deps): update dependency gradle to v6.1.0 (#87) Co-authored-by: WhiteSource Renovate <[email protected]> * chore(test): added actions for different java versions * Revert "chore(test): added actions for different java versions" This reverts commit 71db89a. * chore: add actions for different JDK versions (#90) Co-authored-by: supaiku <[email protected]> Co-authored-by: Brian Faust <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Edgar Goetzendorff <[email protected]> Co-authored-by: WhiteSource Renovate <[email protected]> * Update HTLC claim to support secret of 32 bytes (#97) * feat: added a task to build standalone jars (#99) * fix: multipay serde fix and additional tests (#101) * fix: toJson to accomodate for BigNums * tests: additional helper tests * fix: vendorField serialization * lint: spotless * test: new fixtures for ecdsa and fix for multipayment serde (#102) * chore: .gitignore * chore: .gitignore for idea * fix: multipayment serde * test: new generated fixtures (ecds) * test: fixed test multipayment serde - use new fixtures * test: fix transfer tests - migrate to new fixtures * test: delegate registration to new fixures * test: fix tests, move to new fixtures * test: serde tests to new ecdsa fixtures * test: moving to new fixtures * fix: second signature registration serde methods (#103) * style: spotless apply * release: sync branches (#104) * release: 0.1.4 (#47) * chore: bump dependencies (#49) * release: 0.1.5 (#50) * chore: downgrade bitcoinj-core to 0.14.7 (#51) * release: 0.1.6 (#52) * chore: setup probot/stale configuration * chore(readme): add lead maintainer information (#54) * ci: setup github action workflow for testing * ci: adjust job triggers (#58) * ci: report coverage to codecov (#59) * chore(deps): add renovate.json (#60) * chore: update workflow config (#66) * chore(deps): update dependency gradle to v6 (#70) Co-authored-by: WhiteSource Renovate <[email protected]> * chore(deps): update dependency com.google.code.gson:gson to v2.8.6 (#71) Co-authored-by: WhiteSource Renovate <[email protected]> * chore(deps): update dependency org.bitcoinj:bitcoinj-core to v0.15.6 (#72) Co-authored-by: WhiteSource Renovate <[email protected]> * chore(deps): update dependency org.bouncycastle:bcprov-jdk15on to v1.64 (#73) Co-authored-by: WhiteSource Renovate <[email protected]> * fix: handle SignatureDecodeException (#85) * fix: handle SignatureDecodeException * fix: exception handling in Message.java re: update bitcoinj * fix: remove bouncy castle from deps // collision with bitcoinj * chore: update guava package * chore(deps): update dependency gradle to v6.1.0 (#87) Co-authored-by: WhiteSource Renovate <[email protected]> * chore: add actions for different JDK versions (#90) * chore(deps): update dependency org.junit.jupiter:junit-jupiter-api to v5.6.0 (#93) Co-authored-by: WhiteSource Renovate <[email protected]> * chore(deps): update dependency org.junit.jupiter:junit-jupiter-engine to v5.6.0 (#94) Co-authored-by: WhiteSource Renovate <[email protected]> * chore(deps): update dependency gradle to v6.1.1 (#95) Co-authored-by: WhiteSource Renovate <[email protected]> Co-authored-by: Kristjan Kosic <[email protected]> * style: spotless apply Co-authored-by: supaiku <[email protected]> Co-authored-by: Brian Faust <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Edgar Goetzendorff <[email protected]> Co-authored-by: WhiteSource Renovate <[email protected]> * chore: changelog * chore: pom version tag Co-authored-by: KovacZan <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Edgar Goetzendorff <[email protected]> Co-authored-by: supaiku <[email protected]> Co-authored-by: Brian Faust <[email protected]> Co-authored-by: WhiteSource Renovate <[email protected]>
1 parent 7e54b79 commit 1b8a595

File tree

166 files changed

+3616
-668
lines changed

Some content is hidden

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

166 files changed

+3616
-668
lines changed

.gitignore

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,30 @@
22
.gradle
33
.idea/
44
.tags
5-
build
5+
.project
6+
/build/
67
out/
8+
bin/
9+
.settings
10+
.classpath
11+
12+
# Ignore Gradle GUI config
13+
gradle-app.setting
14+
15+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
16+
!gradle-wrapper.jar
17+
18+
# Cache of project
19+
.gradletasknamecache
20+
21+
gen/
22+
idea-gitignore.jar
23+
resources/templates.list
24+
resources/gitignore/*
25+
build/
26+
build.properties
27+
junit*.properties
28+
IgnoreLexer.java~
29+
.DS_Store
30+
31+
/verification

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## Unreleased
99

10+
## 1.0.0 - 2020-02-11
11+
12+
### Changed
13+
- Upgrade Dependencies
14+
15+
### Added
16+
- Add Support for new Core v2.6 Transaction Types
17+
1018
## 0.1.6 - 2019-10-15
1119

1220
### Changed

build.gradle

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
buildscript {
2+
dependencies {
3+
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.27.1"
4+
}
5+
}
6+
17
plugins {
28
id 'java'
39
id 'maven'
@@ -9,12 +15,26 @@ plugins {
915
apply plugin:'java'
1016
apply plugin:'maven'
1117
apply plugin:'maven-publish'
18+
apply plugin: com.diffplug.gradle.spotless.SpotlessPlugin
1219

1320
repositories {
1421
jcenter()
1522
mavenCentral()
1623
}
1724

25+
task fatJar(type: Jar) {
26+
manifest.from jar.manifest
27+
classifier = 'standalone'
28+
from {
29+
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
30+
} {
31+
exclude "META-INF/*.SF"
32+
exclude "META-INF/*.DSA"
33+
exclude "META-INF/*.RSA"
34+
}
35+
with jar
36+
}
37+
1838
task javadocJar(type: Jar) {
1939
classifier = 'javadoc'
2040
from javadoc
@@ -34,19 +54,19 @@ uploadArchives {
3454
mavenDeployer {
3555
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
3656

37-
repository(url: "file://${buildDir}/repo") {}
57+
repository(url: "file://${buildDir}/repo") {}
3858

3959
//repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
40-
// authentication(userName: '', password: '')
41-
// }
60+
// authentication(userName: '', password: '')
61+
// }
4262

4363
// snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
4464
// authentication(userName: ossrhUsername, password: ossrhPassword)
4565
// }
4666

4767
pom.project {
4868
groupId = 'org.arkecosystem'
49-
version = '0.1.6'
69+
version = '1.0.0'
5070
artifactId = 'crypto'
5171

5272
name = 'java-crypto'
@@ -80,12 +100,18 @@ uploadArchives {
80100
organization = 'Ark Ecosystem'
81101
organizationUrl = 'https://ark.io'
82102
}
103+
developer {
104+
name = 'Zan Kovac'
105+
106+
organization = 'Ark Ecosystem'
107+
organizationUrl = 'https://ark.io'
108+
}
83109
}
84110

85111
scm {
86112
connection = 'scm:git:git://github.com/ArkEcosystem/java-crypto.git'
87113
developerConnection = 'scm:git:ssh://github.com:ArkEcosystem/java-crypto.git'
88-
url = 'https://github.com/ArkEcosystem/java-crypto/tree/0.1.6'
114+
url = 'https://github.com/ArkEcosystem/java-crypto/tree/1.0.0'
89115
}
90116
}
91117
}
@@ -124,5 +150,20 @@ jacocoTestReport {
124150
}
125151

126152
wrapper {
127-
gradleVersion = '4.9'
153+
gradleVersion = '5.6.2'
128154
}
155+
spotless {
156+
java {
157+
target fileTree(projectDir) {
158+
include 'src/main/**/*.java'
159+
include 'src/test/**/*.java'
160+
exclude '**/build/**'
161+
}
162+
googleJavaFormat('1.1').aosp()
163+
}
164+
}
165+
166+
167+
task formatCode(dependsOn: ['spotlessApply'])
168+
169+
build.dependsOn 'spotlessApply'

gradle/wrapper/gradle-wrapper.jar

1.17 KB
Binary file not shown.

gradlew

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env sh
22

3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
319
##############################################################################
420
##
521
## Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
2844
APP_BASE_NAME=`basename "$0"`
2945

3046
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS=""
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
3248

3349
# Use the maximum available, or set MAX_FD != -1 to use that value.
3450
MAX_FD="maximum"
@@ -109,8 +125,8 @@ if $darwin; then
109125
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110126
fi
111127

112-
# For Cygwin, switch paths to Windows format before running java
113-
if $cygwin ; then
128+
# For Cygwin or MSYS, switch paths to Windows format before running java
129+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
114130
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115131
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116132
JAVACMD=`cygpath --unix "$JAVACMD"`

gradlew.bat

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
117
@if "%DEBUG%" == "" @echo off
218
@rem ##########################################################################
319
@rem
@@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
1430
set APP_HOME=%DIRNAME%
1531

1632
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS=
33+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
1834

1935
@rem Find java.exe
2036
if defined JAVA_HOME goto findJavaFromJavaHome
Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,53 @@
11
package org.arkecosystem.crypto.configuration;
22

3-
import org.arkecosystem.crypto.enums.Fees;
4-
import org.arkecosystem.crypto.enums.Types;
5-
63
import java.util.HashMap;
74
import java.util.Map;
5+
import org.arkecosystem.crypto.enums.CoreTransactionTypes;
6+
import org.arkecosystem.crypto.enums.Fees;
7+
import org.arkecosystem.crypto.enums.TransactionTypeGroup;
88

99
public class Fee {
10-
private static Map<Types, Long> fees = new HashMap<>();
10+
private static Map<Integer, Map<Integer, Long>> internalTransactionTypes = new HashMap<>();
1111

1212
static {
13-
fees.put(Types.TRANSFER, Fees.TRANSFER.getValue());
14-
fees.put(Types.SECOND_SIGNATURE_REGISTRATION, Fees.SECOND_SIGNATURE_REGISTRATION.getValue());
15-
fees.put(Types.DELEGATE_REGISTRATION, Fees.DELEGATE_REGISTRATION.getValue());
16-
fees.put(Types.VOTE, Fees.VOTE.getValue());
17-
fees.put(Types.MULTI_SIGNATURE_REGISTRATION, Fees.MULTI_SIGNATURE_REGISTRATION.getValue());
18-
fees.put(Types.IPFS, Fees.IPFS.getValue());
19-
fees.put(Types.TIMELOCK_TRANSFER, Fees.TIMELOCK_TRANSFER.getValue());
20-
fees.put(Types.MULTI_PAYMENT, Fees.MULTI_PAYMENT.getValue());
21-
fees.put(Types.DELEGATE_RESIGNATION, Fees.DELEGATE_RESIGNATION.getValue());
13+
Map<Integer, Long> coreFees = new HashMap<>();
14+
15+
coreFees.put(CoreTransactionTypes.TRANSFER.getValue(), Fees.TRANSFER.getValue());
16+
coreFees.put(
17+
CoreTransactionTypes.SECOND_SIGNATURE_REGISTRATION.getValue(),
18+
Fees.SECOND_SIGNATURE_REGISTRATION.getValue());
19+
coreFees.put(
20+
CoreTransactionTypes.DELEGATE_REGISTRATION.getValue(),
21+
Fees.DELEGATE_REGISTRATION.getValue());
22+
coreFees.put(CoreTransactionTypes.VOTE.getValue(), Fees.VOTE.getValue());
23+
coreFees.put(
24+
CoreTransactionTypes.MULTI_SIGNATURE_REGISTRATION.getValue(),
25+
Fees.MULTI_SIGNATURE_REGISTRATION.getValue());
26+
coreFees.put(CoreTransactionTypes.IPFS.getValue(), Fees.IPFS.getValue());
27+
coreFees.put(CoreTransactionTypes.MULTI_PAYMENT.getValue(), Fees.MULTI_PAYMENT.getValue());
28+
coreFees.put(
29+
CoreTransactionTypes.DELEGATE_RESIGNATION.getValue(),
30+
Fees.DELEGATE_RESIGNATION.getValue());
31+
coreFees.put(CoreTransactionTypes.HTLC_LOCK.getValue(), Fees.HTLC_LOCK.getValue());
32+
coreFees.put(CoreTransactionTypes.HTLC_CLAIM.getValue(), Fees.HTLC_CLAIM.getValue());
33+
coreFees.put(CoreTransactionTypes.HTLC_REFUND.getValue(), Fees.HTLC_REFUND.getValue());
34+
35+
internalTransactionTypes.put(TransactionTypeGroup.CORE.getValue(), coreFees);
36+
}
37+
38+
public static long getFee(int transactionTypeGroup, int type) {
39+
return internalTransactionTypes.get(transactionTypeGroup).get(type);
2240
}
2341

24-
public static long get(Types type) {
25-
return fees.get(type);
42+
public static long getCoreFee(int type) {
43+
return internalTransactionTypes.get(TransactionTypeGroup.CORE.getValue()).get(type);
2644
}
2745

28-
public static void set(Types type, long fee) {
29-
fees.put(type, fee);
46+
public static void set(int transactionTypeGroup, Map<Integer, Long> transactionTypes) {
47+
if (transactionTypeGroup < TransactionTypeGroup.RESERVED.getValue()) {
48+
throw new IllegalArgumentException(
49+
"Cannot add TransactionTypeGroup with value less then 1000");
50+
}
51+
internalTransactionTypes.put(transactionTypeGroup, transactionTypes);
3052
}
3153
}

src/main/java/org/arkecosystem/crypto/encoding/Base58.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,11 @@ public static byte[] decodeChecked(String value) {
1414
return org.bitcoinj.core.Base58.decodeChecked(value);
1515
}
1616

17+
public static byte[] decode(String value) {
18+
return org.bitcoinj.core.Base58.decode(value);
19+
}
20+
21+
public static String encode(byte[] value) {
22+
return org.bitcoinj.core.Base58.encode(value);
23+
}
1724
}

src/main/java/org/arkecosystem/crypto/encoding/Hex.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ public static String encode(byte[] value) {
1010
public static byte[] decode(String value) {
1111
return BaseEncoding.base16().lowerCase().decode(value);
1212
}
13-
1413
}

src/main/java/org/arkecosystem/crypto/enums/Types.java renamed to src/main/java/org/arkecosystem/crypto/enums/CoreTransactionTypes.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
package org.arkecosystem.crypto.enums;
22

3-
public enum Types {
3+
public enum CoreTransactionTypes {
44
TRANSFER(0),
55
SECOND_SIGNATURE_REGISTRATION(1),
66
DELEGATE_REGISTRATION(2),
77
VOTE(3),
88
MULTI_SIGNATURE_REGISTRATION(4),
99
IPFS(5),
10-
TIMELOCK_TRANSFER(6),
11-
MULTI_PAYMENT(7),
12-
DELEGATE_RESIGNATION(8);
10+
MULTI_PAYMENT(6),
11+
DELEGATE_RESIGNATION(7),
12+
HTLC_LOCK(8),
13+
HTLC_CLAIM(9),
14+
HTLC_REFUND(10);
1315

1416
private final int value;
1517

16-
Types(int value) {
18+
CoreTransactionTypes(int value) {
1719
this.value = value;
1820
}
1921

0 commit comments

Comments
 (0)