Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
321a02d
Merge branch 'release/v2.2.0' into develop
algobarb May 8, 2023
e2551ca
bugfix: incorrect indexer docs (#476)
tzaffi May 8, 2023
5b32f38
tweak: reorder GenericSignedTransaction type alias (#478)
tzaffi May 10, 2023
8f3a248
Enhancement: Adding `box_reference.py` to Read The Docs (#481)
tzaffi May 15, 2023
d12e0c1
Update CODEOWNERS to only refer to the devops group (#482)
onetechnical May 16, 2023
1fbd96f
Algod: Simulation run with extra budget per transaction group (#484)
ahangsu May 18, 2023
8f4643a
algod: State delta endpoints (#483)
algochoi May 19, 2023
2f89a34
add create-release-pr workflow
algobarb May 25, 2023
769a8ee
add pull_request for debugging
algobarb May 25, 2023
81739c9
add pull_request for debugging
algobarb May 25, 2023
207c277
add push for debugging
algobarb May 25, 2023
f2ce15f
debug
algobarb May 25, 2023
2874799
fix yaml
algobarb May 25, 2023
f5ae072
uncomment workflow actions
algobarb May 25, 2023
86ee83c
replace changelog steps:
algobarb May 25, 2023
568d908
add commit changes step and set changelog content as a variable
algobarb May 25, 2023
296baa7
change bash commands
algobarb May 25, 2023
81636c5
Add configuration file for changelog
algobarb May 30, 2023
3671b24
modify changlog configuration path and use new ouput method
algobarb May 30, 2023
0e241f0
add jsonConfiguration
algobarb May 30, 2023
ed98005
add #
algobarb May 30, 2023
62118ed
test release branch creation
algobarb May 30, 2023
f5a8e35
remove source ref
algobarb May 30, 2023
ab4d437
debug
algobarb May 30, 2023
503f9d7
add changelog step
algobarb May 30, 2023
02ed501
debug
algobarb May 30, 2023
480fe7d
fix update changelog step
algobarb May 30, 2023
ff1b0e1
fix update changelog step
algobarb May 30, 2023
e626a9e
fix double-quotes
algobarb May 30, 2023
bd2f161
add -e to enable backslash
algobarb May 30, 2023
18da3b6
add full changelog line
algobarb May 30, 2023
ee2c88f
test environment variable
algobarb May 30, 2023
537a5ab
fix full changelog env var
algobarb May 30, 2023
a775a1b
add pull request step
algobarb May 30, 2023
c792d85
remove set output
algobarb May 30, 2023
14d469e
fix the base reference in pull request step
algobarb May 30, 2023
3af1a5e
remove bad branch ref
algobarb May 30, 2023
d75f8f4
use github cli to create pull request
algobarb May 30, 2023
22e1df2
fix environment variable for gh_token
algobarb May 30, 2023
8c32f01
change assignee in PR
algobarb May 30, 2023
66bd19f
remove assignee
algobarb May 30, 2023
ae468c7
remove reviewer
algobarb May 30, 2023
ee2b170
update pull request step
algobarb May 30, 2023
16a6547
add setup.py version update
algobarb May 30, 2023
b9562c4
update sed command
algobarb May 30, 2023
00d933c
comment out PR creation
algobarb May 30, 2023
73a2fed
Merge branch 'master' into algobarb/relase_pr_workflow
algobarb May 31, 2023
cf56d08
add bump_version.py
algobarb May 31, 2023
a1a99fe
move bump_version.py and uncomment create pull request step
algobarb May 31, 2023
8cae6a9
fix script call
algobarb May 31, 2023
614d9bc
update CHANGELOG.md and setup.py version
algobarb May 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 127 additions & 0 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Create Release PR

on:
workflow_dispatch:
inputs:
source_ref:
description: 'Source branch, commit, or tag to create the release branch from'
default: 'develop'
type: string
release_version:
description: 'In the vX.X.X format and will be used for tag and branch name'
default: 'vx.x.x'
required: true
type: string

env:
RELEASE_VERSION: ${{ inputs.release_version }}
SOURCE_REF: ${{ inputs.source_ref }}

jobs:
create-release-pr:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ inputs.source_ref }}

- name: Create Release Branch
id: create-release-branch
run: |
if [[ $RELEASE_VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
git checkout -b release/$RELEASE_VERSION
git push --set-upstream origin release/$RELEASE_VERSION
else
echo "Version input doesn't match the regex pattern ^v[0-9]+\.[0-9]+\.[0-9]+$"
exit 1
fi
echo "release-version=$RELEASE_VERSION" >> $GITHUB_OUTPUT
echo "release-branch=release/$RELEASE_VERSION" >> $GITHUB_OUTPUT

- name: Get Latest Release
id: get-release
run: |
releases=$(curl --header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
--header "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/releases")
tag=$(echo "$releases" | jq -r '.[0].tag_name')
echo "latest-tag=$tag" >> $GITHUB_OUTPUT

- name: Build Changelog
uses: mikepenz/[email protected]
id: build-changelog
env:
PREVIOUS_VERSION: ${{ steps.get-release.outputs.latest-tag }}
with:
fromTag: ${{ env.PREVIOUS_VERSION }}
toTag: ${{ steps.create-release-branch.outputs.release-branch }}
ignorePreReleases: true
failOnError: true
configurationJson: |
{
"categories": [
{
"title": "## New Features",
"labels": [
"New Feature"
]
},
{
"title": "## Enhancement",
"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}}"
}

- name: Update Changelog
env:
CHANGELOG_CONTENT: ${{ steps.build-changelog.outputs.changelog }}
PREVIOUS_VERSION: ${{ steps.get-release.outputs.latest-tag }}
run: |
git branch --show-current
echo "$(tail -n +2 CHANGELOG.md)" > CHANGELOG.md
echo -e "# Changelog\n\n# ${RELEASE_VERSION}\n\n${CHANGELOG_CONTENT}**Full Changelog**: https://github.com/algorand/py-algorand-sdk/compare/${PREVIOUS_VERSION}...${RELEASE_VERSION}" | cat - CHANGELOG.md > temp && mv temp CHANGELOG.md

- name: Update version in setup.py
run: |
python3 scripts/bump_version.py ${RELEASE_VERSION:1}

- name: Commit Changes
uses: EndBug/[email protected]
with:
message: 'update CHANGELOG.md and setup.py version'

- name: Create Pull Request
env:
CHANGELOG_CONTENT: ${{ steps.build-changelog.outputs.changelog }}
PREVIOUS_VERSION: ${{ steps.get-release.outputs.latest-tag }}
GH_TOKEN: ${{ github.token }}
run: |
echo -e "# ${RELEASE_VERSION}\n\n${CHANGELOG_CONTENT}**Full Changelog**: https://github.com/algorand/py-algorand-sdk/compare/${PREVIOUS_VERSION}...${RELEASE_VERSION}" > msg_body.txt
export msg_body=$(cat msg_body.txt)
gh pr create --base master --title "FOR REVIEW ONLY: py-algorand-sdk $RELEASE_VERSION" --draft --label "Skip-Release-Notes" --body "$msg_body"
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

# v0.0.0

## New Features

- Algod: Simulation run with extra budget per transaction group by ahangsu in #484

## Enhancement

- tweak: reorder GenericSignedTransaction type alias by tzaffi in #478
- Enhancement: Adding `box_reference.py` to Read The Docs by tzaffi in #481
- DevOps: Update CODEOWNERS to only refer to the devops group by onetechnical in #482
- algod: State delta endpoints by algochoi in #483

## Bug Fixes

- bugfix: incorrect indexer docs by tzaffi in #476

**Full Changelog**: https://github.com/algorand/py-algorand-sdk/compare/v2.2.0...v0.0.0

# v2.2.0

## What's Changed
Expand Down
4 changes: 2 additions & 2 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.github/ @algorand/dev
.circleci/ @algorand/dev
.github/ @algorand/devops
.circleci/ @algorand/devops
6 changes: 6 additions & 0 deletions algosdk/atomic_transaction_composer.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,12 @@ def __init__(
max_log_calls: Optional[int] = None,
max_log_size: Optional[int] = None,
allow_empty_signatures: Optional[bool] = None,
extra_opcode_budget: Optional[int] = None,
) -> None:
self.max_log_calls = max_log_calls
self.max_log_size = max_log_size
self.allow_empty_signatures = allow_empty_signatures
self.extra_opcode_budget = extra_opcode_budget

@staticmethod
def from_simulation_result(
Expand All @@ -295,6 +297,10 @@ def from_simulation_result(
eval_override.allow_empty_signatures = eval_override_dict[
"allow-empty-signatures"
]
if "extra-opcode-budget" in eval_override_dict:
eval_override.extra_opcode_budget = eval_override_dict[
"extra-opcode-budget"
]

return eval_override

Expand Down
16 changes: 8 additions & 8 deletions algosdk/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -3036,6 +3036,13 @@ def __eq__(self, other):
return False


GenericSignedTransaction = Union[
SignedTransaction,
LogicSigTransaction,
MultisigTransaction,
]


def write_to_file(txns, path, overwrite=True):
"""
Write signed or unsigned transactions to a file.
Expand Down Expand Up @@ -3233,7 +3240,7 @@ def wait_for_confirmation(

def create_dryrun(
client: algod.AlgodClient,
txns: List["GenericSignedTransaction"],
txns: List[GenericSignedTransaction],
protocol_version=None,
latest_timestamp=None,
round=None,
Expand Down Expand Up @@ -3361,10 +3368,3 @@ def decode_programs(app):
app["params"]["clear-state-program"]
)
return app


GenericSignedTransaction = Union[
SignedTransaction,
LogicSigTransaction,
MultisigTransaction,
]
46 changes: 46 additions & 0 deletions algosdk/v2client/algod.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,52 @@ def set_timestamp_offset(
req = f"/devmode/blocks/offset/{offset}"
return self.algod_request("POST", req, **kwargs)

def get_ledger_state_delta(
self, round: int, **kwargs: Any
) -> AlgodResponseType:
"""
Get the ledger state delta for a round.

Args:
round (int): The round for the desired state delta

Returns:
Dict[str, Any]: Response from algod
"""
req = f"/deltas/{round}"
return self.algod_request("GET", req, **kwargs)

def get_transaction_group_ledger_state_deltas_for_round(
self, round: int, **kwargs: Any
) -> AlgodResponseType:
"""
Get the ledger state deltas for all transaction groups in a given round.

Args:
round (int): The round for the desired state delta

Returns:
Dict[str, Any]: Response from algod
"""
req = f"/deltas/{round}/txn/group"
return self.algod_request("GET", req, **kwargs)

def get_ledger_state_delta_for_transaction_group(
self, id: str, **kwargs: Any
) -> AlgodResponseType:
"""
Get the ledger state delta for a transaction group given the
transaction or group ID.

Args:
id (str): A transaction ID or transaction group ID

Returns:
Dict[str, Any]: Response from algod
"""
req = f"/deltas/txn/group/{id}"
return self.algod_request("GET", req, **kwargs)


def _specify_round_string(
block: Union[int, None], round_num: Union[int, None]
Expand Down
Loading