Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New minor version #303

Merged
merged 89 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
f9d76d1
Extend assert sum example and ensure determinism among union types
nielstron Nov 1, 2023
50441be
Extend the scope of determinism check
nielstron Nov 1, 2023
f0402bb
Bump pluthon version, which uses ordered-set itself
nielstron Nov 1, 2023
6738356
Merge pull request #285 from OpShin/fix/determinism_union_types
nielstron Nov 1, 2023
3dc84e0
Bump black from 23.10.1 to 23.11.0
dependabot[bot] Nov 9, 2023
4d91970
Merge pull request #286 from OpShin/dependabot/pip/dev/black-23.11.0
dependabot[bot] Nov 14, 2023
96e47f2
Minor fix
nielstron Dec 8, 2023
0b23607
Fix copying in the right place for rewrites
nielstron Dec 11, 2023
efab329
Fix deepcopy issue for patternizations
nielstron Dec 11, 2023
31c59f8
Merge pull request #293 from OpShin/fix/deepcopy
nielstron Dec 14, 2023
e96f5a5
Add a flexible implementation of binary operations in the type defs
nielstron Dec 14, 2023
d14c212
Fix tests
nielstron Dec 14, 2023
0e84c33
Fix int formatting
nielstron Dec 14, 2023
21980a8
Bump dependencies
nielstron Dec 14, 2023
9a47122
Bump pluthon version to disable iterative unfolding
nielstron Dec 15, 2023
55891c8
Add type inference for list slicing
nielstron Dec 15, 2023
93fdcdd
Add compiler support for slice list
nielstron Dec 15, 2023
2f8730c
Add implementation of slice list and tests
nielstron Dec 15, 2023
d47fe75
Bump pluthon version
nielstron Dec 15, 2023
fc5b477
Merge pull request #294 from OpShin/feat/flexible_add
nielstron Dec 15, 2023
7441b1f
Improve error messages for union type and make merging stronger
nielstron Dec 15, 2023
8193fd6
Merge pull request #295 from OpShin/feat/slice_list
nielstron Dec 15, 2023
3b82458
Merge pull request #296 from OpShin/fix/unify_lists
nielstron Dec 15, 2023
d17261a
Add breaking testcase due to retyping of variables
nielstron Dec 30, 2023
b1fcf0b
Disallow retyping variables
nielstron Dec 30, 2023
3123243
Mark retyping cases as expected failure
nielstron Dec 30, 2023
8c2d321
Merge pull request #298 from OpShin/fix/disallow_retyping
nielstron Dec 30, 2023
5232df5
Add testcase for retyping while loops
nielstron Dec 30, 2023
2472183
Adjust compiler to not use explicit statemonad at all
nielstron Dec 22, 2023
c74a1c3
Remove statemonad in rewrites/optimizers
nielstron Dec 22, 2023
7ef99f2
Remove state monad from other stuff
nielstron Dec 22, 2023
bf96bb3
Fix invocation of functions
nielstron Dec 23, 2023
4b8bb3e
Remove incorrect force
nielstron Dec 23, 2023
89d9303
Fix builtin usage
nielstron Dec 23, 2023
53ccf27
Moar fixes
nielstron Dec 23, 2023
ee671d2
Fix while compilation
nielstron Dec 23, 2023
703408c
Fix if/else and while
nielstron Dec 23, 2023
eee615b
Fix for
nielstron Dec 23, 2023
5f03991
Fix zero-ary functions and the hashlib impl
nielstron Dec 26, 2023
0a36fdb
Clean up imports
nielstron Dec 26, 2023
70cdf34
Fix state monad emulation
nielstron Dec 26, 2023
33cb89f
Fix scoping of classes
nielstron Dec 27, 2023
90eeeeb
Rename to 1... to avoid name conflict
nielstron Dec 28, 2023
d0a167f
Fix assignment of variables in list expressions
nielstron Dec 28, 2023
71dfdb3
Add deepcopy
nielstron Dec 28, 2023
e202568
Fix formatting of dataclass
nielstron Dec 28, 2023
e76d1f7
Use names before scoping where possible
nielstron Dec 28, 2023
f0bbd57
Fix implementation of dict get
nielstron Dec 28, 2023
c6488bc
Fix implementation of dict subscript
nielstron Dec 28, 2023
f4bed83
Fix nameerror, rename to avoid clashes
nielstron Dec 28, 2023
d1a788d
Allow returning different types in ifexpr, fix to_cbor test
nielstron Dec 28, 2023
b197190
Refactor stdlib test, add testcase that fails due to "read_vars"
nielstron Dec 28, 2023
83e142f
Remove ByteString alternative until newer pycardano version required
nielstron Dec 28, 2023
2dd5f86
Fix access error for dead vars
nielstron Dec 28, 2023
51214ed
Fix wrapping anything return values
nielstron Dec 28, 2023
1c247fd
Fix bytearray alias
nielstron Dec 28, 2023
79fad6f
Fix ite
nielstron Dec 28, 2023
f703299
Fix constructor parameter amount and builtin import
nielstron Dec 28, 2023
e8d87dc
Add failing test due to deadvar removal in external fun
nielstron Dec 28, 2023
ef2b9c0
Fix unique vars to add to state on function invocation
nielstron Dec 29, 2023
f2946f7
Fix recursive visit
nielstron Dec 29, 2023
d0e6bea
Implement not-working fix based on written vars in surrounding fun.
nielstron Dec 30, 2023
8fadd25
Re-add read-vars and make obligatory for subtyping check
nielstron Dec 30, 2023
ed0e50e
Fix overwritability by requiring same length argtyps
nielstron Dec 30, 2023
543b4c8
Fix overwriting functions with bound external variables
nielstron Dec 30, 2023
7225517
Fix test for reassigning builtin
nielstron Dec 30, 2023
16c8979
Fix integrity check
nielstron Dec 30, 2023
cd05f5e
Fix imported uplc builtins
nielstron Dec 30, 2023
f649f72
Fix version and add recursion limit increase
nielstron Dec 31, 2023
f186c43
Enable compilation of libaries (non-useful)
nielstron Dec 31, 2023
8c6f2cc
Make sure there are no naming conflicts
nielstron Jan 1, 2024
413b359
Fix
nielstron Jan 2, 2024
375a61b
Fix broken constr def
nielstron Jan 2, 2024
5d4f936
Upgrade uplc version to use
nielstron Jan 2, 2024
50ae6e4
Fix slicing/indexing
nielstron Jan 2, 2024
00302ad
Fix implementation of print
nielstron Jan 2, 2024
70b0011
Fix implementation of zero-argument polymorphic functions
nielstron Jan 2, 2024
9fadd48
Merge pull request #297 from OpShin/feat/no-state-monad
nielstron Jan 2, 2024
71cb2b8
Add failed test
nielstron Jan 2, 2024
e325884
Fix return statements outside of function scope
nielstron Jan 2, 2024
7d50232
Add test cases and handling for multiple return values
nielstron Jan 2, 2024
e116a2f
Add testcase for missing return values
nielstron Jan 2, 2024
eae732e
Add more sophisticated return path testing
nielstron Jan 2, 2024
399ba7a
Add tests for for/while else constructs
nielstron Jan 3, 2024
debb0ac
Fix type inference for for/while (make more specific)
nielstron Jan 3, 2024
6f55a7d
Merge pull request #302 from OpShin/feat/return_test
nielstron Jan 8, 2024
54b37d2
Bump version and rebuild docs
nielstron Jan 8, 2024
687379e
Use constant nth field access where possible
nielstron Jan 9, 2024
20aa8e2
Merge pull request #304 from OpShin/feat/constant_fields
nielstron Jan 9, 2024
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
3,079 changes: 2,023 additions & 1,056 deletions docs/index.js

