Skip to content

Commit

Permalink
TestSuite4 v0.4.1 (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: Victor Bargachev <[email protected]>
Co-authored-by: Vasily Selivanov <[email protected]>
  • Loading branch information
3 people authored Nov 26, 2021
1 parent ab7222c commit 0c0f624
Show file tree
Hide file tree
Showing 34 changed files with 561 additions and 263 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## 09-11-2021: TestSuite4 0.4.1

### NEW

- ABI 2.1: support for Optional type and strings
- added `ts4.core.get_now`
- added support for string seed in `make_keypair()`
- added `save_keypair()` and `load_keypair()`
- added `gen_addr(name, initial_data, keypair, wc)`
- added more error description for exit codes (ec=51,52,60...)
- added `ts4.globals.G_SHOW_GETTERS` setting
- removed obsolete `ts4.globals.G_DECODE_TUPLES`

### CHANGES

- updated `tutorial07_time.py`

### FIXES

- fixed an issue with loading from '.boc'

## 27-07-2021: TestSuite4 0.4.0

### BREAKING CHANGES
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TestSuite4 0.4.0
# TestSuite4 0.4.1

[![Chat on Telegram](https://img.shields.io/badge/chat-on%20telegram-9cf.svg)](https://t.me/ton_ts4)

Expand Down
2 changes: 1 addition & 1 deletion README_PYPI.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TestSuite4 0.4.0
# TestSuite4 0.4.1

[![Chat on Telegram](https://img.shields.io/badge/chat-on%20telegram-9cf.svg)](https://t.me/ton_ts4)

Expand Down
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: d5fbfe969203d80e3fa235bce2523f88
config: eef415edc6469fafe5ba8151fda098c3
tags: 645f666f9bcd5a90fca523b33c5a78b7
6 changes: 3 additions & 3 deletions docs/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="../genindex.html" /><link rel="search" title="Search" href="../search.html" />

<meta name="generator" content="sphinx-3.5.2, furo 2021.03.20.beta30"/>
<title>Overview: module code - TestSuite4 v0.4.0</title>
<title>Overview: module code - TestSuite4 v0.4.1</title>
<link rel="stylesheet" href="../_static/styles/furo.css?digest=978e1795dfe158b585dda6a8417f6411828bf3ed">
<link rel="stylesheet" href="../_static/pygments.css">
<link media="(prefers-color-scheme: dark)" rel="stylesheet" href="../_static/pygments_dark.css">
Expand Down Expand Up @@ -88,7 +88,7 @@
</label>
</div>
<div class="header-center">
<a href="../index.html"><div class="brand">TestSuite4 v0.4.0</div></a>
<a href="../index.html"><div class="brand">TestSuite4 v0.4.1</div></a>
</div>
<div class="header-right">
<label class="toc-overlay-icon toc-header-icon no-toc" for="__toc">
Expand All @@ -106,7 +106,7 @@
<img class="sidebar-logo only-dark" src="../_static/ts4-logo-colored.svg" alt="Dark Logo B"/>
</div>

<span class="sidebar-brand-text">TestSuite4 v0.4.0</span>
<span class="sidebar-brand-text">TestSuite4 v0.4.1</span>

</a><form class="sidebar-search-container" method="get" action="../search.html">
<input class="sidebar-search" placeholder=Search name="q">
Expand Down
119 changes: 61 additions & 58 deletions docs/_modules/tonos_ts4/BaseContract.html

Large diffs are not rendered by default.

20 changes: 15 additions & 5 deletions docs/_modules/tonos_ts4/address.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="../../genindex.html" /><link rel="search" title="Search" href="../../search.html" />

<meta name="generator" content="sphinx-3.5.2, furo 2021.03.20.beta30"/>
<title>tonos_ts4.address - TestSuite4 v0.4.0</title>
<title>tonos_ts4.address - TestSuite4 v0.4.1</title>
<link rel="stylesheet" href="../../_static/styles/furo.css?digest=978e1795dfe158b585dda6a8417f6411828bf3ed">
<link rel="stylesheet" href="../../_static/pygments.css">
<link media="(prefers-color-scheme: dark)" rel="stylesheet" href="../../_static/pygments_dark.css">
Expand Down Expand Up @@ -88,7 +88,7 @@
</label>
</div>
<div class="header-center">
<a href="../../index.html"><div class="brand">TestSuite4 v0.4.0</div></a>
<a href="../../index.html"><div class="brand">TestSuite4 v0.4.1</div></a>
</div>
<div class="header-right">
<label class="toc-overlay-icon toc-header-icon no-toc" for="__toc">
Expand All @@ -106,7 +106,7 @@
<img class="sidebar-logo only-dark" src="../../_static/ts4-logo-colored.svg" alt="Dark Logo B"/>
</div>

<span class="sidebar-brand-text">TestSuite4 v0.4.0</span>
<span class="sidebar-brand-text">TestSuite4 v0.4.1</span>

</a><form class="sidebar-search-container" method="get" action="../../search.html">
<input class="sidebar-search" placeholder=Search name="q">
Expand Down Expand Up @@ -210,13 +210,15 @@ <h1>Source code for tonos_ts4.address</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="bp">self</span></div>

<div class="viewcode-block" id="Address.zero_addr"><a class="viewcode-back" href="../../ts4.html#tonos_ts4.ts4.Address.zero_addr">[docs]</a> <span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">zero_addr</span><span class="p">(</span><span class="n">wc</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">zero_addr</span><span class="p">(</span><span class="n">wc</span> <span class="o">=</span> <span class="mi">0</span><span class="p">):</span>
<span class="sd">"""Creates a zero address instance in a given workchain.</span>

<span class="sd"> :param num wc: Workchain ID</span>
<span class="sd"> :return: Object</span>
<span class="sd"> :rtype: Address</span>
<span class="sd"> """</span>
<span class="k">if</span> <span class="n">wc</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> <span class="n">wc</span> <span class="o">=</span> <span class="mi">0</span>

<span class="n">addr</span> <span class="o">=</span> <span class="s1">'</span><span class="si">{}</span><span class="s1">:</span><span class="si">{}</span><span class="s1">'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">wc</span><span class="p">,</span> <span class="s1">'0'</span><span class="o">*</span><span class="mi">64</span><span class="p">)</span>
<span class="k">return</span> <span class="n">Address</span><span class="p">(</span><span class="n">addr</span><span class="p">)</span></div>

Expand Down Expand Up @@ -404,13 +406,21 @@ <h1>Source code for tonos_ts4.address</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">==</span> <span class="s1">'unknown'</span></div>

<div class="viewcode-block" id="Msg.is_bounced"><a class="viewcode-back" href="../../ts4.html#tonos_ts4.ts4.Msg.is_bounced">[docs]</a> <span class="k">def</span> <span class="nf">is_bounced</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""Checks if a current message is bounced.</span>
<span class="sd">"""Checks if the given message is bounced.</span>

<span class="sd"> :return: Result of check</span>
<span class="sd"> :rtype: bool</span>
<span class="sd"> """</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">==</span> <span class="s1">'bounced'</span></div>

<div class="viewcode-block" id="Msg.is_getter"><a class="viewcode-back" href="../../ts4.html#tonos_ts4.ts4.Msg.is_getter">[docs]</a> <span class="k">def</span> <span class="nf">is_getter</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""Checks if the given message is a getter call.</span>

<span class="sd"> :return: Result of check</span>
<span class="sd"> :rtype: bool</span>
<span class="sd"> """</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">==</span> <span class="s1">'call_getter'</span></div>

<div class="viewcode-block" id="Msg.dump_data"><a class="viewcode-back" href="../../ts4.html#tonos_ts4.ts4.Msg.dump_data">[docs]</a> <span class="k">def</span> <span class="nf">dump_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""Dumps message data.</span>
<span class="sd"> """</span>
Expand Down
25 changes: 17 additions & 8 deletions docs/_modules/tonos_ts4/decoder.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="../../genindex.html" /><link rel="search" title="Search" href="../../search.html" />

<meta name="generator" content="sphinx-3.5.2, furo 2021.03.20.beta30"/>
<title>tonos_ts4.decoder - TestSuite4 v0.4.0</title>
<title>tonos_ts4.decoder - TestSuite4 v0.4.1</title>
<link rel="stylesheet" href="../../_static/styles/furo.css?digest=978e1795dfe158b585dda6a8417f6411828bf3ed">
<link rel="stylesheet" href="../../_static/pygments.css">
<link media="(prefers-color-scheme: dark)" rel="stylesheet" href="../../_static/pygments_dark.css">
Expand Down Expand Up @@ -88,7 +88,7 @@
</label>
</div>
<div class="header-center">
<a href="../../index.html"><div class="brand">TestSuite4 v0.4.0</div></a>
<a href="../../index.html"><div class="brand">TestSuite4 v0.4.1</div></a>
</div>
<div class="header-right">
<label class="toc-overlay-icon toc-header-icon no-toc" for="__toc">
Expand All @@ -106,7 +106,7 @@
<img class="sidebar-logo only-dark" src="../../_static/ts4-logo-colored.svg" alt="Dark Logo B"/>
</div>

<span class="sidebar-brand-text">TestSuite4 v0.4.0</span>
<span class="sidebar-brand-text">TestSuite4 v0.4.1</span>

</a><form class="sidebar-search-container" method="get" action="../../search.html">
<input class="sidebar-search" placeholder=Search name="q">
Expand Down Expand Up @@ -170,7 +170,7 @@ <h1>Source code for tonos_ts4.decoder</h1><div class="highlight"><pre>

<span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">defaults</span><span class="p">():</span>
<span class="k">return</span> <span class="n">Decoder</span><span class="p">(</span><span class="n">ints</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">strings</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span>
<span class="k">return</span> <span class="n">Decoder</span><span class="p">(</span><span class="n">ints</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">strings</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">tuples</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">fill_nones</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
<span class="k">return</span> <span class="n">Decoder</span><span class="p">(</span>
Expand Down Expand Up @@ -201,6 +201,9 @@ <h1>Source code for tonos_ts4.decoder</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="nb">type</span> <span class="o">==</span> <span class="s1">'cell'</span><span class="p">:</span>
<span class="k">return</span> <span class="n">Cell</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>

<span class="k">if</span> <span class="nb">type</span> <span class="o">==</span> <span class="s1">'string'</span><span class="p">:</span>
<span class="k">return</span> <span class="n">value</span>

<span class="k">if</span> <span class="nb">type</span> <span class="o">==</span> <span class="s1">'bytes'</span><span class="p">:</span>
<span class="k">return</span> <span class="n">bytes2str</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="k">if</span> <span class="n">decoder</span><span class="o">.</span><span class="n">strings</span> <span class="k">else</span> <span class="n">Bytes</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>

Expand All @@ -218,10 +221,7 @@ <h1>Source code for tonos_ts4.decoder</h1><div class="highlight"><pre>
<span class="n">m</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="sa">r</span><span class="s1">'^map\((.*),(.*)\)$'</span><span class="p">,</span> <span class="nb">type</span><span class="p">)</span>
<span class="k">if</span> <span class="n">m</span><span class="p">:</span>
<span class="n">key_type</span> <span class="o">=</span> <span class="n">m</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="n">val_type</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</span><span class="n">name</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="nb">type</span> <span class="o">=</span> <span class="n">m</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="k">if</span> <span class="s1">'components'</span> <span class="ow">in</span> <span class="n">abi_type</span><span class="o">.</span><span class="n">raw_</span><span class="p">:</span>
<span class="n">val_type</span><span class="p">[</span><span class="s1">'components'</span><span class="p">]</span> <span class="o">=</span> <span class="n">abi_type</span><span class="o">.</span><span class="n">raw_</span><span class="p">[</span><span class="s1">'components'</span><span class="p">]</span>
<span class="n">val_type</span> <span class="o">=</span> <span class="n">AbiType</span><span class="p">(</span><span class="n">val_type</span><span class="p">)</span>
<span class="n">val_type</span> <span class="o">=</span> <span class="n">create_AbiType</span><span class="p">(</span><span class="n">m</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span> <span class="n">abi_type</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">()</span>
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">value</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
<span class="k">if</span> <span class="n">key_type</span> <span class="o">==</span> <span class="s1">'address'</span><span class="p">:</span>
Expand All @@ -231,6 +231,15 @@ <h1>Source code for tonos_ts4.decoder</h1><div class="highlight"><pre>
<span class="n">res</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">decode_json_value</span><span class="p">(</span><span class="n">value</span><span class="p">[</span><span class="n">k</span><span class="p">],</span> <span class="n">val_type</span><span class="p">,</span> <span class="n">decoder</span><span class="p">)</span>
<span class="k">return</span> <span class="n">res</span>

<span class="n">m</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="sa">r</span><span class="s1">'^optional\((.*)\)$'</span><span class="p">,</span> <span class="nb">type</span><span class="p">)</span>
<span class="k">if</span> <span class="n">m</span><span class="p">:</span>
<span class="k">if</span> <span class="n">value</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">None</span>
<span class="n">val_type</span> <span class="o">=</span> <span class="n">create_AbiType</span><span class="p">(</span><span class="n">m</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">1</span><span class="p">),</span> <span class="n">abi_type</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">decode_json_value</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">val_type</span><span class="p">,</span> <span class="n">decoder</span><span class="p">)</span>
<span class="k">return</span> <span class="n">res</span>


<span class="nb">print</span><span class="p">(</span><span class="nb">type</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
<span class="n">ts4</span><span class="o">.</span><span class="n">verbose_</span><span class="p">(</span><span class="s2">"Unsupported type '</span><span class="si">{}</span><span class="s2">'"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">type</span><span class="p">))</span>
<span class="k">return</span> <span class="n">value</span>
Expand Down
Loading

0 comments on commit 0c0f624

Please sign in to comment.