-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
7e54b79
commit 1b8a595
Showing
166 changed files
with
3,616 additions
and
668 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 39 additions & 17 deletions
56
src/main/java/org/arkecosystem/crypto/configuration/Fee.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 7 additions & 5 deletions
12
.../org/arkecosystem/crypto/enums/Types.java → ...em/crypto/enums/CoreTransactionTypes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/org/arkecosystem/crypto/enums/HtlcLockExpirationType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/org/arkecosystem/crypto/enums/TransactionTypeGroup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.