Skip to content

Commit

Permalink
Merge branch 'release/1.15.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
onetechnical committed Jun 2, 2022
2 parents 6506e97 + 48fd038 commit 704d1fe
Show file tree
Hide file tree
Showing 33 changed files with 1,312 additions and 891 deletions.
12 changes: 10 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ workflows:
version: 2
test:
jobs:
- unit-test
- integration-test
- unit-test:
filters:
branches:
ignore:
- gh-pages
- integration-test:
filters:
branches:
ignore:
- gh-pages

jobs:
unit-test:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "SDK Code Generation"
on:
schedule:
- cron: '20 23 * * *'
permissions:
contents: write
pull-requests: write
jobs:
generate_and_pr:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Generate and PR
uses: algorand/generator/.github/actions/sdk-codegen/@master
with:
args: "-k JAVA"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 1.15.0

## What's Changed
* Rerun code generation based on new models by @Eric-Warehime in https://github.com/algorand/java-algorand-sdk/pull/321
* Excluding gh-pages branch from cicd by @algojack in https://github.com/algorand/java-algorand-sdk/pull/325
* Build: Add SDK code generation workflow by @Eric-Warehime in https://github.com/algorand/java-algorand-sdk/pull/327
* Add branch info to sdk gen action by @Eric-Warehime in https://github.com/algorand/java-algorand-sdk/pull/330
* Generate updated client API code by @algoidurovic in https://github.com/algorand/java-algorand-sdk/pull/318
* Introduce unified `MethodCallTransactionBuilder` & deprecate `MethodCallParams.Builder` by @jasonpaulos in https://github.com/algorand/java-algorand-sdk/pull/324

## New Contributors
* @Eric-Warehime made their first contribution in https://github.com/algorand/java-algorand-sdk/pull/321
* @algoidurovic made their first contribution in https://github.com/algorand/java-algorand-sdk/pull/318

