Skip to content

Commit

Permalink
Merge branch 'release/2.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
gmalouf committed Jun 4, 2024
2 parents a80b519 + 9571772 commit 6746909
Show file tree
Hide file tree
Showing 29 changed files with 467 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Generate and PR
uses: algorand/generator/.github/actions/sdk-codegen/@master
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
fi
- name: Checkout
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-type-category.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Check PR Category and Type
steps:
- name: Checking for correct number of required github pr labels
uses: mheap/github-action-required-labels@v3
uses: mheap/github-action-required-labels@v5
with:
mode: exactly
count: 1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ src/test/resources/generated_responses/
*.feature
src/test/resources/**/*.json
src/test/resources/**/*.base64
src/test/resources/**/*.tok.map
src/test/resources/**/*.teal
src/test/resources/**/*.tok
src/test/resources/**/*.txt
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# 2.5.0

<!-- Release notes generated using configuration in .github/release.yml at release/2.5.0 -->

## What's Changed
### Bugfixes
* Fix: Fix indexer sync issue in cucumber tests by @jasonpaulos in https://github.com/algorand/java-algorand-sdk/pull/686
### Enhancements
* API Update: Regenerate code with the latest specification file (8f8a9ef2) by @github-actions in https://github.com/algorand/java-algorand-sdk/pull/661
* Codegen: Regenerate code with the latest specification file (2335b019) by @github-actions in https://github.com/algorand/java-algorand-sdk/pull/715
* Test: Add minbalance tests for Java SDK. by @gmalouf in https://github.com/algorand/java-algorand-sdk/pull/717
* ci: upgrade checkout action to v4 by @michaeltchuang in https://github.com/algorand/java-algorand-sdk/pull/716


**Full Changelog**: https://github.com/algorand/java-algorand-sdk/compare/2.4.0...2.5.0

# 2.4.0

<!-- Release notes generated using configuration in .github/release.yml at release/2.4.0 -->
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>2.4.0</version>
<version>2.5.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>2.4.0</version>
<version>2.5.0</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package com.algorand.algosdk.v2.client.algod;

import com.algorand.algosdk.v2.client.common.Client;
import com.algorand.algosdk.v2.client.common.HttpMethod;
import com.algorand.algosdk.v2.client.common.Query;
import com.algorand.algosdk.v2.client.common.QueryData;
import com.algorand.algosdk.v2.client.common.Response;
import com.algorand.algosdk.v2.client.model.BlockLogsResponse;


