Skip to content

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
algolucky committed Jan 3, 2023
2 parents 94032f7 + 4b2a5c4 commit 910098e
Show file tree
Hide file tree
Showing 61 changed files with 40 additions and 10,765 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# 2.0.0

## What's Changed

### Breaking changes

* Remove `TxGroup.assignGroupID(Transaction[] txns, Address address)` in favor
of `TxGroup.assignGroupID(Address address, Transaction ...txns)`.
* Remove `Account.transactionWithSuggestedFeePerByte` in favor of `Account.setFeeByFeePerByte`.
* Remove deprecated methods in `Transaction.java`, mark public `Transaction` constructor as hidden in favor of `com.algorand.algosdk.builder.transaction`.
* Remove deprecated `Transaction.setFee` and `Transaction.setLease` methods.
* Remove v1 algod API (`com.algorand.algosdk.algod.client`) due to API end-of-life (2022-12-01). Instead, use v2 algod API (`com.algorand.algosdk.v2.client.algod`).
* Remove `cost` field in `DryrunTxnResult` in favor of 2 fields: `budget-added` and `budget-consumed`. `cost` can be derived by `budget-consumed - budget-added`.
* Remove logicsig templates, `com/algorand/algosdk/resource/langspec.json`, `com.algorand.algosdk.logic` and methods in `com.algorand.algosdk.crypto` depending on `langspec.json`.
* Remove the deprecated `MethodCallParams` public constructor in favor of `com.algorand.algosdk.builder.transaction.MethodCallTransactionBuilder`.
* Remove unused generated types: `CatchpointAbortResponse`, `CatchpointStartResponse`.

**Full Changelog**: https://github.com/algorand/java-algorand-sdk/compare/1.22.0...2.0.0

# 1.22.0

### Bugfixes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Maven:
<dependency>
<groupId>com.algorand</groupId>
<artifactId>algosdk</artifactId>
<version>1.22.0</version>
<version>2.0.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.algorand</groupId>
<artifactId>algosdk</artifactId>
<version>1.22.0</version>
<version>2.0.0</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down
31 changes: 1 addition & 30 deletions src/main/java/com/algorand/algosdk/account/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,35 +219,6 @@ public SignedBid signBid(Bid bid) throws NoSuchAlgorithmException {
}
}

/**
* Creates a version of the given transaction with fee populated according to suggestedFeePerByte * estimateTxSize.
* @param copyTx transaction to populate fee field
* @param suggestedFeePerByte suggestedFee given by network
* @return transaction with proper fee set
* @throws NoSuchAlgorithmException could not estimate tx encoded size.
* @deprecated Replaced by {@link #setFeeByFeePerByte}.
* This is unsafe to use because the returned transaction is a shallow copy of copyTx.
*/
@Deprecated
static public Transaction transactionWithSuggestedFeePerByte(Transaction copyTx, BigInteger suggestedFeePerByte) throws NoSuchAlgorithmException{
BigInteger newFee = suggestedFeePerByte.multiply(estimatedEncodedSize(copyTx));
if (newFee.compareTo(MIN_TX_FEE_UALGOS) < 0) {
newFee = MIN_TX_FEE_UALGOS;
}
switch (copyTx.type) {
case Payment:
return new Transaction(copyTx.sender, newFee, copyTx.firstValid, copyTx.lastValid, copyTx.note, copyTx.genesisID, copyTx.genesisHash,
copyTx.amount, copyTx.receiver, copyTx.closeRemainderTo);
case KeyRegistration:
return new Transaction(copyTx.sender, newFee, copyTx.firstValid, copyTx.lastValid, copyTx.note, copyTx.genesisID, copyTx.genesisHash,
copyTx.votePK, copyTx.selectionPK, copyTx.voteFirst, copyTx.voteLast, copyTx.voteKeyDilution);
case Default:
throw new IllegalArgumentException("tx cannot have no type");
default:
throw new RuntimeException("cannot reach");
}
}

/**
* Sets the transaction fee according to suggestedFeePerByte * estimateTxSize.
* @param tx transaction to populate fee field
Expand Down Expand Up @@ -276,7 +247,7 @@ static public void setFeeByFeePerByte(Transaction tx, BigInteger suggestedFeePer
if (fee.compareTo(Account.MIN_TX_FEE_UALGOS) < 0) {
fee = Account.MIN_TX_FEE_UALGOS;
}
tx.setFee(fee);
tx.fee = fee;
}

/**
Expand Down

This file was deleted.

64 changes: 0 additions & 64 deletions src/main/java/com/algorand/algosdk/algod/client/ApiCallback.java

This file was deleted.

Loading

0 comments on commit 910098e

Please sign in to comment.