Welcome back to part two of the infinitely many¹ parted series on what’s getting merged in Tezos. As this week wasn’t the heaviest in terms of MRs, I’m going to add an additional spotlight a module. Without further ado, let’s get into it!

Merged MRs

Docs: add generation for client’s registered errors and RPCs.

For developers to build on top of Tezos, they must first understand what’s going on. Documentation does that. This MR adds code to generate documentation for the JSON RPCs and errors. You can see what this documentation looks like by following the links.

Replace Map.find by Map.find_opt in the protocol

In OCaml’s standard library, various functions throw exceptions. Though this makes some things easier, but it’s not good if you want to avoid exceptions. For example, you should always check to make sure that the element you get from a map was added to the map first, unless you have an invariant that guarantees that the element will be in the map. Newer versions of OCaml’s standard library include a find_opt function in addition to the standard find , which returns an option type. For those not familiar with option types, they indicate that a value may not be present. This is useful when indicating that the element you are trying to retrieve from a map may not actually be there. Before accessing the element, the value must be checked and the potential error must be handled. This makes exceptions at runtime significantly less likely. Some alternative standard libraries, like Jane Street's Core have this behavior by default. Now we're using it in the protocol, which will hopefully help catch bugs before runtime.

Get rid of faucet operations, introduce redemption operations

As Arthur announced a few weeks ago, the faucet operation will soon be eliminated from the alphanet. This MR removes the faucet operation and adds a new activation operation, which is used to activate one of the pre-allocated accounts. More information on these accounts will become available once this code hits the alphanet.

Quyen/isolate transfer

This MR adds a new type to create a raw version of several types. This is primarily used in tests.

This module defines the numbers that are used in Michelson. Michelson uses arbitrary-precision integers. This makes a lot of things easier, mostly because you don’t have to worry about integer overflows when reasoning about your code. There are two distinct types of numbers: integers and naturals. Both of these types are represented by the concrete type Z.t . A phantom type is used to differentiate them. Phantom types generally work as follows: type 'a x = Z.t and then can create different versions of the type by putting something different as the polymorphic parameter. You can also easily write functions that ignore the parameter. This module then uses that phantom type parameter to export the same functionality with different types, making it impossible to mix them up outside the module. You can see this module in action in the Michelson interpreter, albeit as Script_int .

Footnotes

1 Unless I die (impossible), give up (maybe), or am taken by the secret world government (probable)