/**
* Get all of the logs from outer and inner app calls in the given round
* /v2/blocks/{round}/logs
*/
public class GetBlockLogs extends Query {

private Long round;

/**
* @param round The round from which to fetch block log information.
*/
public GetBlockLogs(Client client, Long round) {
super(client, new HttpMethod("get"));
this.round = round;
}

/**
* Execute the query.
* @return the query response object.
* @throws Exception
*/
@Override
public Response<BlockLogsResponse> execute() throws Exception {
Response<BlockLogsResponse> resp = baseExecute();
resp.setValueType(BlockLogsResponse.class);
return resp;
}

/**
* Execute the query with custom headers, there must be an equal number of keys and values
* or else an error will be generated.
* @param headers an array of header keys
* @param values an array of header values
* @return the query response object.
* @throws Exception
*/
@Override
public Response<BlockLogsResponse> execute(String[] headers, String[] values) throws Exception {
Response<BlockLogsResponse> resp = baseExecute(headers, values);
resp.setValueType(BlockLogsResponse.class);
return resp;
}

protected QueryData getRequestString() {
if (this.round == null) {
throw new RuntimeException("round is not set. It is a required parameter.");
}
addPathSegment(String.valueOf("v2"));
addPathSegment(String.valueOf("blocks"));
addPathSegment(String.valueOf(round));
addPathSegment(String.valueOf("logs"));

return qd;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.algorand.algosdk.v2.client.algod.GetBlockTxids;
import com.algorand.algosdk.v2.client.algod.GetBlockHash;
import com.algorand.algosdk.v2.client.algod.GetTransactionProof;
import com.algorand.algosdk.v2.client.algod.GetBlockLogs;
import com.algorand.algosdk.v2.client.algod.GetSupply;
import com.algorand.algosdk.v2.client.algod.GetStatus;
import com.algorand.algosdk.v2.client.algod.WaitForBlock;
Expand Down Expand Up @@ -188,6 +189,14 @@ public GetTransactionProof GetTransactionProof(Long round,
return new GetTransactionProof((Client) this, round, txid);
}

/**
* Get all of the logs from outer and inner app calls in the given round
* /v2/blocks/{round}/logs
*/
public GetBlockLogs GetBlockLogs(Long round) {
return new GetBlockLogs((Client) this, round);
}

/**
* Get the current supply reported by the ledger.
* /v2/ledger/supply
Expand Down
64 changes: 46 additions & 18 deletions src/main/java/com/algorand/algosdk/v2/client/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public String address() throws NoSuchAlgorithmException {
public Address address;

/**
* (algo) total number of MicroAlgos in the account
* total number of MicroAlgos in the account
*/
@JsonProperty("amount")
public Long amount;
Expand All @@ -47,37 +47,36 @@ public String address() throws NoSuchAlgorithmException {
public Long amountWithoutPendingRewards;

/**
* (appl) applications local data stored in this account.
* application local data stored in this account.
* Note the raw object uses `map[int] -> AppLocalState` for this type.
*/
@JsonProperty("apps-local-state")
public List<ApplicationLocalState> appsLocalState = new ArrayList<ApplicationLocalState>();

/**
* (teap) the sum of all extra application program pages for this account.
* the sum of all extra application program pages for this account.
*/
@JsonProperty("apps-total-extra-pages")
public Long appsTotalExtraPages;

/**
* (tsch) stores the sum of all of the local schemas and global schemas in this
* account.
* the sum of all of the local schemas and global schemas in this account.
* Note: the raw account uses `StateSchema` for this type.
*/
@JsonProperty("apps-total-schema")
public ApplicationStateSchema appsTotalSchema;

/**
* (asset) assets held by this account.
* assets held by this account.
* Note the raw object uses `map[int] -> AssetHolding` for this type.
*/
@JsonProperty("assets")
public List<AssetHolding> assets = new ArrayList<AssetHolding>();

/**
* (spend) the address against which signing should be checked. If empty, the
* address of the current account is used. This field can be updated in any
* transaction by setting the RekeyTo field.
* The address against which signing should be checked. If empty, the address of
* the current account is used. This field can be updated in any transaction by
* setting the RekeyTo field.
*/
@JsonProperty("auth-addr")
public void authAddr(String authAddr) throws NoSuchAlgorithmException {
Expand All @@ -100,15 +99,14 @@ public String authAddr() throws NoSuchAlgorithmException {
public java.math.BigInteger closedAtRound;

/**
* (appp) parameters of applications created by this account including app global
* data.
* parameters of applications created by this account including app global data.
* Note: the raw account uses `map[int] -> AppParams` for this type.
*/
@JsonProperty("created-apps")
public List<Application> createdApps = new ArrayList<Application>();

/**
* (apar) parameters of assets created by this account.
* parameters of assets created by this account.
* Note: the raw account uses `map[int] -> Asset` for this type.
*/
@JsonProperty("created-assets")
Expand All @@ -126,6 +124,33 @@ public String authAddr() throws NoSuchAlgorithmException {
@JsonProperty("deleted")
public Boolean deleted;

/**
* can the account receive block incentives if its balance is in range at proposal
* time.
*/
@JsonProperty("incentive-eligible")
public Boolean incentiveEligible;

/**
* The round in which this account last went online, or explicitly renewed their
* online status.
*/
@JsonProperty("last-heartbeat")
public Long lastHeartbeat;

/**
* The round in which this account last proposed the block.
*/
@JsonProperty("last-proposed")
public Long lastProposed;

/**
* MicroAlgo balance required by the account.
* The requirement grows based on asset and application usage.
*/
@JsonProperty("min-balance")
public Long minBalance;

/**
* AccountParticipation describes the parameters used by this account in consensus
* protocol.
Expand All @@ -140,15 +165,14 @@ public String authAddr() throws NoSuchAlgorithmException {
public Long pendingRewards;

/**
* (ebase) used as part of the rewards computation. Only applicable to accounts
* which are participating.
* used as part of the rewards computation. Only applicable to accounts which are
* participating.
*/
@JsonProperty("reward-base")
public Long rewardBase;

/**
* (ern) total rewards of MicroAlgos the account has received, including pending
* rewards.
* total rewards of MicroAlgos the account has received, including pending rewards.
*/
@JsonProperty("rewards")
public Long rewards;
Expand All @@ -160,7 +184,7 @@ public String authAddr() throws NoSuchAlgorithmException {
public Long round;

/**
* Indicates what type of signature is used by this account, must be one of:
* the type of signature used by this account, must be one of:
* sig
* msig
* lsig
Expand All @@ -170,7 +194,7 @@ public String authAddr() throws NoSuchAlgorithmException {
public Enums.SigType sigType;

/**
* (onl) delegation status of the account's MicroAlgos
* voting status of the account's MicroAlgos
* Offline - indicates that the associated account is delegated.
* Online - indicates that the associated account used as part of the delegation
* pool.
Expand Down Expand Up @@ -240,6 +264,10 @@ public boolean equals(Object o) {
if (!Objects.deepEquals(this.createdAssets, other.createdAssets)) return false;
if (!Objects.deepEquals(this.createdAtRound, other.createdAtRound)) return false;
if (!Objects.deepEquals(this.deleted, other.deleted)) return false;
if (!Objects.deepEquals(this.incentiveEligible, other.incentiveEligible)) return false;
if (!Objects.deepEquals(this.lastHeartbeat, other.lastHeartbeat)) return false;
if (!Objects.deepEquals(this.lastProposed, other.lastProposed)) return false;
if (!Objects.deepEquals(this.minBalance, other.minBalance)) return false;
if (!Objects.deepEquals(this.participation, other.participation)) return false;
if (!Objects.deepEquals(this.pendingRewards, other.pendingRewards)) return false;
if (!Objects.deepEquals(this.rewardBase, other.rewardBase)) return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.algorand.algosdk.v2.client.model;

import java.util.Objects;

import com.algorand.algosdk.v2.client.common.PathResponse;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* AccountAssetHolding describes the account's asset holding and asset parameters
* (if either exist) for a specific asset ID.
*/
public class AccountAssetHolding extends PathResponse {

/**
* (asset) Details about the asset held by this account.
* The raw account uses `AssetHolding` for this type.
*/
@JsonProperty("asset-holding")
public AssetHolding assetHolding;

/**
* (apar) parameters of the asset held by this account.
* The raw account uses `AssetParams` for this type.
*/
@JsonProperty("asset-params")
public AssetParams assetParams;

@Override
public boolean equals(Object o) {

if (this == o) return true;
if (o == null) return false;

AccountAssetHolding other = (AccountAssetHolding) o;
if (!Objects.deepEquals(this.assetHolding, other.assetHolding)) return false;
if (!Objects.deepEquals(this.assetParams, other.assetParams)) return false;

return true;
}
}
Loading

0 comments on commit 6746909

Please sign in to comment.