Skip to content

Commit

Permalink
release: 1.0.0 (#105)
Browse files Browse the repository at this point in the history
* 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 <chris@ark.io>

* 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 <renovatebot@gmail.com>

* chore(deps): update dependency com.google.code.gson:gson to v2.8.6 (#71)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* chore(deps): update dependency org.bitcoinj:bitcoinj-core to v0.15.6 (#72)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* chore(deps): update dependency org.bouncycastle:bcprov-jdk15on to v1.64 (#73)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* 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 <renovatebot@gmail.com>

* 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 <1311798+supaiku0@users.noreply.github.com>
Co-authored-by: Brian Faust <faustbrian@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edgar Goetzendorff <hello@dated.fun>
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* 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 <renovatebot@gmail.com>

* chore(deps): update dependency com.google.code.gson:gson to v2.8.6 (#71)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* chore(deps): update dependency org.bitcoinj:bitcoinj-core to v0.15.6 (#72)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* chore(deps): update dependency org.bouncycastle:bcprov-jdk15on to v1.64 (#73)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* 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 <renovatebot@gmail.com>

* 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 <renovatebot@gmail.com>

* chore(deps): update dependency org.junit.jupiter:junit-jupiter-engine to v5.6.0 (#94)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* chore(deps): update dependency gradle to v6.1.1 (#95)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
Co-authored-by: Kristjan Kosic <chris@ark.io>

* style: spotless apply

Co-authored-by: supaiku <1311798+supaiku0@users.noreply.github.com>
Co-authored-by: Brian Faust <faustbrian@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edgar Goetzendorff <hello@dated.fun>
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* chore: changelog

* chore: pom version tag

Co-authored-by: KovacZan <39158639+KovacZan@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edgar Goetzendorff <hello@dated.fun>
Co-authored-by: supaiku <1311798+supaiku0@users.noreply.github.com>
Co-authored-by: Brian Faust <faustbrian@users.noreply.github.com>
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
  • Loading branch information
7 people authored Feb 12, 2020
1 parent 7e54b79 commit 1b8a595
Show file tree
Hide file tree
Showing 166 changed files with 3,616 additions and 668 deletions.
27 changes: 26 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,30 @@
.gradle
.idea/
.tags
build
.project
/build/
out/
bin/
.settings
.classpath

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

gen/
idea-gitignore.jar
resources/templates.list
resources/gitignore/*
build/
build.properties
junit*.properties
IgnoreLexer.java~
.DS_Store

/verification
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## Unreleased

## 1.0.0 - 2020-02-11

### Changed
- Upgrade Dependencies

### Added
- Add Support for new Core v2.6 Transaction Types

## 0.1.6 - 2019-10-15

### Changed
Expand Down
53 changes: 47 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
buildscript {
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.27.1"
}
}

plugins {
id 'java'
id 'maven'
Expand All @@ -9,12 +15,26 @@ plugins {
apply plugin:'java'
apply plugin:'maven'
apply plugin:'maven-publish'
apply plugin: com.diffplug.gradle.spotless.SpotlessPlugin

repositories {
jcenter()
mavenCentral()
}

task fatJar(type: Jar) {
manifest.from jar.manifest
classifier = 'standalone'
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
with jar
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
Expand All @@ -34,19 +54,19 @@ uploadArchives {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "file://${buildDir}/repo") {}
repository(url: "file://${buildDir}/repo") {}

//repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
// authentication(userName: '', password: '')
// }
// authentication(userName: '', password: '')
// }

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

pom.project {
groupId = 'org.arkecosystem'
version = '0.1.6'
version = '1.0.0'
artifactId = 'crypto'

name = 'java-crypto'
Expand Down Expand Up @@ -80,12 +100,18 @@ uploadArchives {
organization = 'Ark Ecosystem'
organizationUrl = 'https://ark.io'
}
developer {
name = 'Zan Kovac'
email = 'zan@ark.io'
organization = 'Ark Ecosystem'
organizationUrl = 'https://ark.io'
}
}

scm {
connection = 'scm:git:git://github.com/ArkEcosystem/java-crypto.git'
developerConnection = 'scm:git:ssh://github.com:ArkEcosystem/java-crypto.git'
url = 'https://github.com/ArkEcosystem/java-crypto/tree/0.1.6'
url = 'https://github.com/ArkEcosystem/java-crypto/tree/1.0.0'
}
}
}
Expand Down Expand Up @@ -124,5 +150,20 @@ jacocoTestReport {
}

wrapper {
gradleVersion = '4.9'
gradleVersion = '5.6.2'
}
spotless {
java {
target fileTree(projectDir) {
include 'src/main/**/*.java'
include 'src/test/**/*.java'
exclude '**/build/**'
}
googleJavaFormat('1.1').aosp()
}
}


task formatCode(dependsOn: ['spotlessApply'])

build.dependsOn 'spotlessApply'
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
22 changes: 19 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

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

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

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
Expand Down
18 changes: 17 additions & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

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

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
56 changes: 39 additions & 17 deletions src/main/java/org/arkecosystem/crypto/configuration/Fee.java
Original file line number Diff line number Diff line change
@@ -1,31 +1,53 @@
package org.arkecosystem.crypto.configuration;

import org.arkecosystem.crypto.enums.Fees;
import org.arkecosystem.crypto.enums.Types;

import java.util.HashMap;
import java.util.Map;
import org.arkecosystem.crypto.enums.CoreTransactionTypes;
import org.arkecosystem.crypto.enums.Fees;
import org.arkecosystem.crypto.enums.TransactionTypeGroup;

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

static {
fees.put(Types.TRANSFER, Fees.TRANSFER.getValue());
fees.put(Types.SECOND_SIGNATURE_REGISTRATION, Fees.SECOND_SIGNATURE_REGISTRATION.getValue());
fees.put(Types.DELEGATE_REGISTRATION, Fees.DELEGATE_REGISTRATION.getValue());
fees.put(Types.VOTE, Fees.VOTE.getValue());
fees.put(Types.MULTI_SIGNATURE_REGISTRATION, Fees.MULTI_SIGNATURE_REGISTRATION.getValue());
fees.put(Types.IPFS, Fees.IPFS.getValue());
fees.put(Types.TIMELOCK_TRANSFER, Fees.TIMELOCK_TRANSFER.getValue());
fees.put(Types.MULTI_PAYMENT, Fees.MULTI_PAYMENT.getValue());
fees.put(Types.DELEGATE_RESIGNATION, Fees.DELEGATE_RESIGNATION.getValue());
Map<Integer, Long> coreFees = new HashMap<>();

coreFees.put(CoreTransactionTypes.TRANSFER.getValue(), Fees.TRANSFER.getValue());
coreFees.put(
CoreTransactionTypes.SECOND_SIGNATURE_REGISTRATION.getValue(),
Fees.SECOND_SIGNATURE_REGISTRATION.getValue());
coreFees.put(
CoreTransactionTypes.DELEGATE_REGISTRATION.getValue(),
Fees.DELEGATE_REGISTRATION.getValue());
coreFees.put(CoreTransactionTypes.VOTE.getValue(), Fees.VOTE.getValue());
coreFees.put(
CoreTransactionTypes.MULTI_SIGNATURE_REGISTRATION.getValue(),
Fees.MULTI_SIGNATURE_REGISTRATION.getValue());
coreFees.put(CoreTransactionTypes.IPFS.getValue(), Fees.IPFS.getValue());
coreFees.put(CoreTransactionTypes.MULTI_PAYMENT.getValue(), Fees.MULTI_PAYMENT.getValue());
coreFees.put(
CoreTransactionTypes.DELEGATE_RESIGNATION.getValue(),
Fees.DELEGATE_RESIGNATION.getValue());
coreFees.put(CoreTransactionTypes.HTLC_LOCK.getValue(), Fees.HTLC_LOCK.getValue());
coreFees.put(CoreTransactionTypes.HTLC_CLAIM.getValue(), Fees.HTLC_CLAIM.getValue());
coreFees.put(CoreTransactionTypes.HTLC_REFUND.getValue(), Fees.HTLC_REFUND.getValue());

internalTransactionTypes.put(TransactionTypeGroup.CORE.getValue(), coreFees);
}

public static long getFee(int transactionTypeGroup, int type) {
return internalTransactionTypes.get(transactionTypeGroup).get(type);
}

public static long get(Types type) {
return fees.get(type);
public static long getCoreFee(int type) {
return internalTransactionTypes.get(TransactionTypeGroup.CORE.getValue()).get(type);
}

public static void set(Types type, long fee) {
fees.put(type, fee);
public static void set(int transactionTypeGroup, Map<Integer, Long> transactionTypes) {
if (transactionTypeGroup < TransactionTypeGroup.RESERVED.getValue()) {
throw new IllegalArgumentException(
"Cannot add TransactionTypeGroup with value less then 1000");
}
internalTransactionTypes.put(transactionTypeGroup, transactionTypes);
}
}
7 changes: 7 additions & 0 deletions src/main/java/org/arkecosystem/crypto/encoding/Base58.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@ public static byte[] decodeChecked(String value) {
return org.bitcoinj.core.Base58.decodeChecked(value);
}

public static byte[] decode(String value) {
return org.bitcoinj.core.Base58.decode(value);
}

public static String encode(byte[] value) {
return org.bitcoinj.core.Base58.encode(value);
}
}
1 change: 0 additions & 1 deletion src/main/java/org/arkecosystem/crypto/encoding/Hex.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ public static String encode(byte[] value) {
public static byte[] decode(String value) {
return BaseEncoding.base16().lowerCase().decode(value);
}

}
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
package org.arkecosystem.crypto.enums;

public enum Types {
public enum CoreTransactionTypes {
TRANSFER(0),
SECOND_SIGNATURE_REGISTRATION(1),
DELEGATE_REGISTRATION(2),
VOTE(3),
MULTI_SIGNATURE_REGISTRATION(4),
IPFS(5),
TIMELOCK_TRANSFER(6),
MULTI_PAYMENT(7),
DELEGATE_RESIGNATION(8);
MULTI_PAYMENT(6),
DELEGATE_RESIGNATION(7),
HTLC_LOCK(8),
HTLC_CLAIM(9),
HTLC_REFUND(10);

private final int value;

Types(int value) {
CoreTransactionTypes(int value) {
this.value = value;
}

Expand Down
10 changes: 6 additions & 4 deletions src/main/java/org/arkecosystem/crypto/enums/Fees.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ public enum Fees {
DELEGATE_REGISTRATION(2_500_000_000L),
VOTE(100_000_000L),
MULTI_SIGNATURE_REGISTRATION(500_000_000L),
IPFS(0L),
TIMELOCK_TRANSFER(0L),
MULTI_PAYMENT(0L),
DELEGATE_RESIGNATION(0L);
IPFS(500_000_000L),
MULTI_PAYMENT(10_000_000L),
DELEGATE_RESIGNATION(2_500_000_000L),
HTLC_LOCK(10_000_000L),
HTLC_CLAIM(0L),
HTLC_REFUND(0L);

private final Long value;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.arkecosystem.crypto.enums;

public enum HtlcLockExpirationType {
EPOCH_TIMESTAMP(1),
BLOCK_HEIGHT(2);

private final int value;

HtlcLockExpirationType(int value) {
this.value = value;
}

public int getValue() {
return value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.arkecosystem.crypto.enums;

public enum TransactionTypeGroup {
TEST(0),
CORE(1),

RESERVED(1000);

private final int value;

TransactionTypeGroup(int value) {
this.value = value;
}

public int getValue() {
return value;
}
}
Loading

0 comments on commit 1b8a595

Please sign in to comment.