Skip to content

Commit

Permalink
Merge branch 'release/2.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
onetechnical committed Sep 19, 2023
2 parents 7c47b8c + b50e474 commit 1c853b6
Show file tree
Hide file tree
Showing 33 changed files with 912 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- run: mvn test
integration-test:
machine:
image: "ubuntu-2004:202104-01"
image: "ubuntu-2204:2022.04.2"
resource_class: medium
steps:
- checkout
Expand Down
70 changes: 20 additions & 50 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
required: true
type: string
pre_release_version:
description: "Pre-Release version, e.g. 'beta-1'"
description: "(Optional) Pre-Release version, e.g. 'beta-1'. Used mainly to support consensus release on betanet."
required: false
type: string

Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
fi
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v3.5.3
with:
fetch-depth: 0

Expand Down Expand Up @@ -78,60 +78,33 @@ jobs:
fi
- name: Build Changelog
uses: mikepenz/release-changelog-builder-action@v3.7.2
id: build-changelog
env:
PREVIOUS_VERSION: ${{ steps.get-release.outputs.latest-tag }}
with:
fromTag: ${{ env.PREVIOUS_VERSION }}
toTag: ${{ env.RELEASE_BRANCH }}
failOnError: true
configurationJson: |
{
"categories": [
{
"title": "## New Features",
"labels": [
"New Feature"
]
},
{
"title": "## Enhancements",
"labels": [
"Enhancement"
]
},
{
"title": "## Bug Fixes",
"labels": [
"Bug-Fix"
]
},
{
"title": "## Not Yet Enabled",
"labels": [
"Not-Yet-Enabled"
]
}
],
"ignore_labels": [
"Skip-Release-Notes"
],
"sort": {
"order": "ASC",
"on_property": "mergedAt"
},
"template": "#{{CHANGELOG}}",
"pr_template": "- #{{TITLE}} by @#{{AUTHOR}} in ##{{NUMBER}}"
}
run: |
CHANGELOG=$(curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ github.token }}"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/releases/generate-notes \
-d '{"tag_name":"${{ env.RELEASE_VERSION }}","target_commitish":"${{ env.RELEASE_BRANCH }}","previous_tag_name":"${{ env.PREVIOUS_VERSION }}","configuration_file_path":".github/release.yml"}' \
| jq -r '.body')
# The EOF steps are used to save multiline string in github:
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-a-multiline-string
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "changelog<<$EOF" >> $GITHUB_OUTPUT
echo -e "${CHANGELOG}" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
- name: Update Changelog
if: ${{ env.PRE_RELEASE_VERSION == '' }}
env:
CHANGELOG_CONTENT: ${{ steps.build-changelog.outputs.changelog }}
PREVIOUS_VERSION: ${{ steps.get-release.outputs.latest-tag }}
run: |
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
echo -e "# ${RELEASE_VERSION}\n\n${CHANGELOG_CONTENT}\n" | cat - CHANGELOG.md > temp && mv temp CHANGELOG.md
- name: Update Version References in Source
env:
Expand All @@ -153,15 +126,12 @@ jobs:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ steps.set-release.outputs.release-tag }}
run: |
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
export msg_body=$(cat tmp_msg_body.txt)
rm tmp_msg_body.txt
# Note: There's an issue adding teams as reviewers, see https://github.com/cli/cli/issues/6395
PULL_REQUEST_URL=$(gh pr create --base "master" \
--title "FOR REVIEW ONLY: ${{ github.event.repository.name }} $RELEASE_TAG" \
--label "Skip-Release-Notes" \
--label "Team Hyper Flow" \
--body "$msg_body" | tail -n 1)
--body "${CHANGELOG_CONTENT}" | tail -n 1)
if [[ $PULL_REQUEST_URL =~ ^https://github.com/${{ github.repository }}/pull/[0-9]+$ ]]; then
PULL_REQUEST_NUM=$(echo $PULL_REQUEST_URL | sed 's:.*/::')
echo "pull-request-master=$PULL_REQUEST_URL" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .test-env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configs for testing repo download:
SDK_TESTING_URL="https://github.com/algorand/algorand-sdk-testing"
SDK_TESTING_BRANCH="master"
SDK_TESTING_BRANCH="V2"
SDK_TESTING_HARNESS="test-harness"

INSTALL_ONLY=0
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 2.3.0

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

## What's Changed
### Bugfixes
* bug-fix: include currency-greater-than param for 0 value by @shiqizng in https://github.com/algorand/java-algorand-sdk/pull/620
### Enhancements
* api: Sync client object with latest spec. by @winder in https://github.com/algorand/java-algorand-sdk/pull/648


**Full Changelog**: https://github.com/algorand/java-algorand-sdk/compare/2.2.0...2.3.0

# 2.2.0

## Enhancements
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.2.0</version>
<version>2.3.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.2.0</version>
<version>2.3.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.BlockTxidsResponse;


/**
* Get the top level transaction IDs for the block on the given round.
* /v2/blocks/{round}/txids
*/
public class GetBlockTxids extends Query {

private Long round;

/**
* @param round The round from which to fetch block transaction IDs.
*/
public GetBlockTxids(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<BlockTxidsResponse> execute() throws Exception {
Response<BlockTxidsResponse> resp = baseExecute();
resp.setValueType(BlockTxidsResponse.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<BlockTxidsResponse> execute(String[] headers, String[] values) throws Exception {
Response<BlockTxidsResponse> resp = baseExecute(headers, values);
resp.setValueType(BlockTxidsResponse.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("txids"));

return qd;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

/**
* Waits for a block to appear after round {round} and returns the node's status at
* the time.
* the time. There is a 1 minute timeout, when reached the current status is
* returned regardless of whether or not it is the round after the given round.
* /v2/status/wait-for-block-after/{round}
*/
public class WaitForBlock extends Query {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.algorand.algosdk.v2.client.algod.AccountApplicationInformation;
import com.algorand.algosdk.v2.client.algod.GetPendingTransactionsByAddress;
import com.algorand.algosdk.v2.client.algod.GetBlock;
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.GetSupply;
Expand Down Expand Up @@ -162,6 +163,14 @@ public GetBlock GetBlock(Long round) {
return new GetBlock((Client) this, round);
}

/**
* Get the top level transaction IDs for the block on the given round.
* /v2/blocks/{round}/txids
*/
public GetBlockTxids GetBlockTxids(Long round) {
return new GetBlockTxids((Client) this, round);
}

/**
* Get the block hash for the block on the given round.
* /v2/blocks/{round}/hash
Expand Down Expand Up @@ -197,7 +206,8 @@ public GetStatus GetStatus() {

/**
* Waits for a block to appear after round {round} and returns the node's status at
* the time.
* the time. There is a 1 minute timeout, when reached the current status is
* returned regardless of whether or not it is the round after the given round.
* /v2/status/wait-for-block-after/{round}
*/
public WaitForBlock WaitForBlock(Long round) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.algorand.algosdk.v2.client.model;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

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

/**
* An application's initial global/local/box states that were accessed during
* simulation.
*/
public class ApplicationInitialStates extends PathResponse {

/**
* An application's global/local/box state.
*/
@JsonProperty("app-boxes")
public ApplicationKVStorage appBoxes;

/**
* An application's global/local/box state.
*/
@JsonProperty("app-globals")
public ApplicationKVStorage appGlobals;

/**
* An application's initial local states tied to different accounts.
*/
@JsonProperty("app-locals")
public List<ApplicationKVStorage> appLocals = new ArrayList<ApplicationKVStorage>();

/**
* Application index.
*/
@JsonProperty("id")
public java.math.BigInteger id;

@Override
public boolean equals(Object o) {

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

ApplicationInitialStates other = (ApplicationInitialStates) o;
if (!Objects.deepEquals(this.appBoxes, other.appBoxes)) return false;
if (!Objects.deepEquals(this.appGlobals, other.appGlobals)) return false;
if (!Objects.deepEquals(this.appLocals, other.appLocals)) return false;
if (!Objects.deepEquals(this.id, other.id)) return false;

return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package com.algorand.algosdk.v2.client.model;

import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

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

/**
* An application's global/local/box state.
*/
public class ApplicationKVStorage extends PathResponse {

/**
* The address of the account associated with the local state.
*/
@JsonProperty("account")
public void account(String account) throws NoSuchAlgorithmException {
this.account = new Address(account);
}
@JsonProperty("account")
public String account() throws NoSuchAlgorithmException {
if (this.account != null) {
return this.account.encodeAsString();
} else {
return null;
}
}
public Address account;

/**
* Key-Value pairs representing application states.
*/
@JsonProperty("kvs")
public List<AvmKeyValue> kvs = new ArrayList<AvmKeyValue>();

@Override
public boolean equals(Object o) {

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

ApplicationKVStorage other = (ApplicationKVStorage) o;
if (!Objects.deepEquals(this.account, other.account)) return false;
if (!Objects.deepEquals(this.kvs, other.kvs)) return false;

return true;
}
}
Loading

0 comments on commit 1c853b6

Please sign in to comment.