Skip to content

Commit 1c853b6

Browse files
committed
Merge branch 'release/2.3.0'
2 parents 7c47b8c + b50e474 commit 1c853b6

33 files changed

+912
-63
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- run: mvn test
2525
integration-test:
2626
machine:
27-
image: "ubuntu-2004:202104-01"
27+
image: "ubuntu-2204:2022.04.2"
2828
resource_class: medium
2929
steps:
3030
- checkout

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

Lines changed: 20 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
required: true
1010
type: string
1111
pre_release_version:
12-
description: "Pre-Release version, e.g. 'beta-1'"
12+
description: "(Optional) Pre-Release version, e.g. 'beta-1'. Used mainly to support consensus release on betanet."
1313
required: false
1414
type: string
1515

@@ -43,7 +43,7 @@ jobs:
4343
fi
4444
4545
- name: Checkout
46-
uses: actions/checkout@v3
46+
uses: actions/checkout@v3.5.3
4747
with:
4848
fetch-depth: 0
4949

@@ -78,60 +78,33 @@ jobs:
7878
fi
7979
8080
- name: Build Changelog
81-
uses: mikepenz/[email protected]
8281
id: build-changelog
8382
env:
8483
PREVIOUS_VERSION: ${{ steps.get-release.outputs.latest-tag }}
85-
with:
86-
fromTag: ${{ env.PREVIOUS_VERSION }}
87-
toTag: ${{ env.RELEASE_BRANCH }}
88-
failOnError: true
89-
configurationJson: |
90-
{
91-
"categories": [
92-
{
93-
"title": "## New Features",
94-
"labels": [
95-
"New Feature"
96-
]
97-
},
98-
{
99-
"title": "## Enhancements",
100-
"labels": [
101-
"Enhancement"
102-
]
103-
},
104-
{
105-
"title": "## Bug Fixes",
106-
"labels": [
107-
"Bug-Fix"
108-
]
109-
},
110-
{
111-
"title": "## Not Yet Enabled",
112-
"labels": [
113-
"Not-Yet-Enabled"
114-
]
115-
}
116-
],
117-
"ignore_labels": [
118-
"Skip-Release-Notes"
119-
],
120-
"sort": {
121-
"order": "ASC",
122-
"on_property": "mergedAt"
123-
},
124-
"template": "#{{CHANGELOG}}",
125-
"pr_template": "- #{{TITLE}} by @#{{AUTHOR}} in ##{{NUMBER}}"
126-
}
84+
run: |
85+
CHANGELOG=$(curl -L \
86+
-X POST \
87+
-H "Accept: application/vnd.github+json" \
88+
-H "Authorization: Bearer ${{ github.token }}"\
89+
-H "X-GitHub-Api-Version: 2022-11-28" \
90+
https://api.github.com/repos/${{ github.repository }}/releases/generate-notes \
91+
-d '{"tag_name":"${{ env.RELEASE_VERSION }}","target_commitish":"${{ env.RELEASE_BRANCH }}","previous_tag_name":"${{ env.PREVIOUS_VERSION }}","configuration_file_path":".github/release.yml"}' \
92+
| jq -r '.body')
93+
94+
# The EOF steps are used to save multiline string in github:
95+
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-a-multiline-string
96+
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
97+
echo "changelog<<$EOF" >> $GITHUB_OUTPUT
98+
echo -e "${CHANGELOG}" >> $GITHUB_OUTPUT
99+
echo "$EOF" >> $GITHUB_OUTPUT
127100
128101
- name: Update Changelog
129102
if: ${{ env.PRE_RELEASE_VERSION == '' }}
130103
env:
131104
CHANGELOG_CONTENT: ${{ steps.build-changelog.outputs.changelog }}
132105
PREVIOUS_VERSION: ${{ steps.get-release.outputs.latest-tag }}
133106
run: |
134-
echo -e "# ${RELEASE_VERSION}\n\n${CHANGELOG_CONTENT}**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREVIOUS_VERSION}...${RELEASE_VERSION}\n" | cat - CHANGELOG.md > temp && mv temp CHANGELOG.md
107+
echo -e "# ${RELEASE_VERSION}\n\n${CHANGELOG_CONTENT}\n" | cat - CHANGELOG.md > temp && mv temp CHANGELOG.md
135108
136109
- name: Update Version References in Source
137110
env:
@@ -153,15 +126,12 @@ jobs:
153126
GH_TOKEN: ${{ github.token }}
154127
RELEASE_TAG: ${{ steps.set-release.outputs.release-tag }}
155128
run: |
156-
echo -e "# What's Changed\n\n${CHANGELOG_CONTENT}**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREVIOUS_VERSION}...${RELEASE_TAG}" > tmp_msg_body.txt
157-
export msg_body=$(cat tmp_msg_body.txt)
158-
rm tmp_msg_body.txt
159129
# Note: There's an issue adding teams as reviewers, see https://github.com/cli/cli/issues/6395
160130
PULL_REQUEST_URL=$(gh pr create --base "master" \
161131
--title "FOR REVIEW ONLY: ${{ github.event.repository.name }} $RELEASE_TAG" \
162132
--label "Skip-Release-Notes" \
163133
--label "Team Hyper Flow" \
164-
--body "$msg_body" | tail -n 1)
134+
--body "${CHANGELOG_CONTENT}" | tail -n 1)
165135
if [[ $PULL_REQUEST_URL =~ ^https://github.com/${{ github.repository }}/pull/[0-9]+$ ]]; then
166136
PULL_REQUEST_NUM=$(echo $PULL_REQUEST_URL | sed 's:.*/::')
167137
echo "pull-request-master=$PULL_REQUEST_URL" >> $GITHUB_ENV

.test-env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Configs for testing repo download:
22
SDK_TESTING_URL="https://github.com/algorand/algorand-sdk-testing"
3-
SDK_TESTING_BRANCH="master"
3+
SDK_TESTING_BRANCH="V2"
44
SDK_TESTING_HARNESS="test-harness"
55

66
INSTALL_ONLY=0

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# 2.3.0
2+
3+
<!-- Release notes generated using configuration in .github/release.yml at release/2.3.0 -->
4+
5+
## What's Changed
6+
### Bugfixes
7+
* bug-fix: include currency-greater-than param for 0 value by @shiqizng in https://github.com/algorand/java-algorand-sdk/pull/620
8+
### Enhancements
9+
* api: Sync client object with latest spec. by @winder in https://github.com/algorand/java-algorand-sdk/pull/648
10+
11+
12+
**Full Changelog**: https://github.com/algorand/java-algorand-sdk/compare/2.2.0...2.3.0
13+
114
# 2.2.0
215

316
## Enhancements

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.2.0</version>
22+
<version>2.3.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.2.0</version>
7+
<version>2.3.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.BlockTxidsResponse;
9+
10+
11+
/**
12+
* Get the top level transaction IDs for the block on the given round.
13+
* /v2/blocks/{round}/txids
14+
*/
15+
public class GetBlockTxids extends Query {
16+
17+
private Long round;
18+
19+
/**
20+
* @param round The round from which to fetch block transaction IDs.
21+
*/
22+
public GetBlockTxids(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<BlockTxidsResponse> execute() throws Exception {
34+
Response<BlockTxidsResponse> resp = baseExecute();
35+
resp.setValueType(BlockTxidsResponse.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<BlockTxidsResponse> execute(String[] headers, String[] values) throws Exception {
49+
Response<BlockTxidsResponse> resp = baseExecute(headers, values);
50+
resp.setValueType(BlockTxidsResponse.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("txids"));
62+
63+
return qd;
64+
}
65+
}

src/main/java/com/algorand/algosdk/v2/client/algod/WaitForBlock.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
/**
1212
* Waits for a block to appear after round {round} and returns the node's status at
13-
* the time.
13+
* the time. There is a 1 minute timeout, when reached the current status is
14+
* returned regardless of whether or not it is the round after the given round.
1415
* /v2/status/wait-for-block-after/{round}
1516
*/
1617
public class WaitForBlock extends Query {

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.algorand.algosdk.v2.client.algod.AccountApplicationInformation;
1212
import com.algorand.algosdk.v2.client.algod.GetPendingTransactionsByAddress;
1313
import com.algorand.algosdk.v2.client.algod.GetBlock;
14+
import com.algorand.algosdk.v2.client.algod.GetBlockTxids;
1415
import com.algorand.algosdk.v2.client.algod.GetBlockHash;
1516
import com.algorand.algosdk.v2.client.algod.GetTransactionProof;
1617
import com.algorand.algosdk.v2.client.algod.GetSupply;
@@ -162,6 +163,14 @@ public GetBlock GetBlock(Long round) {
162163
return new GetBlock((Client) this, round);
163164
}
164165

166+
/**
167+
* Get the top level transaction IDs for the block on the given round.
168+
* /v2/blocks/{round}/txids
169+
*/
170+
public GetBlockTxids GetBlockTxids(Long round) {
171+
return new GetBlockTxids((Client) this, round);
172+
}
173+
165174
/**
166175
* Get the block hash for the block on the given round.
167176
* /v2/blocks/{round}/hash
@@ -197,7 +206,8 @@ public GetStatus GetStatus() {
197206

198207
/**
199208
* Waits for a block to appear after round {round} and returns the node's status at
200-
* the time.
209+
* the time. There is a 1 minute timeout, when reached the current status is
210+
* returned regardless of whether or not it is the round after the given round.
201211
* /v2/status/wait-for-block-after/{round}
202212
*/
203213
public WaitForBlock WaitForBlock(Long round) {
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package com.algorand.algosdk.v2.client.model;
2+
3+
import java.util.ArrayList;
4+
import java.util.List;
5+
import java.util.Objects;
6+
7+
import com.algorand.algosdk.v2.client.common.PathResponse;
8+
import com.fasterxml.jackson.annotation.JsonProperty;
9+
10+
/**
11+
* An application's initial global/local/box states that were accessed during
12+
* simulation.
13+
*/
14+
public class ApplicationInitialStates extends PathResponse {
15+
16+
/**
17+
* An application's global/local/box state.
18+
*/
19+
@JsonProperty("app-boxes")
20+
public ApplicationKVStorage appBoxes;
21+
22+
/**
23+
* An application's global/local/box state.
24+
*/
25+
@JsonProperty("app-globals")
26+
public ApplicationKVStorage appGlobals;
27+
28+
/**
29+
* An application's initial local states tied to different accounts.
30+
*/
31+
@JsonProperty("app-locals")
32+
public List<ApplicationKVStorage> appLocals = new ArrayList<ApplicationKVStorage>();
33+
34+
/**
35+
* Application index.
36+
*/
37+
@JsonProperty("id")
38+
public java.math.BigInteger id;
39+
40+
@Override
41+
public boolean equals(Object o) {
42+
43+
if (this == o) return true;
44+
if (o == null) return false;
45+
46+
ApplicationInitialStates other = (ApplicationInitialStates) o;
47+
if (!Objects.deepEquals(this.appBoxes, other.appBoxes)) return false;
48+
if (!Objects.deepEquals(this.appGlobals, other.appGlobals)) return false;
49+
if (!Objects.deepEquals(this.appLocals, other.appLocals)) return false;
50+
if (!Objects.deepEquals(this.id, other.id)) return false;
51+
52+
return true;
53+
}
54+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package com.algorand.algosdk.v2.client.model;
2+
3+
import java.security.NoSuchAlgorithmException;
4+
import java.util.ArrayList;
5+
import java.util.List;
6+
import java.util.Objects;
7+
8+
import com.algorand.algosdk.crypto.Address;
9+
import com.algorand.algosdk.v2.client.common.PathResponse;
10+
import com.fasterxml.jackson.annotation.JsonProperty;
11+
12+
/**
13+
* An application's global/local/box state.
14+
*/
15+
public class ApplicationKVStorage extends PathResponse {
16+
17+
/**
18+
* The address of the account associated with the local state.
19+
*/
20+
@JsonProperty("account")
21+
public void account(String account) throws NoSuchAlgorithmException {
22+
this.account = new Address(account);
23+
}
24+
@JsonProperty("account")
25+
public String account() throws NoSuchAlgorithmException {
26+
if (this.account != null) {
27+
return this.account.encodeAsString();
28+
} else {
29+
return null;
30+
}
31+
}
32+
public Address account;
33+
34+
/**
35+
* Key-Value pairs representing application states.
36+
*/
37+
@JsonProperty("kvs")
38+
public List<AvmKeyValue> kvs = new ArrayList<AvmKeyValue>();
39+
40+
@Override
41+
public boolean equals(Object o) {
42+
43+
if (this == o) return true;
44+
if (o == null) return false;
45+
46+
ApplicationKVStorage other = (ApplicationKVStorage) o;
47+
if (!Objects.deepEquals(this.account, other.account)) return false;
48+
if (!Objects.deepEquals(this.kvs, other.kvs)) return false;
49+
50+
return true;
51+
}
52+
}

0 commit comments

Comments
 (0)