Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .test-env
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SDK_TESTING_HARNESS="test-harness"

INSTALL_ONLY=0

VERBOSE_HARNESS=0
VERBOSE_HARNESS=1

# WARNING: If set to 1, new features will be LOST when downloading the test harness.
# REGARDLESS: modified features are ALWAYS overwritten.
Expand Down
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
128 changes: 128 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[email protected].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ Run non-test-harness related unit tests

* `make pytest-unit`

We use cucumber testing for all of our SDKs, including this one. Please refer to [algorand-sdk-testing](https://github.com/algorand/algorand-sdk-testing#readme) for guidance and existing tests that you may need to update. Depending on the type of update you wish to contribute, you may also need to have corresponding updates in the other SDKs (Go, JS, and Java). Feel welcome to ask for collaboration on that front.

## Quick start

Here's a simple example you can run without a node.
Expand Down
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