Large diffs are not rendered by default.

42 changes: 4 additions & 38 deletions docs/opshin/builder.html
Original file line number Diff line number Diff line change
Expand Up @@ -926,10 +926,10 @@ <h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="opshin.builder.PlutusContract"><code class="flex name class">
<span>class <span class="ident">PlutusContract</span></span>
<span>(</span><span>contract: pycardano.plutus.PlutusV2Script, datum_type: Optional[Tuple[str, Type[Union[pycardano.plutus.PlutusData, dict, int, bytes, pycardano.serialization.IndefiniteList, pycardano.serialization.RawCBOR, pycardano.plutus.RawPlutusData]]]] = None, redeemer_type: Optional[Tuple[str, Type[Union[pycardano.plutus.PlutusData, dict, int, bytes, pycardano.serialization.IndefiniteList, pycardano.serialization.RawCBOR, pycardano.plutus.RawPlutusData]]]] = None, parameter_types: List[Tuple[str, Type[Union[pycardano.plutus.PlutusData, dict, int, bytes, pycardano.serialization.IndefiniteList, pycardano.serialization.RawCBOR, pycardano.plutus.RawPlutusData]]]] = &lt;factory&gt;, purpose: Iterable[<a title="opshin.builder.Purpose" href="#opshin.builder.Purpose">Purpose</a>] = (&lt;Purpose.any: &#x27;any&#x27;&gt;,), version: Optional[str] = '1.0.0', title: str = 'validator', description: Optional[str] = 'opshin 0.18.0 Smart Contract', license: Optional[str] = None)</span>
<span>(</span><span>contract: pycardano.plutus.PlutusV2Script, datum_type: Optional[Tuple[str, Type[Union[pycardano.plutus.PlutusData, dict, int, bytes, pycardano.serialization.IndefiniteList, pycardano.serialization.RawCBOR, pycardano.plutus.RawPlutusData]]]] = None, redeemer_type: Optional[Tuple[str, Type[Union[pycardano.plutus.PlutusData, dict, int, bytes, pycardano.serialization.IndefiniteList, pycardano.serialization.RawCBOR, pycardano.plutus.RawPlutusData]]]] = None, parameter_types: List[Tuple[str, Type[Union[pycardano.plutus.PlutusData, dict, int, bytes, pycardano.serialization.IndefiniteList, pycardano.serialization.RawCBOR, pycardano.plutus.RawPlutusData]]]] = &lt;factory&gt;, purpose: Iterable[<a title="opshin.builder.Purpose" href="#opshin.builder.Purpose">Purpose</a>] = (&lt;Purpose.any: &#x27;any&#x27;&gt;,), version: Optional[str] = '1.0.0', title: str = 'validator', description: Optional[str] = 'opshin 0.19.0 Smart Contract', license: Optional[str] = None)</span>
</code></dt>
<dd>
<div class="desc"><p>PlutusContract(contract: pycardano.plutus.PlutusV2Script, datum_type: Optional[Tuple[str, Type[Union[pycardano.plutus.PlutusData, dict, int, bytes, pycardano.serialization.IndefiniteList, pycardano.serialization.RawCBOR, pycardano.plutus.RawPlutusData]]]] = None, redeemer_type: Optional[Tuple[str, Type[Union[pycardano.plutus.PlutusData, dict, int, bytes, pycardano.serialization.IndefiniteList, pycardano.serialization.RawCBOR, pycardano.plutus.RawPlutusData]]]] = None, parameter_types: List[Tuple[str, Type[Union[pycardano.plutus.PlutusData, dict, int, bytes, pycardano.serialization.IndefiniteList, pycardano.serialization.RawCBOR, pycardano.plutus.RawPlutusData]]]] = <factory>, purpose: Iterable[opshin.builder.Purpose] = (<Purpose.any: 'any'>,), version: Optional[str] = '1.0.0', title: str = 'validator', description: Optional[str] = 'opshin 0.18.0 Smart Contract', license: Optional[str] = None)</p></div>
<div class="desc"><p>PlutusContract(contract: pycardano.plutus.PlutusV2Script, datum_type: Optional[Tuple[str, Type[Union[pycardano.plutus.PlutusData, dict, int, bytes, pycardano.serialization.IndefiniteList, pycardano.serialization.RawCBOR, pycardano.plutus.RawPlutusData]]]] = None, redeemer_type: Optional[Tuple[str, Type[Union[pycardano.plutus.PlutusData, dict, int, bytes, pycardano.serialization.IndefiniteList, pycardano.serialization.RawCBOR, pycardano.plutus.RawPlutusData]]]] = None, parameter_types: List[Tuple[str, Type[Union[pycardano.plutus.PlutusData, dict, int, bytes, pycardano.serialization.IndefiniteList, pycardano.serialization.RawCBOR, pycardano.plutus.RawPlutusData]]]] = <factory>, purpose: Iterable[opshin.builder.Purpose] = (<Purpose.any: 'any'>,), version: Optional[str] = '1.0.0', title: str = 'validator', description: Optional[str] = 'opshin 0.19.0 Smart Contract', license: Optional[str] = None)</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
Expand Down Expand Up @@ -1350,44 +1350,10 @@ <h3>Methods</h3>
</dd>
<dt id="opshin.builder.Purpose"><code class="flex name class">
<span>class <span class="ident">Purpose</span></span>
<span>(</span><span>*args, **kwds)</span>
<span>(</span><span>value, names=None, *, module=None, qualname=None, type=None, start=1)</span>
</code></dt>
<dd>
<div class="desc"><p>Create a collection of name/value pairs.</p>
<p>Example enumeration:</p>
<pre><code class="language-python-repl">&gt;&gt;&gt; class Color(Enum):
... RED = 1
... BLUE = 2
... GREEN = 3
</code></pre>
<p>Access them by:</p>
<ul>
<li>attribute access::</li>
</ul>
<pre><code class="language-python-repl">&gt;&gt;&gt; Color.RED
&lt;Color.RED: 1&gt;
</code></pre>
<ul>
<li>value lookup:</li>
</ul>
<pre><code class="language-python-repl">&gt;&gt;&gt; Color(1)
&lt;Color.RED: 1&gt;
</code></pre>
<ul>
<li>name lookup:</li>
</ul>
<pre><code class="language-python-repl">&gt;&gt;&gt; Color['RED']
&lt;Color.RED: 1&gt;
</code></pre>
<p>Enumerations can be iterated over, and know how many members they have:</p>
<pre><code class="language-python-repl">&gt;&gt;&gt; len(Color)
3
</code></pre>
<pre><code class="language-python-repl">&gt;&gt;&gt; list(Color)
[&lt;Color.RED: 1&gt;, &lt;Color.BLUE: 2&gt;, &lt;Color.GREEN: 3&gt;]
</code></pre>
<p>Methods can be added to enumerations, and members can have their own
attributes &ndash; see the documentation for details.</p></div>
<div class="desc"><p>An enumeration.</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
Expand Down
Loading