# 1.14.0
## Added
- Add foreign app address to dryrun creator (#315)
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.14.0</version>
<version>1.15.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.14.0</version>
<version>1.15.0</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.Objects;

@SuppressWarnings("unchecked")
public abstract class ApplicationBaseTransactionBuilder<T extends ApplicationBaseTransactionBuilder<T>> extends TransactionBuilder<T> {
public abstract class ApplicationBaseTransactionBuilder<T extends ApplicationBaseTransactionBuilder<T>> extends TransactionBuilder<T> implements ApplicationCallReferencesSetter<T> {
private Transaction.OnCompletion onCompletion;
private List<byte[]> applicationArgs;
private List<Address> accounts;
Expand Down Expand Up @@ -38,9 +38,7 @@ protected void applyTo(Transaction txn) {
if (foreignAssets != null) txn.foreignAssets = foreignAssets;
}

/**
* ApplicationID is the application being interacted with, or 0 if creating a new application.
*/
@Override
public T applicationId(Long applicationId) {
this.applicationId = applicationId;
return (T) this;
Expand Down Expand Up @@ -75,27 +73,19 @@ public T argsBase64Encoded(List<String> args) {
return this.args(decodedArgs);
}

/**
* Accounts lists the accounts (in addition to the sender) that may be accessed from the application logic.
*/
@Override
public T accounts(List<Address> accounts) {
this.accounts = accounts;
return (T) this;
}

/**
* ForeignApps lists the applications (in addition to txn.ApplicationID) whose global states may be accessed by this
* application. The access is read-only.
*/
@Override
public T foreignApps(List<Long> foreignApps) {
this.foreignApps = foreignApps;
return (T) this;
}

/**
* ForeignAssets lists the assets whose global states may be accessed by this
* application. The access is read-only.
*/
@Override
public T foreignAssets(List<Long> foreignAssets) {
this.foreignAssets = foreignAssets;
return (T) this;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.algorand.algosdk.builder.transaction;

import java.util.List;

import com.algorand.algosdk.crypto.Address;

public interface ApplicationCallReferencesSetter<T extends ApplicationCallReferencesSetter<T>> {

/**
* ApplicationID is the application being interacted with, or 0 if creating a new application.
*/
public T applicationId(Long applicationId);

/**
* Accounts lists the accounts (in addition to the sender) that may be accessed from the application logic.
*/
public T accounts(List<Address> accounts);

/**
* ForeignApps lists the applications (in addition to txn.ApplicationID) whose global states may be accessed by this
* application. The access is read-only.
*/
public T foreignApps(List<Long> foreignApps);

/**
* ForeignAssets lists the assets whose global states may be accessed by this
* application. The access is read-only.
*/
public T foreignAssets(List<Long> foreignAssets);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.algorand.algosdk.transaction.Transaction;

@SuppressWarnings("unchecked")
public class ApplicationCreateTransactionBuilder<T extends ApplicationCreateTransactionBuilder<T>> extends ApplicationUpdateTransactionBuilder<T> {
public class ApplicationCreateTransactionBuilder<T extends ApplicationCreateTransactionBuilder<T>> extends ApplicationUpdateTransactionBuilder<T> implements StateSchemaSetter<T> {
private StateSchema localStateSchema;
private StateSchema globalStateSchema;
private Long extraPages = 0L;
Expand Down Expand Up @@ -54,30 +54,19 @@ public T optIn(boolean optIn) {
return (T) this;
}

/**
* LocalStateSchema sets limits on the number of strings and integers that may be stored in an account's LocalState.
* for this application. The larger these limits are, the larger minimum balance must be maintained inside the
* account of any users who opt into this application. The LocalStateSchema is immutable.
*/
@Override
public T localStateSchema(StateSchema localStateSchema) {
this.localStateSchema = localStateSchema;
return (T) this;
}

/**
* GlobalStateSchema sets limits on the number of strings and integers that may be stored in the GlobalState. The
* larger these limits are, the larger minimum balance must be maintained inside the creator's account (in order to
* 'pay' for the state that can be used). The GlobalStateSchema is immutable.
*/
@Override
public T globalStateSchema(StateSchema globalStateSchema) {
this.globalStateSchema = globalStateSchema;
return (T) this;
}

/**
* extraPages allows you to rent extra pages of memory for the application. Each page is 2048 bytes of shared
* memory between approval and clear state programs. extraPages parameter must be an integer between 0 and 3 inclusive.
*/
@Override
public T extraPages(Long extraPages) {
if (extraPages == null || extraPages < 0 || extraPages > 3) {
throw new IllegalArgumentException("extraPages must be an integer between 0 and 3 inclusive");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.algorand.algosdk.transaction.Transaction;

@SuppressWarnings("unchecked")
public class ApplicationUpdateTransactionBuilder<T extends ApplicationUpdateTransactionBuilder<T>> extends ApplicationBaseTransactionBuilder<T> {
public class ApplicationUpdateTransactionBuilder<T extends ApplicationUpdateTransactionBuilder<T>> extends ApplicationBaseTransactionBuilder<T> implements TEALProgramSetter<T> {
private TEALProgram approvalProgram;
private TEALProgram clearStateProgram;

Expand All @@ -27,18 +27,13 @@ protected void applyTo(Transaction txn) {
super.applyTo(txn);
}

/**
* ApprovalProgram determines whether or not this ApplicationCall transaction will be approved or not.
*/
@Override
public T approvalProgram(TEALProgram approvalProgram) {
this.approvalProgram = approvalProgram;
return (T) this;
}

/**
* ClearStateProgram executes when a clear state ApplicationCall transaction is executed. This program may not
* reject the transaction, only update state.
*/
@Override
public T clearStateProgram(TEALProgram clearStateProgram) {
this.clearStateProgram = clearStateProgram;
return (T) this;
Expand Down
Loading

0 comments on commit 704d1fe

Please sign in to comment.