GithubHelp home page GithubHelp logo

algokit-utils-py's People

Contributors

aorumbayev avatar daniel-makerx avatar dependabot[bot] avatar inaie-makerx avatar joe-p avatar loedn avatar michaeltchuang avatar negar-abbasi avatar neilcampbell avatar patrickdinh avatar robdmoore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

algokit-utils-py's Issues

Fix `on_complete` behaviour on application client calls

Subject of the issue

This was reported by @cusma. The main reason is potential confusion that can be caused by the fact that user has ability to specify on complete in transaction parameters, yet its ignored in some scenarios like opt_in (where it overwrites the oncomplete to use OptInOC).

For instance:

    app_client.opt_in( # this internally is actually going to ignore the on_compete from user and set it to OptInOC
        transaction_parameters=OnCompleteCallParameters(
            on_complete=OnComplete.DeleteApplicationOC
        ),
    )

As seen above, the usage may be confusing, we either want to limit ability to use OnCompleteCallParameters (currently its a sub class of transaction params hence why it works) or account to prioritize taking the on_complete from transaction params if present.

Further notes

Based on discussion with @daniel-makerx and proposed fix in #79, the OnCompleteCallParameters and CreateTransactionParameters are no longer subclassing from common TransactionParameters.

@neilcampbell noted down issues with the propagated fix as they had additional implications on the generator-py repo that were not caught as part of the 2.2.2 release. Originally, the fix was propagated under 2.2.2, we then reverted the changes under 2.3.0 given that a heap of upstream changes would require a more thorough release coordination on beaker, beaker and python template, algokit-cli repos that we didn't account for when tagging this as a minor fix. Hence, after re evaluating the initial issue report and higher priority items around puya at the moment we decided to revert the #79 changes, log it as a proper github issue on the repo and address with proper cross repo release coordination and smoke testing. This is also due to the fact that a proper semantic tag would require a breaking change in version (v3) and this would also imply additional release coordination.

@cusma will ping you as soon as the bug is resolved properly.

TODO

  • Re introduce the solution from #79:
    • Propagate the algokit-utils version bump to algokit-client-generator-py repo + update to explicit class reference
    • Bump algokit-utils on beaker repo, beaker and python template repos.
    • Mark the release as a breaking change given that it is indeed a breaking change affecting several utils-py specific typing abstractions

Support modified LogicError message in algod 3.22

Version 3.22 of algod modified the error message when a LogicError occurs in a transaction, this change means the regex used to identify LogicErrors and extract the program count no longer works

Generate markdown docs for ingestion into the dev portal

Generate markdown api docs, similar to algokit-utils-ts for consumption/ingestion into the dev portal.
We should also try create a standardised output across:

  • algokit-utils-py
  • algokit-utils-ts
  • algokit-client-generator-py
  • algokit-client-generator-ts
  • algokit-cli

Template variables parsing

Template variables containing _ are not parsed correctly, raising DeploymentFailedError in

def check_template_variables(approval_program: str, template_values: TemplateValueDict) -> None:
   ...

EXAMPLE

Template variable: TMPL_ASSET_ID causes:

algokit_utils.deploy.DeploymentFailedError: The following template values were not provided: TMPL_ASSET

AVM Debugger compliant sourcemap and simulation trace file.

# Uncomment the following lines to enable auto generation of AVM Debugger compliant sourcemap and simulation trace file.
# Learn more about using AlgoKit AVM Debugger to debug your TEAL source codes and inspect various kinds of
# Algorand transactions in atomic groups -> https://github.com/algorandfoundation/algokit-avm-vscode-debugger
from algokit_utils.config import config
config.configure(debug=True, trace_all=True)

Can't seem to be able to generate sourcemaps and trace file from an algokit init project.

[tool.poetry.dependencies]
python = "^3.10"
beaker-pyteal = "^1.1.1"
algokit-utils = "^2.2.0"
python-dotenv = "^1.0.0"

Comment Stripping TEAL source issue

The following program:

def program():
    return pt.Seq(pt.Pop(pt.Bytes("//")), pt.Int(1))

Will generate

// GENERATED TEAL    //    PYTEAL PATH    LINE    PYTEAL
#pragma version 8    //    commentary.py  30      Compilation(approval_program, mode=Mode.Application, version=8).compile(with_sourcemap=True, annotate_teal=True, annotate_teal_headers=True)
byte "//"            //                   21      pt.Bytes('//')
pop                  //                           pt.Pop(pt.Bytes('//'))
int 1                //                           pt.Int(1)
return               //                   30      Compilation(approval_program, mode=Mode.Application, version=8).compile(with_sourcemap=True, annotate_teal=True, annotate_teal_headers=True)

Which will break with our current approach to strip comments
https://github.com/algorandfoundation/algokit-utils-py/blob/main/src/algokit_utils/deploy.py#L310-L312

Add support for specifying the storage schema on the application client

utils-ts has newly added support for specifying storage schema when calling deploy or create on the application client.
Whilst utils-py has support for specifying extra pages, it doesn't support overriding the local or global state schema.

We need to also ensure this change flows through into the Python typed client generator.

Below are the reference TS PRs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.