Skip to content

Commit 6746909

Browse files
committed
Merge branch 'release/2.5.0'
2 parents a80b519 + 9571772 commit 6746909

29 files changed

+467
-77
lines changed

.github/workflows/codegen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Check out repository
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414
- name: Generate and PR
1515
uses: algorand/generator/.github/actions/sdk-codegen/@master
1616
with:

.github/workflows/create-release-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
fi
4444
4545
- name: Checkout
46-
uses: actions/checkout@v3.5.3
46+
uses: actions/checkout@v4
4747
with:
4848
fetch-depth: 0
4949

.github/workflows/pr-type-category.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: Check PR Category and Type
1111
steps:
1212
- name: Checking for correct number of required github pr labels
13-
uses: mheap/github-action-required-labels@v3
13+
uses: mheap/github-action-required-labels@v5
1414
with:
1515
mode: exactly
1616
count: 1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ src/test/resources/generated_responses/
44
*.feature
55
src/test/resources/**/*.json
66
src/test/resources/**/*.base64
7+
src/test/resources/**/*.tok.map
78
src/test/resources/**/*.teal
89
src/test/resources/**/*.tok
910
src/test/resources/**/*.txt

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# 2.5.0
2+
3+
<!-- Release notes generated using configuration in .github/release.yml at release/2.5.0 -->
4+
5+
## What's Changed
6+
### Bugfixes
7+
* Fix: Fix indexer sync issue in cucumber tests by @jasonpaulos in https://github.com/algorand/java-algorand-sdk/pull/686
8+
### Enhancements
9+
* API Update: Regenerate code with the latest specification file (8f8a9ef2) by @github-actions in https://github.com/algorand/java-algorand-sdk/pull/661
10+
* Codegen: Regenerate code with the latest specification file (2335b019) by @github-actions in https://github.com/algorand/java-algorand-sdk/pull/715
11+
* Test: Add minbalance tests for Java SDK. by @gmalouf in https://github.com/algorand/java-algorand-sdk/pull/717
12+
* ci: upgrade checkout action to v4 by @michaeltchuang in https://github.com/algorand/java-algorand-sdk/pull/716
13+
14+
15+
**Full Changelog**: https://github.com/algorand/java-algorand-sdk/compare/2.4.0...2.5.0
16+
117
# 2.4.0
218

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Maven:
1919
<dependency>
2020
<groupId>com.algorand</groupId>
2121
<artifactId>algosdk</artifactId>
22-
<version>2.4.0</version>
22+
<version>2.5.0</version>
2323
</dependency>
2424
```
2525

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.algorand</groupId>
66
<artifactId>algosdk</artifactId>
7-
<version>2.4.0</version>
7+
<version>2.5.0</version>
88
<packaging>jar</packaging>
99

1010
<name>${project.groupId}:${project.artifactId}</name>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package com.algorand.algosdk.v2.client.algod;
2+
3+
import com.algorand.algosdk.v2.client.common.Client;
4+
import com.algorand.algosdk.v2.client.common.HttpMethod;
5+
import com.algorand.algosdk.v2.client.common.Query;
6+
import com.algorand.algosdk.v2.client.common.QueryData;
7+
import com.algorand.algosdk.v2.client.common.Response;
8+
import com.algorand.algosdk.v2.client.model.BlockLogsResponse;
9+
10+
11+
/**
12+
* Get all of the logs from outer and inner app calls in the given round
13+
* /v2/blocks/{round}/logs
14+
*/
15+
public class GetBlockLogs extends Query {
16+
17+
private Long round;
18+
19+
/**
20+
* @param round The round from which to fetch block log information.
21+
*/
22+
public GetBlockLogs(Client client, Long round) {
23+
super(client, new HttpMethod("get"));
24+
this.round = round;
25+
}
26+
27+
/**
28+
* Execute the query.
29+
* @return the query response object.
30+
* @throws Exception
31+
*/
32+
@Override
33+
public Response<BlockLogsResponse> execute() throws Exception {
34+
Response<BlockLogsResponse> resp = baseExecute();
35+
resp.setValueType(BlockLogsResponse.class);
36+
return resp;
37+
}
38+
39+
/**
40+
* Execute the query with custom headers, there must be an equal number of keys and values
41+
* or else an error will be generated.
42+
* @param headers an array of header keys
43+
* @param values an array of header values
44+
* @return the query response object.
45+
* @throws Exception
46+
*/
47+
@Override
48+
public Response<BlockLogsResponse> execute(String[] headers, String[] values) throws Exception {
49+
Response<BlockLogsResponse> resp = baseExecute(headers, values);
50+
resp.setValueType(BlockLogsResponse.class);
51+
return resp;
52+
}
53+
54+
protected QueryData getRequestString() {
55+
if (this.round == null) {
56+
throw new RuntimeException("round is not set. It is a required parameter.");
57+
}
58+
addPathSegment(String.valueOf("v2"));
59+
addPathSegment(String.valueOf("blocks"));
60+
addPathSegment(String.valueOf(round));
61+
addPathSegment(String.valueOf("logs"));
62+
63+
return qd;
64+
}
65+
}

src/main/java/com/algorand/algosdk/v2/client/common/AlgodClient.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import com.algorand.algosdk.v2.client.algod.GetBlockTxids;
1515
import com.algorand.algosdk.v2.client.algod.GetBlockHash;
1616
import com.algorand.algosdk.v2.client.algod.GetTransactionProof;
17+
import com.algorand.algosdk.v2.client.algod.GetBlockLogs;
1718
import com.algorand.algosdk.v2.client.algod.GetSupply;
1819
import com.algorand.algosdk.v2.client.algod.GetStatus;
1920
import com.algorand.algosdk.v2.client.algod.WaitForBlock;
@@ -188,6 +189,14 @@ public GetTransactionProof GetTransactionProof(Long round,
188189
return new GetTransactionProof((Client) this, round, txid);
189190
}
190191

192+
/**
193+
* Get all of the logs from outer and inner app calls in the given round
194+
* /v2/blocks/{round}/logs
195+
*/
196+
public GetBlockLogs GetBlockLogs(Long round) {
197+
return new GetBlockLogs((Client) this, round);
198+
}
199+
191200
/**
192201
* Get the current supply reported by the ledger.
193202
* /v2/ledger/supply

src/main/java/com/algorand/algosdk/v2/client/model/Account.java

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public String address() throws NoSuchAlgorithmException {
3535
public Address address;
3636

3737
/**
38-
* (algo) total number of MicroAlgos in the account
38+
* total number of MicroAlgos in the account
3939
*/
4040
@JsonProperty("amount")
4141
public Long amount;
@@ -47,37 +47,36 @@ public String address() throws NoSuchAlgorithmException {
4747
public Long amountWithoutPendingRewards;
4848

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

5656
/**
57-
* (teap) the sum of all extra application program pages for this account.
57+
* the sum of all extra application program pages for this account.
5858
*/
5959
@JsonProperty("apps-total-extra-pages")
6060
public Long appsTotalExtraPages;
6161

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

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

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

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

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

127+
/**
128+
* can the account receive block incentives if its balance is in range at proposal
129+
* time.
130+
*/
131+
@JsonProperty("incentive-eligible")
132+
public Boolean incentiveEligible;
133+
134+
/**
135+
* The round in which this account last went online, or explicitly renewed their
136+
* online status.
137+
*/
138+
@JsonProperty("last-heartbeat")
139+
public Long lastHeartbeat;
140+
141+
/**
142+
* The round in which this account last proposed the block.
143+
*/
144+
@JsonProperty("last-proposed")
145+
public Long lastProposed;
146+
147+
/**
148+
* MicroAlgo balance required by the account.
149+
* The requirement grows based on asset and application usage.
150+
*/
151+
@JsonProperty("min-balance")
152+
public Long minBalance;
153+
129154
/**
130155
* AccountParticipation describes the parameters used by this account in consensus
131156
* protocol.
@@ -140,15 +165,14 @@ public String authAddr() throws NoSuchAlgorithmException {
140165
public Long pendingRewards;
141166

142167
/**
143-
* (ebase) used as part of the rewards computation. Only applicable to accounts
144-
* which are participating.
168+
* used as part of the rewards computation. Only applicable to accounts which are
169+
* participating.
145170
*/
146171
@JsonProperty("reward-base")
147172
public Long rewardBase;
148173

149174
/**
150-
* (ern) total rewards of MicroAlgos the account has received, including pending
151-
* rewards.
175+
* total rewards of MicroAlgos the account has received, including pending rewards.
152176
*/
153177
@JsonProperty("rewards")
154178
public Long rewards;
@@ -160,7 +184,7 @@ public String authAddr() throws NoSuchAlgorithmException {
160184
public Long round;
161185

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

172196
/**
173-
* (onl) delegation status of the account's MicroAlgos
197+
* voting status of the account's MicroAlgos
174198
* Offline - indicates that the associated account is delegated.
175199
* Online - indicates that the associated account used as part of the delegation
176200
* pool.
@@ -240,6 +264,10 @@ public boolean equals(Object o) {
240264
if (!Objects.deepEquals(this.createdAssets, other.createdAssets)) return false;
241265
if (!Objects.deepEquals(this.createdAtRound, other.createdAtRound)) return false;
242266
if (!Objects.deepEquals(this.deleted, other.deleted)) return false;
267+
if (!Objects.deepEquals(this.incentiveEligible, other.incentiveEligible)) return false;
268+
if (!Objects.deepEquals(this.lastHeartbeat, other.lastHeartbeat)) return false;
269+
if (!Objects.deepEquals(this.lastProposed, other.lastProposed)) return false;
270+
if (!Objects.deepEquals(this.minBalance, other.minBalance)) return false;
243271
if (!Objects.deepEquals(this.participation, other.participation)) return false;
244272
if (!Objects.deepEquals(this.pendingRewards, other.pendingRewards)) return false;
245273
if (!Objects.deepEquals(this.rewardBase, other.rewardBase)) return false;

0 commit comments

Comments
 (0)