Skip to content

Commit

Permalink
Improve abi types in wasmv1 (#27)
Browse files Browse the repository at this point in the history
* WIP improve ABI types

Signed-off-by: Jean-François Morcillo <[email protected]>

* Factorize Result messages

Signed-off-by: Jean-François Morcillo <[email protected]>

* Response to some comments in #17

Signed-off-by: Jean-François Morcillo <[email protected]>

* Add Time related operations

Signed-off-by: Jean-François Morcillo <[email protected]>

* Add CompareNative[Address|PubKey|Sig]

Signed-off-by: Jean-François Morcillo <[email protected]>

* Add VerifyNativeSigRequest and fixed -> int

Signed-off-by: Jean-François Morcillo <[email protected]>

* Add CompareNativeAmount and Keccak256 hashing

Signed-off-by: Jean-François Morcillo <[email protected]>

* Add VerifyEvmSigResult VerifyEvmSigResult VerifyEvmSigResult

Signed-off-by: Jean-François Morcillo <[email protected]>

* Add TransferCoinsResult GenerateEventResult

Signed-off-by: Jean-François Morcillo <[email protected]>

* For Verify*Request sig is the first argument

Signed-off-by: Jean-François Morcillo <[email protected]>

* Add CreateSCResult

Signed-off-by: Jean-François Morcillo <[email protected]>

* Add FunctionExistsResult

Signed-off-by: Jean-François Morcillo <[email protected]>

* Add all but 1 request/result for legacy abi

Signed-off-by: Jean-François Morcillo <[email protected]>

* Various .proto improvements (#19)

* Unify current_thread and current_period

* Removed Non 'For' ABIs

* Updated numbers in ABI Results

* Removed logs / trace / prints

* Forgot to remove some duplicated definitions

* Apply modification from issue #246

see massalabs/massa-sc-runtime#246 (comment) for details

GenerateEvent takes bytes
Use the optional keyword when appropriate
Use StringValue for optional string

Signed-off-by: Jean-François Morcillo <[email protected]>

* Added prefix to GetOpKeysRequest (#24)

* Use google.protobuf.xIntxxValue for int values to discriminate 0 form none

Signed-off-by: Jean-François Morcillo <[email protected]>

* unsafe random and send async message types

* add to oneof

* add local_execution_response to oneof

* doc

* regen doc

* Revert Use google.protobuf.xIntxxValue for int values to discriminate 0 form none

Signed-off-by: Jean-François Morcillo <[email protected]>

* Fix PR comment

Signed-off-by: Jean-François Morcillo <[email protected]>

* Remove useless CheckBlake3HashRequest

Signed-off-by: Jean-François Morcillo <[email protected]>

* Remove useless CompareSigRequest

Signed-off-by: Jean-François Morcillo <[email protected]>

* GetOriginOperationId request & result + doc

* Reference

* Fix DateNowResult, remove useless ProcessExitResult

Signed-off-by: Jean-François Morcillo <[email protected]>

* Remove unused VerifyBlsSingleSigRequest, VerifyBlsMultiSigRequest, SeedRequest, DateNowRequest, ProcessExitRequest

Signed-off-by: Jean-François Morcillo <[email protected]>

* Rename Blake3HashRequest to HashBlake3Request for consistency

Signed-off-by: Jean-François Morcillo <[email protected]>

* Better names

Signed-off-by: Jean-François Morcillo <[email protected]>

* Evm requests & results

---------

Signed-off-by: Jean-François Morcillo <[email protected]>
Co-authored-by: Jean-François Morcillo <[email protected]>
Co-authored-by: Leo-Besancon <[email protected]>
Co-authored-by: Thomas Plisson <[email protected]>
Co-authored-by: Eitu33 <[email protected]>
  • Loading branch information
5 people authored Jul 26, 2023
1 parent 5ce92e6 commit a20f10a
Show file tree
Hide file tree
Showing 13 changed files with 6,530 additions and 618 deletions.
3,814 changes: 3,692 additions & 122 deletions doc/abi.html

Large diffs are not rendered by default.

1,939 changes: 1,877 additions & 62 deletions doc/abi.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions doc/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,13 @@ <h3 id="massa.api.v1.LargestStakersContext">LargestStakersContext</h3>
<td><p>Slot </p></td>
</tr>

<tr>
<td>in_downtime</td>
<td><a href="#bool">bool</a></td>
<td></td>
<td><p>If the chain is in downtime, we will return the last snapshot before the downtime </p></td>
</tr>

</tbody>
</table>

Expand Down
1 change: 1 addition & 0 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ LargestStakers context
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| slot | [massa.model.v1.Slot](#massa-model-v1-Slot) | | Slot |
| in_downtime | [bool](#bool) | | If the chain is in downtime, we will return the last snapshot before the downtime |



Expand Down
254 changes: 48 additions & 206 deletions doc/commons.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,6 @@ <h2>Table of Contents</h2>
<a href="#massa%2fmodel%2fv1%2faddress.proto">massa/model/v1/address.proto</a>
<ul>

<li>
<a href="#massa.model.v1.NativeAddress"><span class="badge">M</span>NativeAddress</a>
</li>


<li>
<a href="#massa.model.v1.AddressCategory"><span class="badge">E</span>AddressCategory</a>
Expand Down Expand Up @@ -475,25 +471,6 @@ <h2>Table of Contents</h2>



</ul>
</li>


<li>
<a href="#massa%2fmodel%2fv1%2fsignature.proto">massa/model/v1/signature.proto</a>
<ul>

<li>
<a href="#massa.model.v1.NativePubKey"><span class="badge">M</span>NativePubKey</a>
</li>

<li>
<a href="#massa.model.v1.NativeSig"><span class="badge">M</span>NativeSig</a>
</li>




</ul>
</li>

Expand Down Expand Up @@ -528,21 +505,6 @@ <h2>Table of Contents</h2>



</ul>
</li>


<li>
<a href="#massa%2fmodel%2fv1%2fhash.proto">massa/model/v1/hash.proto</a>
<ul>

<li>
<a href="#massa.model.v1.NativeHash"><span class="badge">M</span>NativeHash</a>
</li>




</ul>
</li>

Expand Down Expand Up @@ -603,6 +565,10 @@ <h2>Table of Contents</h2>
</li>


<li>
<a href="#massa.model.v1.ComparisonResult"><span class="badge">E</span>ComparisonResult</a>
</li>



</ul>
Expand Down Expand Up @@ -1275,44 +1241,6 @@ <h2 id="massa/model/v1/address.proto">massa/model/v1/address.proto</h2><a href="
<p></p>


<h3 id="massa.model.v1.NativeAddress">NativeAddress</h3>
<p>Massa NativeAddress</p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>category</td>
<td><a href="#massa.model.v1.AddressCategory">AddressCategory</a></td>
<td></td>
<td><p>Address category </p></td>
</tr>

<tr>
<td>version</td>
<td><a href="#fixed64">fixed64</a></td>
<td></td>
<td><p>Address version </p></td>
</tr>

<tr>
<td>content</td>
<td><a href="#bytes">bytes</a></td>
<td></td>
<td><p>Address content </p></td>
</tr>

</tbody>
</table>







<h3 id="massa.model.v1.AddressCategory">AddressCategory</h3>
Expand Down Expand Up @@ -2905,82 +2833,6 @@ <h3 id="massa.model.v1.SelectorDraws">SelectorDraws</h3>



<div class="file-heading">
<h2 id="massa/model/v1/signature.proto">massa/model/v1/signature.proto</h2><a href="#title">Top</a>
</div>
<p></p>


<h3 id="massa.model.v1.NativePubKey">NativePubKey</h3>
<p></p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>version</td>
<td><a href="#fixed64">fixed64</a></td>
<td></td>
<td><p> </p></td>
</tr>

<tr>
<td>content</td>
<td><a href="#bytes">bytes</a></td>
<td></td>
<td><p> </p></td>
</tr>

</tbody>
</table>





<h3 id="massa.model.v1.NativeSig">NativeSig</h3>
<p></p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>version</td>
<td><a href="#fixed64">fixed64</a></td>
<td></td>
<td><p> </p></td>
</tr>

<tr>
<td>content</td>
<td><a href="#bytes">bytes</a></td>
<td></td>
<td><p> </p></td>
</tr>

</tbody>
</table>













<div class="file-heading">
<h2 id="massa/model/v1/endorsement.proto">massa/model/v1/endorsement.proto</h2><a href="#title">Top</a>
</div>
Expand Down Expand Up @@ -3071,6 +2923,13 @@ <h3 id="massa.model.v1.SignedEndorsement">SignedEndorsement</h3>
<td><p>A secure hash of the data. See also [massa_hash::Hash] </p></td>
</tr>

<tr>
<td>serialized_size</td>
<td><a href="#fixed64">fixed64</a></td>
<td></td>
<td><p>The size of the serialized endorsement </p></td>
</tr>

</tbody>
</table>

Expand Down Expand Up @@ -3104,14 +2963,14 @@ <h3 id="massa.model.v1.NativeAmount">NativeAmount</h3>

<tr>
<td>mantissa</td>
<td><a href="#fixed64">fixed64</a></td>
<td><a href="#uint64">uint64</a></td>
<td></td>
<td><p>Mantissa </p></td>
</tr>

<tr>
<td>scale</td>
<td><a href="#fixed32">fixed32</a></td>
<td><a href="#uint32">uint32</a></td>
<td></td>
<td><p>Scale </p></td>
</tr>
Expand All @@ -3131,51 +2990,6 @@ <h3 id="massa.model.v1.NativeAmount">NativeAmount</h3>



<div class="file-heading">
<h2 id="massa/model/v1/hash.proto">massa/model/v1/hash.proto</h2><a href="#title">Top</a>
</div>
<p></p>


<h3 id="massa.model.v1.NativeHash">NativeHash</h3>
<p></p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>version</td>
<td><a href="#fixed64">fixed64</a></td>
<td></td>
<td><p> </p></td>
</tr>

<tr>
<td>content</td>
<td><a href="#bytes">bytes</a></td>
<td></td>
<td><p> </p></td>
</tr>

</tbody>
</table>













<div class="file-heading">
<h2 id="massa/model/v1/block.proto">massa/model/v1/block.proto</h2><a href="#title">Top</a>
</div>
Expand Down Expand Up @@ -3607,13 +3421,6 @@ <h3 id="massa.model.v1.SecureShare">SecureShare</h3>
<td><p>A secure hash of the data. See also [massa_hash::Hash] </p></td>
</tr>

<tr>
<td>serialized_size</td>
<td><a href="#fixed64">fixed64</a></td>
<td></td>
<td><p>The size of the serialized endorsement </p></td>
</tr>

</tbody>
</table>

Expand All @@ -3623,6 +3430,41 @@ <h3 id="massa.model.v1.SecureShare">SecureShare</h3>



<h3 id="massa.model.v1.ComparisonResult">ComparisonResult</h3>
<p>Comparison result</p>
<table class="enum-table">
<thead>
<tr><td>Name</td><td>Number</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>COMPARISON_RESULT_UNSPECIFIED</td>
<td>0</td>
<td><p></p></td>
</tr>

<tr>
<td>COMPARISON_RESULT_LOWER</td>
<td>1</td>
<td><p>left is lower</p></td>
</tr>

<tr>
<td>COMPARISON_RESULT_EQUAL</td>
<td>2</td>
<td><p>left and right are equal</p></td>
</tr>

<tr>
<td>COMPARISON_RESULT_GREATER</td>
<td>3</td>
<td><p>left is greater</p></td>
</tr>

</tbody>
</table>




Expand Down
Loading

0 comments on commit a20f10a

Please sign in to comment.